text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.hewking.custom.title.NavTitleBar
            android:id="@+id/titlebar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize">

        </com.hewking.custom.title.NavTitleBar>

        <com.hewking.custom.roundimage.RoundImageView
            android:id="@+id/iv_round"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:padding="10dp"
            android:src="@mipmap/nice_girl"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/titlebar"
            app:r_show_tag="true"
            app:r_tag_res="@mipmap/icon_admin" />

        <com.hewking.custom.MaskLinearLayout
            android:id="@+id/masked"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/base_50dpi"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/iv_round"
            app:mask_drawable="@drawable/mak_shape"
            app:mask_showmask="true">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="heheda" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="heheda" />

        </com.hewking.custom.MaskLinearLayout>

        <com.hewking.custom.TagRectView
            android:id="@+id/rectview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/masked" />

        <com.hewking.custom.LoadingView
            android:id="@+id/loading"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/rectview" />

        <com.hewking.custom.TextLoadView
            android:id="@+id/tv_loading"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            app:h_color="@color/colorAccent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/loading" />

        <com.hewking.custom.SearchView
            android:id="@+id/ssearchView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tv_loading" />

        <com.hewking.custom.shader.BitmapShaderDemoView
            android:id="@+id/bitshader"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/ssearchView" />

        <com.hewking.custom.loading.DyLineLoadingView
            android:id="@+id/dyLoading"
            android:layout_margin="20dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toBottomOf="@id/bitshader" />

        <com.hewking.hencoder.HaloProgressView
            android:id="@+id/halo"
            android:layout_width="300dp"
            android:layout_height="200dp"
            android:layout_marginTop="20dp"
            android:src="@drawable/asm_logo"
            android:scaleType="centerCrop"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/dyLoading"
            android:layout_marginBottom="20dp" />

        <com.hewking.custom.loading.MathWalletLoadingView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/halo"
            android:layout_marginBottom="20dp"/>

    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>


text:
package haw.isp.v2;

import haw.isp.Constraint;

/**
 * Created by florian on 15.06.16.
 */
public class Arc {
    public final Constraint constraint;
    public final Variable v1;
    public final Variable v2;

    public Arc(Constraint constraint, Variable v1, Variable v2) {
        this.constraint = constraint;
        this.v1 = v1;
        this.v2 = v2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Arc arc = (Arc) o;

        if (constraint != null ? !constraint.equals(arc.constraint) : arc.constraint != null) return false;
        if (v1 != null ? !v1.equals(arc.v1) : arc.v1 != null) return false;
        return v2 != null ? v2.equals(arc.v2) : arc.v2 == null;

    }

    @Override
    public int hashCode() {
        int result = constraint != null ? constraint.hashCode() : 0;
        result = 31 * result + (v1 != null ? v1.hashCode() : 0);
        result = 31 * result + (v2 != null ? v2.hashCode() : 0);
        return result;
    }
}

redpajama_set_name: RedPajamaGithub


text:
import {iterateCursor} from '#core/dom';
import {toArray} from '#core/types/array';
import {tryParseJson} from '#core/types/object/json';
import {padStart} from '#core/types/string';
import {utf8Encode} from '#core/types/string/bytes';

import {
  base64Decode,
  decryptAesGcmImpl,
  safeAesGcmImportKey,
} from '#third_party/subscriptions-project/aes_gcm';

export class CryptoHandler {
  /**
   * Creates an instance of CryptoHandler.
   * @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc
   */
  constructor(ampdoc) {
    /** @private @const {!../../../src/service/ampdoc-impl.AmpDoc} */
    this.ampdoc_ = ampdoc;

    /** @private {?Promise} */
    this.decryptionPromise_ = null;

    const parsedEncryptedKeys = this.ampdoc_
      .getRootNode()
      .querySelector('script[cryptokeys]');

    /** @private {?string} */
    this.shaKeyHash_ = null;
    if (
      parsedEncryptedKeys &&
      parsedEncryptedKeys.hasAttribute('sha-256-hash')
    ) {
      this.shaKeyHash_ = parsedEncryptedKeys.getAttribute('sha-256-hash');
    }

    /** @type {?JsonObject} */
    this.encryptedKeys_ =
      (parsedEncryptedKeys && tryParseJson(parsedEncryptedKeys.textContent)) ||
      null;
  }

  /**
   * Checks if the document is encrypted by looking at the parsed keys.
   * @return {boolean}
   */
  isDocumentEncrypted() {
    return !!this.encryptedKeys_ && Object.keys(this.encryptedKeys_).length > 0;
  }

  /**
   * This method is used for testing.
   * @return {?JsonObject}
   */
  getEncryptedKeys() {
    return this.encryptedKeys_;
  }

  /**
   * Returns encrypted document key if it exists.
   * This key is needed for requesting a different key
   * that decrypts locked content on the page.
   * @param {string} platformKey Who you want to decrypt the key.
   *                             For example: 'google.com'
   * @return {?string}
   */
  getEncryptedDocumentKey(platformKey) {
    // Doing this for testing.
    const encryptedKeys = this.getEncryptedKeys();
    if (!encryptedKeys) {
      return null;
    }
    return encryptedKeys[platformKey] || null;
  }

  /**
   * @param {string} decryptedDocumentKey
   * @return {!Promise}
   */
  tryToDecryptDocument(decryptedDocumentKey) {
    if (!this.shaKeyHash_) {
      return this.tryToDecryptDocumentImpl_(decryptedDocumentKey);
    }
    const docKeyUint8 = utf8Encode(decryptedDocumentKey);
    return crypto.subtle.digest('SHA-256', docKeyUint8).then((val) => {
      const hashArray = toArray(new Uint8Array(val));
      const hashHex = hashArray
        .map((b) => padStart(b.toString(16), 2, '0'))
        .join('');
      if (hashHex != this.shaKeyHash_) {
        return Promise.reject(new Error('Invalid Document Key'));
      }
      return this.tryToDecryptDocumentImpl_(decryptedDocumentKey);
    });
  }

  /**
   * @private
   * @param {string} decryptedDocumentKey
   * @return {!Promise}
   */
  tryToDecryptDocumentImpl_(decryptedDocumentKey) {
    if (this.decryptionPromise_) {
      return this.decryptionPromise_;
    }
    this.decryptionPromise_ = this.ampdoc_.whenReady().then(() => {
      const keybytes = base64Decode(decryptedDocumentKey);
      return safeAesGcmImportKey(keybytes.buffer).then((formattedkey) => {
        const encryptedSections = this.ampdoc_
          .getRootNode()
          .querySelectorAll('script[ciphertext]');
        const promises = [];
        iterateCursor(encryptedSections, (encryptedSection) => {
          const text = encryptedSection.textContent.replace(/\s+/g, '');
          const contentBuffer = base64Decode(text).buffer;
          const iv = contentBuffer.slice(0, 12);
          const bytesToDecrypt = contentBuffer.slice(12);
          promises.push(
            decryptAesGcmImpl(formattedkey, iv, bytesToDecrypt).then(
              (decryptedContent) => {
                encryptedSection./*OK*/ outerHTML = decryptedContent;
              }
            )
          );
        });
        return Promise.all(promises);
      });
    });
    return this.decryptionPromise_;
  }
}


text:
using UnityEngine;
using System.Collections;

public class AccelerationInput : MonoBehaviour
{
	private static AccelerationInput instance;

	private Vector3[] history;
	private int historySize = 50;   //1 second with 50 fps
	private int historyIndex = 0;

	public delegate void OnTriggerFunction();
	public OnTriggerFunction OnTrigger; //functions added to this thing will be called when the trigger hits!

	private float triggerDistance = 0.4f; //how much force is required to activate the trigger (0.0-1.0)
	private int triggerLargeSampleSize = 50; //in frames, so 50 frames is 1 second with 50 fps
	private int triggerSmallSampleSize = 3; //in frames, so 3 frames is 0.06 seconds with 50 fps

	void Start()
	{
		if(instance != null)
		{
			Debug.LogError("Two AccelerationInput classes in the scene! (Click me to see the " +
			               "first AccelerationInput script)", instance.gameObject);
			Debug.LogError("(Click me to see the second AccelerationInput script(", this.gameObject);
			Debug.Break();
		}

		instance = this;
		history = new Vector3[historySize];
	}

	void FixedUpdate()
	{
		history[historyIndex] = Input.acceleration;
		historyIndex = (historyIndex + 1) % historySize;

		if(OnTrigger != null)
		{
			if(Vector3.Distance(Sample(triggerSmallSampleSize), Sample(triggerLargeSampleSize)) > triggerDistance)
			{
				OnTrigger();
			}
		}
	}

	///<returns>Returns the acceleration force over X amount of frames.</returns>
	public static Vector3 Sample(int sampleFrameAmount)
	{
		if(instance == null)
		{
			Debug.LogError("You need to attach the AccelerationInput class to an object " +
			               "in the scene before you can get the acceleration.");
			Debug.Break();
			return Vector3.zero;
		}

		if(sampleFrameAmount > instance.historySize)
		{
			Debug.LogError("You can't sample bigger than the container! Increase the history size.");
			Debug.Break();
			return Vector3.zero;
		}

		Vector3 addedAccels = Vector3.zero;
		int thisIndex = instance.historyIndex;

		for(int i = 0; i < sampleFrameAmount; i++)
		{
			thisIndex = instance.historyIndex - i;

			if(thisIndex < 0)
			{
				thisIndex += instance.historySize;
			}

			addedAccels += instance.history[thisIndex];
		}

		addedAccels /= sampleFrameAmount;

		return addedAccels;
	}

	///<summary>Set the function to call when the acceleration force is greater than triggerForce.</summary>
	public static void SetTrigger(OnTriggerFunction FunctionToCall, float triggerForce)
	{
		instance.OnTrigger += FunctionToCall;
		instance.triggerDistance = triggerForce;
	}
}


text:
module KitsHelper
end


text:
module ExploreHelper
  def filter_projects_path(options = {})
    exist_opts = {
      sort: params[:sort] || @sort,
      scope: params[:scope],
      group: params[:group],
      tag: params[:tag],
      visibility_level: params[:visibility_level],
      name: params[:name],
      personal: params[:personal],
      archived: params[:archived],
      shared: params[:shared],
      namespace_id: params[:namespace_id]
    }

    options = exist_opts.merge(options).delete_if { |key, value| value.blank? }
    request_path_with_options(options)
  end

  def filter_audit_path(options = {})
    exist_opts = {
      entity_type: params[:entity_type],
      entity_id: params[:entity_id],
      created_before: params[:created_before],
      created_after: params[:created_after],
      sort: params[:sort]
    }
    options = exist_opts.merge(options).delete_if { |key, value| value.blank? }
    request_path_with_options(options)
  end

  def filter_groups_path(options = {})
    request_path_with_options(options)
  end

  def explore_controller?
    controller.class.name.split("::").first == "Explore"
  end

  def explore_nav_links
    @explore_nav_links ||= get_explore_nav_links
  end

  def explore_nav_link?(link)
    explore_nav_links.include?(link)
  end

  def any_explore_nav_link?(links)
    links.any? { |link| explore_nav_link?(link) }
  end

  def public_visibility_restricted?
    Gitlab::VisibilityLevel.public_visibility_restricted?
  end

  private

  def get_explore_nav_links
    [:projects, :groups, :snippets]
  end

  def request_path_with_options(options = {})
    request.path + "?#{options.to_param}"
  end
end


text:
import pickle
from os.path import expanduser, expandvars
from pathlib import Path

import numpy as np
import pandas as pd
import requests

from ..datageometry import DataGeometry
from .._shared.exceptions import HypertoolsIOError
from .analyze import analyze

BASE_URL = 'https://docs.google.com/uc?export=download'
DATA_DIR = Path.home().joinpath('hypertools_data')

EXAMPLE_DATA = {
    'weights': '1ZXLao5Rxkr45KUMkv08Y1eAedTkpivsd',
    'weights_avg': '1gfI1WB7QqogdYgdclqznhUfxsrhobueO',
    'weights_sample': '1ub-xlYW1D_ASzbLcALcPJuhHUxRwHdIs',
    'spiral': '1nHAusn2VsQinJk35xvJSd7CtWPC1uOwK',
    'mushrooms': '12hmCIZp1tyUoPRHwpiAsm1GDBxiJS8ji',
    'wiki': '1NUqm3svfu2rrFH04xmLbOh0u5WyTe9mh',
    'sotus': '1J0MBhpRwdT2WChfWJ4HXYq6jU4XpyJPm',
    'nips': '1FV7xT2hVgZ1sXfMvAdP1jRsK_dWhp49I',
    'wiki_model': '1T-UAU-6KVGUBcUWqz7yG59vXnThu9T0H',
    'nips_model': '1J0MBhpRwdT2WChfWJ4HXYq6jU4XpyJPm',
    'sotus_model': '16_n9r82pwxzZh-0qdS4a6l0z3v__Q91C'
}

def load(
        dataset,
        reduce=None,
        ndims=None,
        align=None,
        normalize=None,
        *,
        legacy=False
):
    """
    Load a .geo file or example data

    Parameters
    ----------
    dataset : string
        The name of the example dataset.  Can be a `.geo` file, or one of a
        number of example datasets listed below.

        `weights` is list of 2 numpy arrays, each containing average brain
        activity (fMRI) from 18 subjects listening to the same story, fit using
        Hierarchical Topographic Factor Analysis (HTFA) with 100 nodes. The rows
        are fMRI measurements and the columns are parameters of the model.

        `weights_sample` is a sample of 3 subjects from that dataset.

        `weights_avg` is the dataset split in half and averaged into two groups.

        `spiral` is numpy array containing data for a 3D spiral, used to
        highlight the `procrustes` function.

        `mushrooms` is a numpy array comprised of features (columns) of a
        collection of 8,124 mushroomm samples (rows).

        `sotus` is a collection of State of the Union speeches from 1989-2018.

        `wiki` is a collection of wikipedia pages used to fit wiki-model.

        `wiki-model` is a sklearn Pipeline (CountVectorizer->LatentDirichletAllocation)
        trained on a sample of wikipedia articles. It can be used to transform
        text to topic vectors.

    normalize : str or False or None
        If set to 'across', the columns of the input data will be z-scored
        across lists (default). That is, the z-scores will be computed with
        with respect to column n across all arrays passed in the list. If set
        to 'within', the columns will be z-scored within each list that is
        passed. If set to 'row', each row of the input data will be z-scored.
        If set to False, the input data will be returned with no z-scoring.

    reduce : str or dict
        Decomposition/manifold learning model to use.  Models supported: PCA,
        IncrementalPCA, SparsePCA, MiniBatchSparsePCA, KernelPCA, FastICA,
        FactorAnalysis, TruncatedSVD, DictionaryLearning, MiniBatchDictionaryLearning,
        TSNE, Isomap, SpectralEmbedding, LocallyLinearEmbedding, and MDS. Can be
        passed as a string, but for finer control of the model parameters, pass
        as a dictionary, e.g. reduce={'model' : 'PCA', 'params' : {'whiten' : True}}.
        See scikit-learn specific model docs for details on parameters supported
        for each model.

    ndims : int
        Number of dimensions to reduce

    align : str or dict
        If str, either 'hyper' or 'SRM'.  If 'hyper', alignment algorithm will be
        hyperalignment. If 'SRM', alignment algorithm will be shared response
        model.  You can also pass a dictionary for finer control, where the 'model'
        key is a string that specifies the model and the params key is a dictionary
        of parameter values (default : 'hyper').

    legacy : bool
        Pass legacy=True to load DataGeometry objects created with hypertools<0.8.0

    Returns
    ----------
    data : Numpy Array
        Example data

    """
    if dataset in EXAMPLE_DATA.keys():
        geo_data = _load_example_data(dataset)
        if dataset.endswith('_model'):
            # geo_data is a sklearn.pipeline.Pipeline, not a DataGeometry
            return geo_data
    else:
        dataset_path = Path(expanduser(expandvars(dataset))).resolve()
        if not dataset_path.is_file():
            raise HypertoolsIOError(
                f"Dataset not found at {dataset_path}. Please specify a .geo "
                "file or one of the following sample files: 'weights', "
                "'weights_avg', 'weights_sample', 'spiral', 'mushrooms', "
                "'wiki', 'nips', 'sotus', 'wiki_model', 'nips_model', "
                "'sotus_model'"
            )
        elif legacy:
            geo_data = _load_legacy(dataset_path)
        else:
            try:
                geo_data = pickle.loads(dataset_path.read_bytes())
            except pickle.UnpicklingError as e:
                raise HypertoolsIOError(
                    "Failed to load DataGeometry object from "
                    f"{dataset_path}. If {dataset_path.name} was created "
                    "with hypertools<0.8.0, pass legacy=True to load it."
                ) from e
            if isinstance(geo_data.data, dict):
                geo_data.data = pd.DataFrame(geo_data.data)

    if any({reduce, ndims, align, normalize}):
        from ..plot.plot import plot
        reduce = reduce or 'IncrementalPCA'
        d = analyze(geo_data.get_data(),
                    reduce=reduce,
                    ndims=ndims,
                    align=align,
                    normalize=normalize)
        return plot(d, show=False)
    return geo_data

def _load_legacy(dataset_path):
    try:
        import deepdish as dd
    except ImportError as e:
        # catches ModuleNotFoundError since it's a subclass
        raise HypertoolsIOError(
            "To load legacy-format datasets, install the 'deepdish' module"
        ) from e
    data_dict = dd.io.load(dataset_path)

    if isinstance(data_dict['data'], dict):
        data_dict['data'] = pd.DataFrame(data_dict['data'])
    elif isinstance(data_dict['data'], np.ndarray):
        data_dict['data'] = list(data_dict['data'])
    data_dict['xform_data'] = list(data_dict['xform_data'])
    return DataGeometry(**data_dict)

def _load_example_data(dataset):
    dataset_path = DATA_DIR.joinpath(dataset)
    if not dataset_path.is_file():
        if not DATA_DIR.is_dir():
            DATA_DIR.mkdir()
        _download_example_data(dataset_path)

    try:
        geo_data = pickle.loads(dataset_path.read_bytes())
    except Exception as e:
        raise HypertoolsIOError(
            f"Failed to load '{dataset}' data. Try deleting cached file at"
            f"{dataset_path} and reloading."
        ) from e

    if dataset == 'mushrooms':
        # format mushrooms dataset as a pandas DataFrame
        geo_data.data = pd.DataFrame(geo_data.data)
    return geo_data

def _download_example_data(dataset_path):
    file_id = EXAMPLE_DATA[dataset_path.name]
    session = requests.Session()
    params = {'id': file_id}
    try:
        response = session.get(BASE_URL, params=params, stream=True)
        for key, value in response.cookies.items():
            if key.startswith('download_warning'):
                # Google Drive requires confirmation for large files
                params['confirm'] = value
                response = session.get(BASE_URL, params=params, stream=True)
                break

        with dataset_path.open('wb') as f:
            # write stream in chunks to avoid loading whole file into memory
            for chunk in response.iter_content(chunk_size=32768):
                if chunk:
                    f.write(chunk)
    except Exception as e:
        # clean up partial file in case of error while writing stream
        dataset_path.unlink(missing_ok=True)
        raise HypertoolsIOError(
            f"Failed to download '{dataset_path.name}' dataset"
        ) from e


text:
package mongo

import (
	"net"
	"testing"
	"time"

	"gopkg.in/mgo.v2"
)

const (
	testKey   = "foo"
	testValue = "bar"
)

func TestMongo(t *testing.T) {
	address := "localhost:27017"

	if _, err := net.Dial("tcp", address); err != nil {
		t.Skip(err)
	}

	session, err := mgo.Dial(address)
	if err != nil {
		t.Skip(err)
	}

	c := New(session.DB("cache").C("cache"))

	if err := c.Save(testKey, testValue, 1*time.Nanosecond); err != nil {
		t.Errorf("save fail: expected nil, got %v", err)
	}

	if _, err := c.Fetch(testKey); err == nil {
		t.Errorf("fetch fail: expected an error, got %v", err)
	}

	_ = c.Save(testKey, testValue, 10*time.Second)

	if res, _ := c.Fetch(testKey); res != testValue {
		t.Errorf("fetch fail, wrong value: expected %s, got %s", testValue, res)
	}

	_ = c.Save(testKey, testValue, 0)

	if !c.Contains(testKey) {
		t.Errorf("contains failed: the key %s should be exist", testKey)
	}

	_ = c.Save("bar", testValue, 0)

	if values := c.FetchMulti([]string{testKey, "bar"}); len(values) == 0 {
		t.Errorf("fetch multi failed: expected %d, got %d", 2, len(values))
	}

	if err := c.Flush(); err != nil {
		t.Errorf("flush failed: expected nil, got %v", err)
	}

	if c.Contains(testKey) {
		t.Errorf("contains failed: the key %s should not be exist", testKey)
	}
}


text:
require_relative 'test_helper.rb'

class PostTest < ActiveSupport::TestCase

  def setup
    super
    @post = Vbulletin::Post.new
  end

  test "post belongs to a user" do
    user = Vbulletin::User.create
    @post.user = user
    assert_equal user, @post.user
  end

  test "post belongs to a thread" do
    thread = Vbulletin::Thread.create
    @post.thread = thread
    assert_equal thread, @post.thread
  end

end


text:
#include "config.h"
#include "RoundedRect.h"

#include <algorithm>

using namespace std;

namespace WebCore {

bool RoundedRect::Radii::isZero() const
{
    return m_topLeft.isZero() && m_topRight.isZero() && m_bottomLeft.isZero() && m_bottomRight.isZero();
}

void RoundedRect::Radii::scale(float factor)
{
    if (factor == 1)
        return;

    // If either radius on a corner becomes zero, reset both radii on that corner.
    m_topLeft.scale(factor);
    if (!m_topLeft.width() || !m_topLeft.height())
        m_topLeft = IntSize();
    m_topRight.scale(factor);
    if (!m_topRight.width() || !m_topRight.height())
        m_topRight = IntSize();
    m_bottomLeft.scale(factor);
    if (!m_bottomLeft.width() || !m_bottomLeft.height())
        m_bottomLeft = IntSize();
    m_bottomRight.scale(factor);
    if (!m_bottomRight.width() || !m_bottomRight.height())
        m_bottomRight = IntSize();

}

void RoundedRect::Radii::expand(int topWidth, int bottomWidth, int leftWidth, int rightWidth)
{
    if (m_topLeft.width() > 0 && m_topLeft.height() > 0) {
        m_topLeft.setWidth(max<int>(0, m_topLeft.width() + leftWidth));
        m_topLeft.setHeight(max<int>(0, m_topLeft.height() + topWidth));
    }
    if (m_topRight.width() > 0 && m_topRight.height() > 0) {
        m_topRight.setWidth(max<int>(0, m_topRight.width() + rightWidth));
        m_topRight.setHeight(max<int>(0, m_topRight.height() + topWidth));
    }
    if (m_bottomLeft.width() > 0 && m_bottomLeft.height() > 0) {
        m_bottomLeft.setWidth(max<int>(0, m_bottomLeft.width() + leftWidth));
        m_bottomLeft.setHeight(max<int>(0, m_bottomLeft.height() + bottomWidth));
    }
    if (m_bottomRight.width() > 0 && m_bottomRight.height() > 0) {
        m_bottomRight.setWidth(max<int>(0, m_bottomRight.width() + rightWidth));
        m_bottomRight.setHeight(max<int>(0, m_bottomRight.height() + bottomWidth));
    }
}

void RoundedRect::inflateWithRadii(int size)
{
    IntRect old = m_rect;

    m_rect.inflate(size);
    // Considering the inflation factor of shorter size to scale the radii seems appropriate here
    float factor;
    if (m_rect.width() < m_rect.height())
        factor = old.width() ? (float)m_rect.width() / old.width() : int(0);
    else
        factor = old.height() ? (float)m_rect.height() / old.height() : int(0);

    m_radii.scale(factor);
}

void RoundedRect::Radii::includeLogicalEdges(const RoundedRect::Radii& edges, bool isHorizontal, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
    if (includeLogicalLeftEdge) {
        if (isHorizontal)
            m_bottomLeft = edges.bottomLeft();
        else
            m_topRight = edges.topRight();
        m_topLeft = edges.topLeft();
    }

    if (includeLogicalRightEdge) {
        if (isHorizontal)
            m_topRight = edges.topRight();
        else
            m_bottomLeft = edges.bottomLeft();
        m_bottomRight = edges.bottomRight();
    }
}

void RoundedRect::Radii::excludeLogicalEdges(bool isHorizontal, bool excludeLogicalLeftEdge, bool excludeLogicalRightEdge)
{
    if (excludeLogicalLeftEdge) {
        if (isHorizontal)
            m_bottomLeft = IntSize();
        else
            m_topRight = IntSize();
        m_topLeft = IntSize();
    }

    if (excludeLogicalRightEdge) {
        if (isHorizontal)
            m_topRight = IntSize();
        else
            m_bottomLeft = IntSize();
        m_bottomRight = IntSize();
    }
}

RoundedRect::RoundedRect(int x, int y, int width, int height)
    : m_rect(x, y, width, height)
{
}

RoundedRect::RoundedRect(const IntRect& rect, const Radii& radii)
    : m_rect(rect)
    , m_radii(radii)
{
}

RoundedRect::RoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight)
    : m_rect(rect)
    , m_radii(topLeft, topRight, bottomLeft, bottomRight)
{
}

void RoundedRect::includeLogicalEdges(const Radii& edges, bool isHorizontal, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
    m_radii.includeLogicalEdges(edges, isHorizontal, includeLogicalLeftEdge, includeLogicalRightEdge);
}

void RoundedRect::excludeLogicalEdges(bool isHorizontal, bool excludeLogicalLeftEdge, bool excludeLogicalRightEdge)
{
    m_radii.excludeLogicalEdges(isHorizontal, excludeLogicalLeftEdge, excludeLogicalRightEdge);
}

bool RoundedRect::isRenderable() const
{
    return m_radii.topLeft().width() + m_radii.topRight().width() <= m_rect.width()
        && m_radii.bottomLeft().width() + m_radii.bottomRight().width() <= m_rect.width()
        && m_radii.topLeft().height() + m_radii.bottomLeft().height() <= m_rect.height()
        && m_radii.topRight().height() + m_radii.bottomRight().height() <= m_rect.height();
}

void RoundedRect::adjustRadii()
{
    int maxRadiusWidth = std::max(m_radii.topLeft().width() + m_radii.topRight().width(), m_radii.bottomLeft().width() + m_radii.bottomRight().width());
    int maxRadiusHeight = std::max(m_radii.topLeft().height() + m_radii.bottomLeft().height(), m_radii.topRight().height() + m_radii.bottomRight().height());

    if (maxRadiusWidth <= 0 || maxRadiusHeight <= 0) {
        m_radii.scale(0.0f);
        return;
    }
    float widthRatio = static_cast<float>(m_rect.width()) / maxRadiusWidth;
    float heightRatio = static_cast<float>(m_rect.height()) / maxRadiusHeight;
    m_radii.scale(widthRatio < heightRatio ? widthRatio : heightRatio);
}

bool RoundedRect::intersectsQuad(const FloatQuad& quad) const
{
    FloatRect rect(m_rect);
    if (!quad.intersectsRect(rect))
        return false;

    const IntSize& topLeft = m_radii.topLeft();
    if (!topLeft.isEmpty()) {
        FloatRect rect(m_rect.x(), m_rect.y(), topLeft.width(), topLeft.height());
        if (quad.intersectsRect(rect)) {
            FloatPoint center(m_rect.x() + topLeft.width(), m_rect.y() + topLeft.height());
            FloatSize size(topLeft.width(), topLeft.height());
            if (!quad.intersectsEllipse(center, size))
                return false;
        }
    }

    const IntSize& topRight = m_radii.topRight();
    if (!topRight.isEmpty()) {
        FloatRect rect(m_rect.maxX() - topRight.width(), m_rect.y(), topRight.width(), topRight.height());
        if (quad.intersectsRect(rect)) {
            FloatPoint center(m_rect.maxX() - topRight.width(), m_rect.y() + topRight.height());
            FloatSize size(topRight.width(), topRight.height());
            if (!quad.intersectsEllipse(center, size))
                return false;
        }
    }

    const IntSize& bottomLeft = m_radii.bottomLeft();
    if (!bottomLeft.isEmpty()) {
        FloatRect rect(m_rect.x(), m_rect.maxY() - bottomLeft.height(), bottomLeft.width(), bottomLeft.height());
        if (quad.intersectsRect(rect)) {
            FloatPoint center(m_rect.x() + bottomLeft.width(), m_rect.maxY() - bottomLeft.height());
            FloatSize size(bottomLeft.width(), bottomLeft.height());
            if (!quad.intersectsEllipse(center, size))
                return false;
        }
    }

    const IntSize& bottomRight = m_radii.bottomRight();
    if (!bottomRight.isEmpty()) {
        FloatRect rect(m_rect.maxX() - bottomRight.width(), m_rect.maxY() - bottomRight.height(), bottomRight.width(), bottomRight.height());
        if (quad.intersectsRect(rect)) {
            FloatPoint center(m_rect.maxX() - bottomRight.width(), m_rect.maxY() - bottomRight.height());
            FloatSize size(bottomRight.width(), bottomRight.height());
            if (!quad.intersectsEllipse(center, size))
                return false;
        }
    }

    return true;
}

} // namespace WebCore


text:
package com.microsoft.azure.management.cognitiveservices.v2017_04_18;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
 * Defines values for SkuName.
 */
public final class SkuName extends ExpandableStringEnum<SkuName> {
    /** Static value F0 for SkuName. */
    public static final SkuName F0 = fromString("F0");

    /** Static value P0 for SkuName. */
    public static final SkuName P0 = fromString("P0");

    /** Static value P1 for SkuName. */
    public static final SkuName P1 = fromString("P1");

    /** Static value P2 for SkuName. */
    public static final SkuName P2 = fromString("P2");

    /** Static value S0 for SkuName. */
    public static final SkuName S0 = fromString("S0");

    /** Static value S1 for SkuName. */
    public static final SkuName S1 = fromString("S1");

    /** Static value S2 for SkuName. */
    public static final SkuName S2 = fromString("S2");

    /** Static value S3 for SkuName. */
    public static final SkuName S3 = fromString("S3");

    /** Static value S4 for SkuName. */
    public static final SkuName S4 = fromString("S4");

    /** Static value S5 for SkuName. */
    public static final SkuName S5 = fromString("S5");

    /** Static value S6 for SkuName. */
    public static final SkuName S6 = fromString("S6");

    /**
     * Creates or finds a SkuName from its string representation.
     * @param name a name to look for
     * @return the corresponding SkuName
     */
    @JsonCreator
    public static SkuName fromString(String name) {
        return fromString(name, SkuName.class);
    }

    /**
     * @return known SkuName values
     */
    public static Collection<SkuName> values() {
        return values(SkuName.class);
    }
}


text:
> Render/precompile [Lo-Dash/Underscore templates](http://lodash.com/docs#template)

*Issues with the output should be reported on the Lo-Dash [issue tracker](https://github.com/lodash/lodash/issues).*

## Install

```
$ npm install --save-dev gulp-template
```

## Usage

### `src/greeting.html`

```erb
<h1>Hello <%= name %></h1>
```

### `gulpfile.js`

```js
var gulp = require('gulp');
var template = require('gulp-template');

gulp.task('default', function () {
	return gulp.src('src/greeting.html')
		.pipe(template({name: 'Sindre'}))
		.pipe(gulp.dest('dist'));
});
```

You can alternatively use [gulp-data](https://github.com/colynb/gulp-data) to inject the data:

```js
var gulp = require('gulp');
var template = require('gulp-template');
var data = require('gulp-data');

gulp.task('default', function () {
	return gulp.src('src/greeting.html')
		.pipe(data(function () {
			return {name: 'Sindre'};
		}))
		.pipe(template())
		.pipe(gulp.dest('dist'));
});
```

### `dist/greeting.html`

```html
<h1>Hello Sindre</h1>
```

## API

### template(data, [options])

Render a template using the provided `data`.

### template.precompile([options])

Precompile a template for rendering dynamically at a later time.

#### data

Type: `Object`

The data object used to populate the text.

#### options

Type: `Object`

[Lo-Dash `_.template` options](http://lodash.com/docs#template).

## Notes

If you use [grunt](http://gruntjs.com) instead of gulp, but want to perform a similar task, use [grunt-template](https://github.com/mathiasbynens/grunt-template).

## License

MIT © [Sindre Sorhus](http://sindresorhus.com)


text:
using System;
using System.Runtime.InteropServices;

namespace af0.Adblock
{
	/// <summary>
	/// Summary description for IObjectWithSite.
	/// </summary>
	[
		ComVisible(true),
		InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
		Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")
	]
	public interface IObjectWithSite
	{
		[PreserveSig]
		int SetSite([MarshalAs(UnmanagedType.IUnknown)]object site);
		[PreserveSig]
		int GetSite(ref Guid guid, out IntPtr ppvSite);
	}
}


text:
@protocol JSONRPCId <NSObject>

@property (nonatomic, readonly, copy) NSString* jrpcId;

@end


text:
//
// Copyright 2014 SandRock
//
// 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.
//

namespace SrkToolkit.Mvvm.Tools
{
    /// <summary>
    /// Represents the state of a task.
    /// </summary>
    public enum BusyTaskType
    {
        /// <summary>
        /// Normal state.
        /// </summary>
        Default,

        /// <summary>
        /// The operation was successful.
        /// </summary>
        Confirmation,

        /// <summary>
        /// The operation failed.
        /// </summary>
        Error,

        /// <summary>
        /// The operation encoutered an issue.
        /// </summary>
        Warning,
    }
}


text:
package com.google.android.finsky.layout.play;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.AdapterDataObservable;
import android.support.v7.widget.RecyclerView.ItemDecoration;
import android.support.v7.widget.RecyclerView.LayoutManager;
import android.support.v7.widget.RecyclerView.RecycledViewPool;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import com.android.vending.R.styleable;
import com.google.android.finsky.adapters.Recyclable;
import com.google.android.finsky.api.model.OnDataChangedListener;
import com.google.android.finsky.layout.ClusterContentBinder;
import com.google.android.finsky.layout.ClusterContentConfigurator;
import com.google.android.finsky.layout.InfiniteWrappingClusterContentBinder;
import com.google.android.play.image.BitmapLoader.BitmapContainer;
import com.google.android.play.image.BitmapLoader.BitmapLoadedHandler;
import com.google.android.play.utils.NetworkInfoUtil;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;

public class PlayClusterViewContentV2
  extends LeadingEdgeSnapRecyclerView
  implements OnDataChangedListener, BitmapLoader.BitmapLoadedHandler
{
  private float mChildWidthMultiplier;
  private ClusterContentBinder mClusterContentBinder;
  private ClusterContentConfigurator mClusterContentConfigurator;
  protected int mContentHorizontalPadding;
  protected int mContentPaddingBottom;
  protected int mContentPaddingTop;
  private int mFixedChildWidth;
  private boolean mHasPeekingChild;
  private boolean mHasPreloadedCovers;
  private int[] mImageTypeSequence;
  private LayoutInflater mInflater;
  private final boolean mIsEligibleToPreloadCovers;
  protected int mItemsPerPage;
  private int mLastScrollToPosition;
  private List<BitmapLoader.BitmapContainer> mPreloadingContainerList;
  private Handler mPreloadingHandler;
  private Runnable mPreloadingRunnable;
  private float mPrimaryAspectRatio;
  private ScrollToPositionListener mScrollWithOffsetListener;
  private boolean mSupportsHorizontallyCenteredContent;
  private boolean mUseTrailingChildren;

  public PlayClusterViewContentV2(Context paramContext)
  {
    this(paramContext, null);
  }

  public PlayClusterViewContentV2(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    this.mInflater = LayoutInflater.from(paramContext);
    TypedArray localTypedArray = paramContext.obtainStyledAttributes(paramAttributeSet, R.styleable.PlayClusterViewContent);
    this.mContentPaddingTop = localTypedArray.getDimensionPixelSize(0, 0);
    this.mContentPaddingBottom = localTypedArray.getDimensionPixelSize(1, 0);
    localTypedArray.recycle();
    setLayoutManager(new LinearLayoutManager(0));
    addItemDecoration(new ClusterRecyclerViewDecoration((byte)0));
    int i = NetworkInfoUtil.getNetworkType(paramContext);
    boolean bool;
    if ((i != 4) && (i != 3))
    {
      bool = false;
      if (i != 2) {}
    }
    else
    {
      bool = true;
    }
    this.mIsEligibleToPreloadCovers = bool;
    if (this.mIsEligibleToPreloadCovers) {
      this.mPreloadingHandler = new Handler(Looper.myLooper());
    }
  }

  private void cancelPreloading()
  {
    if (this.mPreloadingContainerList != null)
    {
      Iterator localIterator = this.mPreloadingContainerList.iterator();
      while (localIterator.hasNext()) {
        ((BitmapLoader.BitmapContainer)localIterator.next()).cancelRequest();
      }
      this.mPreloadingContainerList.clear();
    }
    if ((this.mPreloadingHandler != null) && (this.mPreloadingRunnable != null)) {
      this.mPreloadingHandler.removeCallbacks(this.mPreloadingRunnable);
    }
  }

  private int getFixedChildWidth(int paramInt1, int paramInt2)
  {
    int i;
    switch (this.mClusterContentConfigurator.getChildWidthPolicy())
    {
    default:
      throw new UnsupportedOperationException("Can only be called for fixed policy");
    case 1:
      i = this.mClusterContentConfigurator.getFixedChildWidth$255f288(paramInt2);
    case 2:
      int k;
      int m;
      int n;
      int i1;
      do
      {
        return i;
        i = this.mClusterContentConfigurator.getFixedChildWidth$255f288(paramInt2);
        int j = paramInt1 - this.mContentHorizontalPadding;
        k = j / i;
        m = this.mClusterContentBinder.getAvailableChildCount();
        n = j - k * i;
        i1 = (int)(i * this.mClusterContentConfigurator.getChildPeekingAmount());
      } while ((n > i1) || (m == k));
      return i - (i1 - n) / k;
    }
    float f1 = this.mItemsPerPage;
    if (this.mUseTrailingChildren) {}
    for (float f2 = this.mClusterContentConfigurator.getChildPeekingAmount();; f2 = 0.0F)
    {
      float f3 = f1 + f2;
      return (int)((paramInt1 - 2 * this.mContentHorizontalPadding) / f3);
    }
  }

  private int getScrollPositionInternal()
  {
    int i = getScrolledToItemPosition();
    if (i >= 0) {
      return i + 1;
    }
    return -1;
  }

  private void preloadImages(boolean paramBoolean)
  {
    if ((this.mClusterContentBinder == null) || (this.mPreloadingHandler == null) || (getPreloadRadius() <= 0)) {
      return;
    }
    cancelPreloading();
    this.mPreloadingRunnable = new Runnable()
    {
      public final void run()
      {
        int i = 1;
        if (PlayClusterViewContentV2.this.mClusterContentBinder == null) {}
        int j;
        do
        {
          return;
          j = PlayClusterViewContentV2.this.getPreloadRadius();
        } while (j <= 0);
        if (PlayClusterViewContentV2.this.mPreloadingContainerList == null) {
          PlayClusterViewContentV2.access$302(PlayClusterViewContentV2.this, new ArrayList());
        }
        int k = PlayClusterViewContentV2.this.mClusterContentBinder.getChildCoverWidth(PlayClusterViewContentV2.this.getChildAt(i));
        int m = PlayClusterViewContentV2.this.mClusterContentBinder.getChildCoverHeight(PlayClusterViewContentV2.this.getChildAt(i));
        int n = PlayClusterViewContentV2.this.mItemsPerPage;
        if (PlayClusterViewContentV2.this.mHasPeekingChild) {}
        for (;;)
        {
          int i1 = n + i;
          int i2 = PlayClusterViewContentV2.this.mLastScrollToPosition - j * i1;
          int i3 = i1 + PlayClusterViewContentV2.this.mLastScrollToPosition + j * i1;
          int i4 = PlayClusterViewContentV2.this.mClusterContentBinder.getAvailableChildCount();
          for (int i5 = i2;; i5++)
          {
            if (i5 == i3) {
              break label254;
            }
            if (i5 > 0)
            {
              int i6 = i5 - 1;
              if (i6 >= i4) {
                break;
              }
              BitmapLoader.BitmapContainer localBitmapContainer = PlayClusterViewContentV2.this.mClusterContentBinder.preloadChildCoverImage(i6, k, m, PlayClusterViewContentV2.this, PlayClusterViewContentV2.this.mImageTypeSequence);
              if ((localBitmapContainer != null) && (localBitmapContainer.mBitmap == null)) {
                PlayClusterViewContentV2.this.mPreloadingContainerList.add(localBitmapContainer);
              }
            }
          }
          label254:
          break;
          i = 0;
        }
      }
    };
    if (paramBoolean)
    {
      this.mPreloadingHandler.postDelayed(this.mPreloadingRunnable, 500L);
      return;
    }
    this.mPreloadingRunnable.run();
  }

  public final void createContent(ClusterContentBinder paramClusterContentBinder, ClusterContentConfigurator paramClusterContentConfigurator, int paramInt, boolean paramBoolean, RecyclerView.RecycledViewPool paramRecycledViewPool, Bundle paramBundle, int[] paramArrayOfInt)
  {
    super.bindView();
    this.mClusterContentBinder = paramClusterContentBinder;
    this.mChildWidthMultiplier = paramClusterContentConfigurator.getChildWidthMultiplier();
    this.mItemsPerPage = Math.round(paramInt / this.mChildWidthMultiplier);
    this.mSupportsHorizontallyCenteredContent = paramBoolean;
    this.mImageTypeSequence = paramArrayOfInt;
    this.mClusterContentConfigurator = paramClusterContentConfigurator;
    boolean bool1;
    boolean bool2;
    label90:
    RecyclerView.Adapter localAdapter;
    if (this.mClusterContentBinder.getAvailableChildCount() > this.mItemsPerPage)
    {
      bool1 = true;
      this.mUseTrailingChildren = bool1;
      if (paramClusterContentConfigurator.getChildPeekingAmount() <= 0.0D) {
        break label205;
      }
      bool2 = true;
      this.mHasPeekingChild = bool2;
      this.mPrimaryAspectRatio = this.mClusterContentConfigurator.getPrimaryChildAspectRatio(this.mClusterContentBinder);
      localAdapter = getAdapter();
      if (localAdapter != null) {
        break label211;
      }
      setAdapter(new ClusterRecyclerViewAdapter());
      setRecycledViewPool(paramRecycledViewPool);
    }
    for (;;)
    {
      if ((this.mClusterContentBinder instanceof InfiniteWrappingClusterContentBinder)) {
        scrollToPosition(1 + ((InfiniteWrappingClusterContentBinder)this.mClusterContentBinder).getDefaultFirstVisibleChildPosition());
      }
      if (paramBundle != null)
      {
        this.mHasPreloadedCovers = true;
        scrollToPosition(paramBundle.getInt("PlayClusterViewContentV2.recyclerViewScrollPosition", -1));
      }
      preloadImages(true);
      return;
      bool1 = false;
      break;
      label205:
      bool2 = false;
      break label90;
      label211:
      localAdapter.mObservable.notifyChanged();
      onDataChanged();
      scrollToPosition(0);
      this.mHasPreloadedCovers = false;
    }
  }

  public String getChildContentSourceId()
  {
    return this.mClusterContentBinder.getChildContentSourceId();
  }

  public ClusterContentConfigurator getClusterContentConfigurator()
  {
    return this.mClusterContentConfigurator;
  }

  protected int getLeadingItemGap()
  {
    return 0;
  }

  final int getLeadingPixelGap(int paramInt1, int paramInt2)
  {
    if (this.mClusterContentConfigurator.getChildWidthPolicy() == 3) {
      return 0;
    }
    return getLeadingItemGap() * getFixedChildWidth(paramInt1, paramInt2);
  }

  protected int getPreloadRadius()
  {
    if ((getChildCount() <= 2) || (this.mChildWidthMultiplier == 0.0F)) {
      return -1;
    }
    return 1;
  }

  public int getScrolledToItemPosition()
  {
    int i = -1;
    LinearLayoutManager localLinearLayoutManager = (LinearLayoutManager)getLayoutManager();
    int j = localLinearLayoutManager.findFirstVisibleItemPosition();
    int k = 0;
    int m = -1;
    if (j != i)
    {
      n = localLinearLayoutManager.findLastVisibleItemPosition();
      i1 = j;
      if (i1 <= n) {
        if (i1 > 0)
        {
          localView = localLinearLayoutManager.findViewByPosition(i1);
          i2 = getLeadingGapForSnapping() + localView.getWidth() / 2;
          i3 = i2 - localView.getLeft();
          i4 = localView.getRight() - i2;
          if ((i3 >= 0) && (i4 > 0)) {
            i = i1 - 1;
          }
        }
      }
    }
    while (this.mLastScrollToPosition <= 0)
    {
      for (;;)
      {
        int n;
        int i1;
        View localView;
        int i2;
        int i3;
        int i4;
        return i;
        int i5 = Math.min(Math.abs(i3), Math.abs(i4));
        if ((m < 0) || (i5 < k))
        {
          m = i1;
          k = i5;
        }
        i1++;
      }
      if (m > 0) {
        return m - 1;
      }
    }
    return -1 + this.mLastScrollToPosition;
  }

  protected int getTrailingSpacerCount()
  {
    return -1 + ((ClusterRecyclerViewAdapter)getAdapter()).getSpacersAndLoadingIndicatorCount();
  }

  public final PlayHighlightsBannerItemView getViewForItemPosition(int paramInt)
  {
    return (PlayHighlightsBannerItemView)getLayoutManager().findViewByPosition(paramInt + 1);
  }

  public final void onDataChanged()
  {
    ClusterRecyclerViewAdapter localClusterRecyclerViewAdapter = (ClusterRecyclerViewAdapter)getAdapter();
    if (this.mClusterContentBinder.isMoreDataAvailable()) {
      ClusterRecyclerViewAdapter.access$700(localClusterRecyclerViewAdapter, 1);
    }
    for (;;)
    {
      preloadImages(false);
      return;
      ClusterRecyclerViewAdapter.access$700(localClusterRecyclerViewAdapter, 0);
    }
  }

  public void onInitializeAccessibilityEvent(AccessibilityEvent paramAccessibilityEvent)
  {
    super.onInitializeAccessibilityEvent(paramAccessibilityEvent);
    if ((this.mClusterContentBinder instanceof InfiniteWrappingClusterContentBinder))
    {
      LinearLayoutManager localLinearLayoutManager = (LinearLayoutManager)getLayoutManager();
      ((InfiniteWrappingClusterContentBinder)this.mClusterContentBinder).onInitializeAccessibilityEvent(paramAccessibilityEvent, -1 + localLinearLayoutManager.findFirstVisibleItemPosition(), -1 + localLinearLayoutManager.findLastVisibleItemPosition());
    }
  }

  protected final void onLeadingGapForSnappingChanged()
  {
    super.onLeadingGapForSnappingChanged();
    scrollToPosition(getScrollPositionInternal());
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    int i = View.MeasureSpec.getSize(paramInt1);
    int j = View.MeasureSpec.getSize(paramInt2);
    if (this.mClusterContentConfigurator == null)
    {
      setMeasuredDimension(i, paramInt2);
      return;
    }
    int k;
    if (this.mClusterContentConfigurator.getChildWidthPolicy() != 3)
    {
      k = getFixedChildWidth(i, j);
      this.mFixedChildWidth = k;
      if (View.MeasureSpec.getMode(paramInt2) != 1073741824) {
        break label99;
      }
    }
    label99:
    for (int m = View.MeasureSpec.getSize(paramInt2);; m = this.mClusterContentConfigurator.getClusterHeight(this.mFixedChildWidth, this.mPrimaryAspectRatio))
    {
      setLeadingGapForSnapping(getLeadingPixelGap(i, m) + this.mContentHorizontalPadding);
      setMeasuredDimension(i, m);
      return;
      k = 0;
      break;
    }
  }

  public final void onRecycle()
  {
    super.onRecycle();
    this.mClusterContentBinder = null;
    cancelPreloading();
    RecyclerView.Adapter localAdapter = getAdapter();
    if ((localAdapter instanceof ClusterRecyclerViewAdapter))
    {
      ClusterRecyclerViewAdapter localClusterRecyclerViewAdapter = (ClusterRecyclerViewAdapter)localAdapter;
      RecyclerView.ViewHolder[] arrayOfViewHolder = (RecyclerView.ViewHolder[])localClusterRecyclerViewAdapter.mActiveViewHolders.toArray(new RecyclerView.ViewHolder[localClusterRecyclerViewAdapter.mActiveViewHolders.size()]);
      for (int i = 0; i < arrayOfViewHolder.length; i++) {
        localClusterRecyclerViewAdapter.onViewRecycled(arrayOfViewHolder[i]);
      }
    }
  }

  public final void onResponse(BitmapLoader.BitmapContainer paramBitmapContainer)
  {
    this.mPreloadingContainerList.remove(paramBitmapContainer);
  }

  public final void onSaveInstanceState(Bundle paramBundle)
  {
    paramBundle.putInt("PlayClusterViewContentV2.recyclerViewScrollPosition", getScrollPositionInternal());
  }

  protected final void onScrollEnded()
  {
    super.onScrollEnded();
    this.mLastScrollToPosition = getScrollPositionInternal();
    preloadImages(false);
  }

  public final void scrollToPosition(int paramInt)
  {
    if (paramInt < 0) {
      return;
    }
    this.mLastScrollToPosition = paramInt;
    LinearLayoutManager localLinearLayoutManager = (LinearLayoutManager)getLayoutManager();
    int i = getLeadingGapForSnapping();
    localLinearLayoutManager.scrollToPositionWithOffset(paramInt, i);
    if (this.mScrollWithOffsetListener != null)
    {
      int j = Math.max(paramInt - 1, 0);
      this.mScrollWithOffsetListener.onScrollToPositionWithOffset(j, i);
    }
    preloadImages(false);
  }

  public final boolean setContentHorizontalPadding(int paramInt)
  {
    if (this.mContentHorizontalPadding == paramInt) {
      return false;
    }
    this.mContentHorizontalPadding = paramInt;
    requestLayout();
    return true;
  }

  public void setOnScrollToPositionListener(ScrollToPositionListener paramScrollToPositionListener)
  {
    this.mScrollWithOffsetListener = paramScrollToPositionListener;
  }

  protected final boolean supportsSnapping()
  {
    return (this.mClusterContentConfigurator != null) && (this.mClusterContentConfigurator.getChildWidthPolicy() != 3);
  }

  private final class ClusterRecyclerViewAdapter
    extends RecyclerView.Adapter
  {
    HashSet<RecyclerView.ViewHolder> mActiveViewHolders;
    private int mFooterMode;

    public ClusterRecyclerViewAdapter()
    {
      if (PlayClusterViewContentV2.this.mClusterContentBinder.isMoreDataAvailable()) {}
      for (int i = 1;; i = 0)
      {
        this.mFooterMode = i;
        this.mActiveViewHolders = new HashSet();
        return;
      }
    }

    private int getSpacerExtraWidth(int paramInt)
    {
      if (!PlayClusterViewContentV2.this.mSupportsHorizontallyCenteredContent) {
        return 0;
      }
      return Math.max(0, (paramInt - 2 * PlayClusterViewContentV2.this.mContentHorizontalPadding - PlayClusterViewContentV2.this.mFixedChildWidth * (-2 + PlayClusterViewContentV2.this.getAdapter().getItemCount())) / 2);
    }

    private int getSpacersCount()
    {
      if (shouldUseTrailingSpacer()) {}
      for (int i = 1;; i = 0) {
        return i + 1;
      }
    }

    private boolean shouldUseTrailingSpacer()
    {
      return (PlayClusterViewContentV2.this.mContentHorizontalPadding > 0) || (PlayClusterViewContentV2.this.mSupportsHorizontallyCenteredContent);
    }

    public final int getItemCount()
    {
      return getSpacersAndLoadingIndicatorCount() + PlayClusterViewContentV2.this.mClusterContentBinder.getAvailableChildCount();
    }

    public final int getItemViewType(int paramInt)
    {
      int i = 1;
      if (paramInt <= 0) {
        i = 0;
      }
      int j;
      do
      {
        return i;
        j = getItemCount();
        if (this.mFooterMode != i) {
          break;
        }
        if (paramInt == j - 1) {
          return 2;
        }
      } while ((shouldUseTrailingSpacer()) && (paramInt == j - getSpacersCount()));
      while ((!shouldUseTrailingSpacer()) || (paramInt != j - 1)) {
        return PlayClusterViewContentV2.this.mClusterContentBinder.getChildLayoutId$134621();
      }
      return i;
    }

    final int getSpacersAndLoadingIndicatorCount()
    {
      int i = 1;
      int j = getSpacersCount();
      if (this.mFooterMode == i) {}
      for (;;)
      {
        return i + j;
        i = 0;
      }
    }

    public final void onBindViewHolder(RecyclerView.ViewHolder paramViewHolder, int paramInt)
    {
      this.mActiveViewHolders.add(paramViewHolder);
      int i = paramViewHolder.mItemViewType;
      int j = PlayClusterViewContentV2.this.getMeasuredWidth();
      int k = PlayClusterViewContentV2.this.getMeasuredHeight();
      ViewGroup.LayoutParams localLayoutParams = paramViewHolder.itemView.getLayoutParams();
      if (i == 0) {
        localLayoutParams.width = (PlayClusterViewContentV2.this.getLeadingPixelGap(j, k) + PlayClusterViewContentV2.this.mContentHorizontalPadding + getSpacerExtraWidth(j));
      }
      int m;
      do
      {
        do
        {
          return;
          if (i == 1)
          {
            localLayoutParams.width = (PlayClusterViewContentV2.this.mContentHorizontalPadding + getSpacerExtraWidth(j));
            return;
          }
        } while (i == 2);
        m = paramInt - 1;
        PlayClusterViewContentV2.this.mClusterContentBinder.bindChild(paramViewHolder.itemView, m);
        if (PlayClusterViewContentV2.this.mClusterContentConfigurator.getChildWidthPolicy() != 3) {
          localLayoutParams.width = PlayClusterViewContentV2.this.getFixedChildWidth(j, k);
        }
      } while (localLayoutParams.height == -1);
      localLayoutParams.height = PlayClusterViewContentV2.this.mClusterContentConfigurator.getChildHeight(PlayClusterViewContentV2.this.mClusterContentBinder.getChildCoverAspectRatio(m), PlayClusterViewContentV2.this.mPrimaryAspectRatio, localLayoutParams.width);
    }

    public final RecyclerView.ViewHolder onCreateViewHolder(ViewGroup paramViewGroup, int paramInt)
    {
      if ((paramInt == 0) || (paramInt == 1))
      {
        View localView1 = new View(PlayClusterViewContentV2.this.getContext());
        localView1.setLayoutParams(new ViewGroup.LayoutParams(-2, -1));
        localView1.setTag("tagIsSpacer");
        PlayRecyclerView.ViewHolder localViewHolder = new PlayRecyclerView.ViewHolder(localView1);
        if (paramInt == 0) {
          localViewHolder.setIsRecyclable(false);
        }
        return localViewHolder;
      }
      if (paramInt == 2)
      {
        View localView2 = PlayClusterViewContentV2.this.mInflater.inflate(2130968663, paramViewGroup, false);
        localView2.setTag("tagIsSpacer");
        return new PlayRecyclerView.ViewHolder(localView2);
      }
      return new PlayRecyclerView.ViewHolder(PlayClusterViewContentV2.this.mInflater.inflate(paramInt, paramViewGroup, false));
    }

    public final boolean onFailedToRecycleView$cb3a904()
    {
      return true;
    }

    public final void onViewRecycled(RecyclerView.ViewHolder paramViewHolder)
    {
      this.mActiveViewHolders.remove(paramViewHolder);
      View localView = paramViewHolder.itemView;
      if ((localView instanceof Recyclable)) {
        ((Recyclable)localView).onRecycle();
      }
    }
  }

  private final class ClusterRecyclerViewDecoration
    extends RecyclerView.ItemDecoration
  {
    private ClusterRecyclerViewDecoration() {}

    public final void getItemOffsets$5c1923bd$3450f9fc(Rect paramRect, View paramView)
    {
      Object localObject = paramView.getTag();
      if ((localObject != null) && ("tagIsSpacer".equals(localObject))) {
        return;
      }
      float f = PlayClusterViewContentV2.this.mClusterContentBinder.getChildCoverAspectRatio(paramView);
      int i = PlayClusterViewContentV2.this.mClusterContentConfigurator.getChildVerticalOffset(f, PlayClusterViewContentV2.this.mPrimaryAspectRatio, PlayClusterViewContentV2.this.mFixedChildWidth);
      paramRect.set(0, i, 0, i);
    }
  }

  public static abstract interface ScrollToPositionListener
  {
    public abstract void onScrollToPositionWithOffset(int paramInt1, int paramInt2);
  }
}

/* Location:           F:\apktool\apktool\Google_Play_Store6.0.5\classes-dex2jar.jar

 * Qualified Name:     com.google.android.finsky.layout.play.PlayClusterViewContentV2

 * JD-Core Version:    0.7.0.1

 */


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for VmConfigFault complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="VmConfigFault">
 *   <complexContent>
 *     <extension base="{urn:vim25}VimFault">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VmConfigFault")
@XmlSeeAlso({
    CpuHotPlugNotSupported.class,
    VAppNotRunning.class,
    FaultToleranceCannotEditMem.class,
    MemoryHotPlugNotSupported.class,
    RuleViolation.class,
    EightHostLimitViolated.class,
    NumVirtualCpusIncompatible.class,
    VmConfigIncompatibleForRecordReplay.class,
    NoCompatibleHardAffinityHost.class,
    VFlashModuleNotSupported.class,
    NoCompatibleSoftAffinityHost.class,
    VmHostAffinityRuleViolation.class,
    CannotUseNetwork.class,
    OvfConsumerValidationFault.class,
    UnsupportedVmxLocation.class,
    CannotDisableSnapshot.class,
    SoftRuleVioCorrectionDisallowed.class,
    GenericVmConfigFault.class,
    LargeRDMNotSupportedOnDatastore.class,
    InvalidFormat.class,
    UnsupportedDatastore.class,
    RDMNotSupportedOnDatastore.class,
    VmConfigIncompatibleForFaultTolerance.class,
    DeltaDiskFormatNotSupported.class,
    CannotAccessVmComponent.class,
    VAppPropertyFault.class,
    VirtualHardwareCompatibilityIssue.class,
    InvalidVmConfig.class,
    SoftRuleVioCorrectionImpact.class
})
public class VmConfigFault
    extends VimFault
{

}


text:
extern crate pnet;

#[packet]
pub struct PacketWithPayload {
    banana: u8,
    #[length_fn = "length_fn"]
    var_length: Vec<u8>,
    #[payload]
    payload: Vec<u8>
}

fn length_fn(_: &PacketWithPayloadPacket) -> usize {
    unimplemented!()
}

fn main() {}


text:
package scr;

import java.io.Console;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Properties;
import java.util.TreeSet;

import company.Company;
import daily_financial_parameters.BasicDailyFinData;
import neural_network.CrossValidationMatrix;
import neural_network.Predict;
import neural_network.RepresentationNetwork;
import neural_network.Training_X_Y_matrix;
import news.AllCompaniesSentimentOfNews;
import other_structures.DateModif;
import other_structures.Sym_Date;
import other_structures.Sym_Year;
import preprocessing.NormalizeParameterInAllEntries;
import preprocessing.ToBeFilteredFromOutliers;
import reading_data_from_file.ReadAndWriteAllSym;
import reading_data_from_file.ReadUniqueSymFromFile;
import yearly_financial_parameters.BasicYearlyFinData;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;

public class Main
{
	final static Charset ENCODING = StandardCharsets.UTF_8;
	static StanfordCoreNLP pipeline;
	static int parameters = 16;
	static int _trainingSize = 0;
	static int _crossValidatSize = 0;
	static int _testingSize = 0;
	static int _K = 2;
	//static List<String> _symbols;
	static Set<Sym_Date> _symDates = new HashSet<Sym_Date>();
	static List<String> _symbolsInSymDates = new ArrayList<String>();;
	static Set<Sym_Date> _symDatesForTrainingML = new HashSet<Sym_Date>();;

	static Set<Sym_Date> _symDatesForCrossValidationML = new HashSet<Sym_Date>();
	static List<Sym_Date> _symDatesForTestingML;
	//static List<DateModif> _dates;
	//static List<String> _symbolsForTrainingML;
	//static List<DateModif> _datesForTrainingML;

	// non sorted , needed for normalization and to create X matrix
	static Map<Sym_Year, BasicYearlyFinData> Column_shares = new TreeMap<Sym_Year, BasicYearlyFinData>();
	static Map<Sym_Year, BasicYearlyFinData> Column_book_val = new TreeMap<Sym_Year, BasicYearlyFinData>();
	static Map<Sym_Year, BasicYearlyFinData> Column_ROE = new TreeMap<Sym_Year, BasicYearlyFinData>();
	static Map<Sym_Year, BasicYearlyFinData> Column_accrual = new TreeMap<Sym_Year, BasicYearlyFinData>();
	static Map<Sym_Year, BasicYearlyFinData> tempMapY = new TreeMap<Sym_Year, BasicYearlyFinData>();

	static Map<Sym_Date, BasicDailyFinData> Column_dividends = new TreeMap<Sym_Date, BasicDailyFinData>();
	static Map<Sym_Date, BasicDailyFinData> Column_qoutes = new TreeMap<Sym_Date, BasicDailyFinData>();
	static Map<Sym_Date, BasicDailyFinData> Column_SUEs = new TreeMap<Sym_Date, BasicDailyFinData>();
	static Map<Sym_Date, BasicDailyFinData> tempMap = new TreeMap<Sym_Date, BasicDailyFinData>();

	static Map<String, Company> companiesMap = new TreeMap<String, Company>();
	static Map<String, Company> trainingCompaniesMap = new TreeMap<String, Company>();
	static Map<String, Company> crossValidationCompaniesMap = new TreeMap<String, Company>();
	static Map<String, Company> testingCompaniesMap = new TreeMap<String, Company>();

	static NormalizeParameterInAllEntries<Sym_Date, BasicDailyFinData> normalizedColumnQuotes;

	static RepresentationNetwork neuralNet;

	public Main() {	}

	public Map<String, Company> returnCompaniesMap()
	{
		return companiesMap;
	}

	static void initiateStanfordNLP()
	{
		Properties props = new Properties();
		props.put("annotators",
				"tokenize, ssplit, pos, lemma, parse, sentiment, ner, dcoref");
		props.put("dcoref.score", true);
		pipeline = new StanfordCoreNLP(props);
	}

	public StanfordCoreNLP getPipe()
	{
		initiateStanfordNLP();
		return pipeline;
	}

	public static void main(String... aArgs) throws IOException, ParseException
	{
		String uniqueSymPath = "D:\\my documents\\Senior_Project_datasets\\unique_company_symbols.txt";
		ReadAndWriteAllSym storeConsistentSymbols = new ReadAndWriteAllSym(
				uniqueSymPath);		//the constructor also creates file with consistent symbols

		System.out.println("Start");
		/*
		 * Main.initiate_Stanford_NLP(); //DO NOT FORGET THIS, required when
		 * generating sentiment files!!!!!!!!!
		 */

		List<String> Symbols = new ReadUniqueSymFromFile(uniqueSymPath).getLinesFromFile();

		//initiateStanfordNLP();	//TODO don't forget this to uncomment

		setColumnMapsOfParameters(Symbols);

		filterOutliers();

		normalizeParameters();		//TODO check for division with zero or any operation producing NaN

		regenerateCompanies();

		filterCompaniesAndSetOtherParameters();

		prepareForMachineLearning();

		divideCompaniesMapTrainCrossValTest();

		// Prepare neural network representation
		System.out.println("Neural network starts");
		System.out.println("trainingCompaniesMap size:" + trainingCompaniesMap.size());

		Double [][] XsCrossValidat = createCrossValidationMatrix();
		List <Sym_Date> symDatesCrossValidatList = new ArrayList<Sym_Date>(_symDatesForCrossValidationML);

		Double [][] YCrossValidat = new Double [XsCrossValidat.length][_K];
		for(int i = 0; i < XsCrossValidat.length; i++)
		{
			Sym_Date symDate = symDatesCrossValidatList.get(i);
			System.out.println("symDate:" + symDate.get_Date_modif().toString());
			if(Column_qoutes.get(symDate) == null)
				System.out.println("Cannot find data in Column_qoutes with sym indexed " + i);
			Sym_Date sD = new Sym_Date(symDate.get_sym(), symDate.get_Date_modif().get_prev_day_as_datemodif());
			if(!Column_qoutes.containsKey(sD) || !Column_qoutes.containsKey(symDate))
			{
				YCrossValidat[i][0] = YCrossValidat[i][1] = 0.0;
			}
			else
			{
				if( (Column_qoutes.get(symDate).getVal() - Column_qoutes.get(sD).getVal()) < 0)
				{
					YCrossValidat[i][0] = 1.0;
					YCrossValidat[i][1] = 0.0;
				}
				else
				{
					YCrossValidat[i][0] = 0.0;
					YCrossValidat[i][1] = 1.0;
				}
				//		 			.compareTo(	Column_qoutes.get());
				/*System.out.println("index:" + i +
						", predicterVal:" + predictedVal[i][0].toString() + " " + predictedVal[i][1].toString() +
						",original value:" + YCrossValidat[i][0].toString() + " " + YCrossValidat[i][1].toString());*/
			}
		}

		neuralNet = new RepresentationNetwork( _symDatesForTrainingML, trainingCompaniesMap, _trainingSize, parameters,
												XsCrossValidat, YCrossValidat);

		// Initiate neural network
		neuralNet.Learn();

		System.out.println("Neural network learning done");

		Double[][] predictedVal = neuralNet.makePrediction();
		for(int i = 0; i < predictedVal.length; i++)
		{
			System.out.println("Predicted value:" + predictedVal[i][0] + " " + predictedVal[i][1] +
					", and original value:" + YCrossValidat[i][0] + " " + YCrossValidat[i][1]);
		}

	}

	static Double[][] createCrossValidationMatrix() throws FileNotFoundException, UnsupportedEncodingException
	{

		Double [][] XsCrossValidatFinancial = new Double[_crossValidatSize][parameters - 6];	//used to store financial parameters (without senti parameters)
		Double []YCrossValidat = new Double[_crossValidatSize];
		_symDatesForCrossValidationML = CrossValidationMatrix.CreateX_Y_CrossValidationFinnanceMatrix(
				new HashSet<Sym_Date>(_symDatesForCrossValidationML), crossValidationCompaniesMap,
				XsCrossValidatFinancial, YCrossValidat, _crossValidatSize);
		_crossValidatSize = _symDatesForCrossValidationML.size();

		Double[][]XCorrected = new Double[_crossValidatSize][parameters - 6];
		for(int j = 0; j < _crossValidatSize; j++)
			for(int i = 0; i < parameters - 6; i++)
				XCorrected[j][i] = XsCrossValidatFinancial[j][i];
		XsCrossValidatFinancial = XCorrected;

		Double[][] X_senti = new Double[_crossValidatSize][6];
		X_senti = AllCompaniesSentimentOfNews.makeX_FromSentimentCrossValidat(CrossValidationMatrix.getSymDates());
		System.out.println("RepresentationNetwork.X_senti size:" + X_senti.length + " x " + X_senti[0].length);

		Double [][]XsCrossValidatOverall = new Double[_crossValidatSize][parameters];
		XsCrossValidatOverall = RepresentationNetwork.appendToTheRight(XsCrossValidatFinancial , X_senti);

		return XsCrossValidatOverall;
	}

	public int get_num_of_parameters() {
		return parameters;
	}

	public RepresentationNetwork get_neural_net() {
		return neuralNet;
	}

	public static void printCompanyMatchMap() throws FileNotFoundException, UnsupportedEncodingException
	{
		@SuppressWarnings("resource")
		PrintWriter writer = new PrintWriter("companiesMap.txt", "UTF-8");
		for(Company company : companiesMap.values())
		{
			writer.println("company dividend:");
			for(BasicDailyFinData daily : company.get_Company_Dividend().get_All_company_dividends())
				writer.println(daily.getVal());
			writer.println("company sue:");
			for(BasicDailyFinData daily : company.get_Company_SUE().get_All_company_SUE())
				writer.println(daily.getVal());
			writer.println("company Quotes:");
			for(BasicDailyFinData daily : company.get_Company_SUE().get_All_company_SUE())
				writer.println(daily.getVal());
			writer.println("company BM_Ratios:");
			for(Double val : company.get_Fin_fundamentals().getAllBM_Ratios().values())
				writer.println(val);
			writer.println("company Accrual:");
			for(BasicYearlyFinData val : company.get_Fin_fundamentals().getAllCompanyAccrual().values())
				writer.println(val.getVal());
			writer.println("company Bookval:");
			for(BasicYearlyFinData val : company.get_Fin_fundamentals().getAllCompanyBookVal().values())
				writer.println(val.getVal());
			writer.println("company MarketVals:");
			for(Double val : company.get_Fin_fundamentals().getAllCompanyMarketVals().values())
				writer.println(val);
			writer.println("company ROE:");
			for(BasicYearlyFinData val : company.get_Fin_fundamentals().getAllCompanyROE().values())
				writer.println(val.getVal());
			writer.println("company Shares:");
			for(BasicYearlyFinData val : company.get_Fin_fundamentals().getAllCompanyShares().values())
				writer.println(val.getVal());
			writer.println("company size:");
			for(Double val : company.get_Fin_fundamentals().getAllCompanyYearSizes().values())
				writer.println(val);
		}

	}

	/**
	 * First read all financial parameter for each company.
	 * Then find consistent years and filter inconsistent data in Company maps
	 */
	static void setColumnMapsOfParameters(List<String>Symbols)
	{
		for (int f = 0; f < Symbols.size() && f < 150; f++)
		{
			String Sym = Symbols.get(f);

			Company company = null;
			try {
				company = new Company(Sym, pipeline);
			} catch (IOException e) {
				System.out.println("Error in Main new Company():" + e);
				e.printStackTrace();
			} catch (ParseException e) {
				System.out.println("Error in Main new Company():" + e);
			}
			try {
				company.readFinancialParameters();
			} catch (IOException e) {
				System.out.println("Error in Main.company.readFinancialParameters():" + e);
			} catch (ParseException e) {
				System.out.println("Error in Main.company.readFinancialParameters():" + e);
			}
			company.findConsistentYearsFromFinancialData();
			company.filterInconsistentFinDataInMapsOfParameters();

			//IMPORTANT !!! after filtering outliers, when companies are regenerated call:
			/*
			 * company.readOrEvalSentiOfNews();
			 * company.makeConsistentNewsWithFinancialData();
			 * company.setFinancialParameters();
			 */

			System.out.println("Company:" + Sym);

			/*
			 * Add the parameters to 'global' maps that is one map for all companies
			 */
			for (BasicDailyFinData D : company.get_Company_Dividend().get_All_company_dividends())
				Column_dividends.put(new Sym_Date(Sym, D.getDate()), D);
			for (BasicDailyFinData D : company.get_Company_Qoutes().get_All_company_quotes())
				Column_qoutes.put(new Sym_Date(Sym, D.getDate()), D);
			for (BasicDailyFinData D : company.get_Company_SUE().get_All_company_SUE())
				Column_SUEs.put(new Sym_Date(Sym, D.getDate()), D);

			Column_book_val.putAll(company.get_Fin_fundamentals().getAllCompanyBookVal());
			Column_shares.putAll(company.get_Fin_fundamentals().getAllCompanyShares());
			Column_ROE.putAll(company.get_Fin_fundamentals().getAllCompanyROE());
			Column_accrual.putAll(company.get_Fin_fundamentals().getAllCompanyAccrual());
		}
	}

	/** Filtering outliers using global maps to (first sorting them).
	 * When deleting outlier in one param. we also delete the entries with same key in the other params.
	 */
	static void filterOutliers()
	{
		HashSet<Sym_Date> outliersDates = new HashSet<Sym_Date>();
		HashSet<Sym_Year> outliersYears = new HashSet<Sym_Year>();

		outliersDates = (new  ToBeFilteredFromOutliers<Sym_Date, BasicDailyFinData>(Column_dividends)).filterFromOutliers();
		outliersDates.addAll((new  ToBeFilteredFromOutliers<Sym_Date, BasicDailyFinData>(Column_qoutes)).filterFromOutliers());
		outliersDates.addAll((new  ToBeFilteredFromOutliers<Sym_Date, BasicDailyFinData>(Column_SUEs)).filterFromOutliers());
		outliersYears.addAll((new  ToBeFilteredFromOutliers<Sym_Year, BasicYearlyFinData>(Column_shares)).filterFromOutliers());
		outliersYears.addAll((new  ToBeFilteredFromOutliers<Sym_Year, BasicYearlyFinData>(Column_book_val)).filterFromOutliers());
		outliersYears.addAll((new  ToBeFilteredFromOutliers<Sym_Year, BasicYearlyFinData>(Column_accrual)).filterFromOutliers());
		outliersYears.addAll((new  ToBeFilteredFromOutliers<Sym_Year, BasicYearlyFinData>(Column_ROE)).filterFromOutliers());

		tempMap = new TreeMap<Sym_Date, BasicDailyFinData>();
		System.out.println("Before filter_treeset() Dividend size: " + Column_dividends.size());
		for(Sym_Date sD : Column_dividends.keySet())
			if(!outliersDates.contains(sD) && !outliersYears.contains(sD.get_Date_modif().get_year_in_date()))
				tempMap.put(sD, Column_dividends.get(sD));
		Column_dividends = tempMap;
		System.out.println("After filter_treeset() Dividend size: " + Column_dividends.size());

		System.out.println("Before filter_treeset() quotes size: " + Column_qoutes.size());
		tempMap = new TreeMap<Sym_Date, BasicDailyFinData>();
		for(Sym_Date sD : Column_qoutes.keySet())
			if(!outliersDates.contains(sD) && !outliersYears.contains(sD.get_Date_modif().get_year_in_date()))
				tempMap.put(sD, Column_qoutes.get(sD));
		Column_qoutes = tempMap;
		System.out.println("After filter_treeset quotes() size " + Column_qoutes.size());

		System.out.println("Before filter_treeset() Column_SUEs size: " + Column_SUEs.size());
		tempMap = new TreeMap<Sym_Date, BasicDailyFinData>();
		for(Sym_Date sD : Column_SUEs.keySet())
			if(!outliersDates.contains(sD) && !outliersYears.contains(sD.get_Date_modif().get_year_in_date()))
				tempMap.put(sD, Column_SUEs.get(sD));
		Column_SUEs = tempMap;
		System.out.println("After filter_treeset Column_SUEs size: " + Column_SUEs.size());

		System.out.println("Before filter_treeset() Column_shares size: " + Column_shares.size());
		tempMapY = new TreeMap<Sym_Year, BasicYearlyFinData>();
		for(Sym_Year sD : Column_shares.keySet())
			if(!outliersYears.contains(sD))
				tempMapY.put(sD, Column_shares.get(sD));
		Column_shares = tempMapY;
		System.out.println("After filter_treeset Column_shares size: " + Column_shares.size());

		System.out.println("Before filter_treeset() Column_book_val size: " + Column_book_val.size());
		tempMapY = new TreeMap<Sym_Year, BasicYearlyFinData>();
		for(Sym_Year sD : Column_book_val.keySet())
			if(!outliersYears.contains(sD))
				tempMapY.put(sD, Column_book_val.get(sD));
		Column_book_val = tempMapY;
		System.out.println("After filter_treeset Column_book_val size: " + Column_book_val.size());

		System.out.println("Before filter_treeset() Column_accrual size: " + Column_accrual.size());
		tempMapY = new TreeMap<Sym_Year, BasicYearlyFinData>();
		for(Sym_Year sD : Column_accrual.keySet())
			if(!outliersYears.contains(sD))
				tempMapY.put(sD, Column_accrual.get(sD));
		Column_accrual = tempMapY;
		System.out.println("After filter_treeset Column_accrual size: " + Column_accrual.size());

		System.out.println("Before filter_treeset() Column_ROE size: " + Column_ROE.size());
		tempMapY = new TreeMap<Sym_Year, BasicYearlyFinData>();
		for(Sym_Year sD : Column_ROE.keySet())
			if(!outliersYears.contains(sD))
				tempMapY.put(sD, Column_ROE.get(sD));
		Column_ROE = tempMapY;
		System.out.println("After filter_treeset Column_ROE size: " + Column_ROE.size());
		/*
		 *  Filtering done
		 */
	}

	/**
	 * Normalization...
	 * We must create separate NormalizeParameterInAllEntries class for each parameter for later to be able to
	 * denormalize.
	*/
	static void normalizeParameters()
	{
		NormalizeParameterInAllEntries<Sym_Date, BasicDailyFinData> normalizedColumnDividends =
				new NormalizeParameterInAllEntries<Sym_Date, BasicDailyFinData>(Column_dividends);
		Column_dividends = normalizedColumnDividends.getValuesOfParameterNormalized();

		normalizedColumnQuotes =
				new NormalizeParameterInAllEntries<Sym_Date, BasicDailyFinData>(Column_qoutes);
		Column_qoutes = normalizedColumnQuotes.getValuesOfParameterNormalized();

		NormalizeParameterInAllEntries<Sym_Date, BasicDailyFinData> normalizedColumnSUEs =
				new NormalizeParameterInAllEntries<Sym_Date, BasicDailyFinData>(Column_SUEs);
		Column_SUEs = normalizedColumnSUEs.getValuesOfParameterNormalized();

		NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData> normalizedColumnShares =
				new NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData>(Column_shares);
		Column_shares = normalizedColumnShares.getValuesOfParameterNormalized();

		NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData> normalizedColumnBookVals =
				new NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData>(Column_book_val);
		Column_book_val = normalizedColumnBookVals.getValuesOfParameterNormalized();

		NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData> normalizedColumnAccruals =
				new NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData>(Column_accrual);
		Column_accrual = normalizedColumnAccruals.getValuesOfParameterNormalized();

		NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData> normalizedColumnROEs =
				new NormalizeParameterInAllEntries<Sym_Year, BasicYearlyFinData>(Column_ROE);
		Column_ROE = normalizedColumnROEs.getValuesOfParameterNormalized();

		System.out.println("Normalization done");
		// Normalization done!!!
	}

	/**
	 * Regenerating each Company after normalization and filtering is complete and storing in the
	 * global map Companies_match.
	 * @throws IOException
	 * @throws ParseException
	 */
	static void regenerateCompanies() throws IOException, ParseException
	{
		System.out.println("Regenerating companies");

		Company company;

		for (Sym_Date symDate : Column_dividends.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				company.add_dividend(Column_dividends.get(symDate));
				companiesMap.replace(Sym, company);
			}
			else
			{
				company = new Company(Sym, pipeline); 	// the pipeline here is not used at all
				company.add_dividend(Column_dividends.get(symDate));
				companiesMap.put(Sym, company);
			}
			if(Column_dividends.get(symDate).getVal().isNaN())
				System.out.println("Column_dividends NaN");
		}

		for (Sym_Date symDate : Column_qoutes.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				if(!Column_qoutes.get(symDate).getVal().isInfinite())
				{
					company = companiesMap.get(Sym);
					company.add_quote(Column_qoutes.get(symDate));
					companiesMap.replace(Sym, company);
				}
			}
			else
			{
				if(!Column_qoutes.get(symDate).getVal().isInfinite())
				{
					company = new Company(Sym, pipeline); // the pipeline here is not used at all
					company.add_quote(Column_qoutes.get(symDate));
					companiesMap.put(Sym, company);
				}
			}
			if(Column_qoutes.get(symDate).getVal().isNaN() || Column_qoutes.get(symDate).getVal().isInfinite())
				System.out.println("Column_qoutes val:" + Column_qoutes.get(symDate).getVal());
		}

		for (Sym_Date symDate : Column_SUEs.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				company.add_SUE(Column_SUEs.get(symDate));
				companiesMap.replace(Sym, company);
			}
			else
			{
				company = new Company(Sym, pipeline); // the pipeline here is not used at all
				company.add_SUE(Column_SUEs.get(symDate));
				companiesMap.put(Sym, company);
			}
			if(Column_SUEs.get(symDate).getVal().isNaN())
				System.out.println("Column_SUEs NaN");
		}

		for (Sym_Year symDate : Column_accrual.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				company.add_accrual(symDate, Column_accrual.get(symDate));
				companiesMap.replace(Sym, company);
			}
			else
			{
				company = new Company(Sym, pipeline); // the pipeline here is not used at all
				company.add_accrual(symDate, Column_accrual.get(symDate));
				companiesMap.put(Sym, company);
			}
			if(Column_accrual.get(symDate).getVal().isNaN())
				System.out.println("Column_accrual NaN");
		}

		for (Sym_Year symDate : Column_ROE.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				company.add_ROE(symDate, Column_ROE.get(symDate));
				companiesMap.replace(Sym, company);
			}
			else
			{
				company = new Company(Sym, pipeline); // the pipeline here is not used at all
				company.add_ROE(symDate, Column_ROE.get(symDate));
				companiesMap.put(Sym, company);
			}
			if(Column_ROE.get(symDate).getVal().isNaN())
				System.out.println("Column_ROE NaN");
		}

		for (Sym_Year symDate : Column_book_val.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				company.add_book_val(symDate, Column_book_val.get(symDate));
				companiesMap.replace(Sym, company);
			}
			else
			{
				company = new Company(Sym, pipeline); // the pipeline here is not used at all
				company.add_book_val(symDate, Column_book_val.get(symDate));
				companiesMap.put(Sym, company);
			}
			if(Column_book_val.get(symDate).getVal().isNaN())
				System.out.println("Column_book_val NaN");
		}

		for (Sym_Year symDate : Column_shares.keySet()) {
			String Sym = symDate.get_sym();

			if (companiesMap.containsKey(Sym))
			{
				company = companiesMap.get(Sym);
				company.add_share(symDate, Column_shares.get(symDate));
				companiesMap.replace(Sym, company);
			}
			else
			{
				company = new Company(Sym, pipeline); // the pipeline here is not used at all
				company.add_share(symDate, Column_shares.get(symDate));
				companiesMap.put(Sym, company);
			}
			if(Column_shares.get(symDate).getVal().isNaN())
				System.out.println("Column_shares NaN");
		}
	}

	/** Companies recreated. Filter companies with some parameter outlier that has been erased in the previous step and now is null.
	 * Set the other parameters and read or evaluate (and generate) senti files,
	 * @throws ParseException
	 * @throws IOException
	 */
	static void filterCompaniesAndSetOtherParameters() throws IOException, ParseException
	{
		Company company;

		System.out.println("Set the other parameters");
		for (String Sym : companiesMap.keySet())
		{
			System.out.println("Sym:" + Sym);
			company = companiesMap.get(Sym);
			company.readOrEvalSentiOfNews();	//this will also store senti to file
			company.findConsistentYearsFromFinancialData();
			company.findConsistentDatesFromFinancialData();
			company.makeConsistentNewsWithFinancialData();

			//makeConsistentNewsWithFinancialData()...
			List<DateModif> consistentDates = new ArrayList<DateModif>(company.getNewsAvgSentiPerDateDescript().keySet());
			for(DateModif dateModif : consistentDates)
			{
				Sym_Date symDate = new Sym_Date(Sym, dateModif);
				_symDates.add(symDate);
				_symbolsInSymDates.add(Sym);
			}

			company.setFinancialParameters(); 		// it finds other derived financial parameters

			companiesMap.replace(Sym, company);
		}

		System.out.println("after Main.filterCompaniesAndSetOtherParameters() _symDates size:" + _symDates.size());
	}

	static void prepareForMachineLearning()
	{
		System.out.println("Read_sentiment._symDates size:"	+ _symDates.size());
		// reading from the above generated files
		AllCompaniesSentimentOfNews allCompaniesSentimentOfNews =
				new AllCompaniesSentimentOfNews(_symDates, _symbolsInSymDates);

		//allCompaniesSentimentOfNews.readAllSentiFiles()...
		System.out.println("Size after reading senti files: " + allCompaniesSentimentOfNews.readAllSentiFiles());
		_symDates = new HashSet<Sym_Date>(allCompaniesSentimentOfNews.getSymDates());
		System.out.println("Size of _symDates after setting it from reading senti files: " +
				_symDates.size());

		//_symDates = allCompaniesSentimentOfNews.getSymDates();
		/*_symbols = new ArrayList<String>(
				AllCompaniesSentimentOfNews.getSymbDates());
		_dates = new ArrayList<DateModif>(
				AllCompaniesSentimentOfNews.get_dates());*/

		/*System.out.println("Repeader_sym_for_training_matching size:"
				+ _symbolsForTrainingML.size());
		System.out.println("Dates_for_training_matching:"
				+ _datesForTrainingML.size());*/

		Map<String,Company> tempCompaniesMap = new TreeMap<String, Company>();

		for(String key : companiesMap.keySet())
		{
			boolean t = false;
			for(Sym_Date symDate : _symDates)
				if(symDate.get_sym().equals(key))
				{
					t = true;
					break;
				}
			if(t == true)
				tempCompaniesMap.put(key, companiesMap.get(key));
		}
		companiesMap = tempCompaniesMap;
	}

	public static void divideCompaniesMapTrainCrossValTest()
	{
		List<String> keys = new ArrayList<String>(companiesMap.keySet());
		_symDatesForTestingML  = new ArrayList<Sym_Date>();
		int i = 0;
		for(String key : keys)
		{
			if(i < companiesMap.size()*0.6)
			{
				Company tempCompany = companiesMap.get(key);
				trainingCompaniesMap.put(key, tempCompany);
				for(Sym_Date symDate : _symDates)
					if(symDate.get_sym().equals(key))
						_symDatesForTrainingML.add(symDate);
			}
			else
			if(i >= companiesMap.size()*0.6 && i < companiesMap.size()*0.8)
			{
				Company tempCompany = companiesMap.get(key);
				crossValidationCompaniesMap.put(key, tempCompany);
				for(Sym_Date symDate : _symDates)
					if(symDate.get_sym().equals(key))
						_symDatesForCrossValidationML.add(symDate);
			}
			else
			{
				Company tempCompany = companiesMap.get(key);
				testingCompaniesMap.put(key, tempCompany);
				for(Sym_Date symDate : _symDates)
					if(symDate.get_sym().equals(key))
						_symDatesForTestingML.add(symDate);
			}
			i++;
		}

		_trainingSize = _symDatesForTrainingML.size();
		_crossValidatSize = _symDatesForCrossValidationML.size();
		_testingSize = _symDatesForTestingML.size();

		System.out.println("training_size:" + _trainingSize + " ,parameters:"
				+ parameters + ", Companies_match" + companiesMap.size());
	}

}


text:
package org.springframework.cloud.gcp.pubsub.support.converter;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.pubsub.v1.PubsubMessage;
import org.json.JSONException;
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;

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

/**
 * Tests for the Jackson message converter.
 *
 * @author Dmitry Solomakha
 * @author Doug Hoard
 * @author Chengyuan Zhao
 *
 * @since  1.1
 */

public class JacksonPubSubMessageConverterTests {

	private JacksonPubSubMessageConverter converter = new JacksonPubSubMessageConverter(new ObjectMapper());

	@Test
	public void testString() throws JSONException {
		String str = "test 123";

		PubsubMessage pubsubMessage = this.converter.toPubSubMessage(str, null);

		JSONAssert.assertEquals(
				"\"test 123\"",
				pubsubMessage.getData().toStringUtf8(),
				true);

		Object o = this.converter.fromPubSubMessage(pubsubMessage, String.class);

		assertThat(o).as("verify that deserialized object is equal to the original one").isEqualTo(str);
	}

	@Test
	public void testPojo() throws JSONException {
		Contact contact = new Contact("Thomas", "Edison", 8817);

		PubsubMessage pubsubMessage = this.converter.toPubSubMessage(contact, null);

		JSONAssert.assertEquals(
				"{\"firstName\":\"Thomas\",\"lastName\":\"Edison\",\"zip\":8817}",
				pubsubMessage.getData().toStringUtf8(),
				true);

		Object o = this.converter.fromPubSubMessage(pubsubMessage, Contact.class);

		assertThat(o).as("verify that deserialized object is equal to the original one").isEqualTo(contact);
	}

	@Test
	public void testToPubSubMessageWithNullPayload() throws JSONException {
		PubsubMessage pubsubMessage = this.converter.toPubSubMessage(null, null);
		Assert.assertNotNull(pubsubMessage);
	}

	/**
	 * A test class containing data to test conversions.
	 */
	static class Contact {
		String firstName;

		String lastName;

		int zip;

		public String getFirstName() {
			return this.firstName;
		}

		public void setFirstName(String firstName) {
			this.firstName = firstName;
		}

		public String getLastName() {
			return this.lastName;
		}

		public void setLastName(String lastName) {
			this.lastName = lastName;
		}

		public int getZip() {
			return this.zip;
		}

		public void setZip(int zip) {
			this.zip = zip;
		}

		Contact() {
		}

		Contact(String firstName, String lastName, int zip) {
			this.firstName = firstName;
			this.lastName = lastName;
			this.zip = zip;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) {
				return true;
			}
			if (o == null || getClass() != o.getClass()) {

				return false;
			}
			Contact contact = (Contact) o;
			return this.zip == contact.zip &&
					java.util.Objects.equals(this.firstName, contact.firstName) &&
					java.util.Objects.equals(this.lastName, contact.lastName);
		}

		@Override
		public int hashCode() {
			return java.util.Objects.hash(this.firstName, this.lastName, this.zip);
		}
	}
}