text:
package org.yukatan.rapid.phase.validation;

import com.fasterxml.jackson.databind.JsonNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.yukatan.rapid.core.exception.RequiredFieldException;
import org.yukatan.rapid.core.phase.Phase;
import org.yukatan.rapid.core.phase.metadata.RapidPhase;
import org.yukatan.rapid.core.task.Task;
import org.yukatan.rapid.core.task.registry.TaskRegistry;

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

/**
 * Created by Jesus Barquín on 13/03/16.
 */
@RapidPhase("validation")
public class ValidationPhase implements Phase{

    public static final String REQUIRED_FIELD_NOT_PRESENT = "Required field scopePath is not present in validation constraint";

    @Autowired
    private TaskRegistry taskRegistry;

    @Override
    public Task buildPhase(JsonNode descriptor) {

        List<Task> task = new ArrayList<>();
        descriptor.iterator().forEachRemaining(this::processConstraint);
        return null;
    }

    private void processConstraint(JsonNode contraint) {

        String scopePath = contraint.path("scopePath").asText();
        if(StringUtils.hasText(scopePath)){
            throw new RequiredFieldException(REQUIRED_FIELD_NOT_PRESENT);
        }

    }
}


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

class Model_Cassandra_Epubcheck implements Model_Epubcheckinterface {

	protected function add_output($filename, $output_content) {
		$created_date;
	}

	protected function remove_output($id) {}

	protected function remove_all_outputs($filename) {}

	protected function list_outputs($filename) {}

        protected function get_output($id) {}

} // End of Model_Cassandra_Epubcheck

redpajama_set_name: RedPajamaGithub


text:
  添加产品

  库存及价格

  缺货管理

  断货管理

  修改库存


text:
package collector
/*
* File Generated by enaml generator
* !!! Please do not edit this file !!!
*/
type Datadog struct {

	/*ApiKey - Descr: Datadog API key Default: <nil>
*/
	ApiKey interface{} `yaml:"api_key,omitempty"`

	/*ApplicationKey - Descr: Datadog application key Default: <nil>
*/
	ApplicationKey interface{} `yaml:"application_key,omitempty"`

}


text:
/* eslint-disable max-len, no-var, one-var, one-var-declaration-per-line, no-unused-expressions, consistent-return, no-param-reassign, default-case, no-return-assign, object-shorthand, prefer-template, vars-on-top, max-len */

import $ from 'jquery';
import '~/gl_dropdown';
import SearchAutocomplete from '~/search_autocomplete';
import '~/lib/utils/common_utils';

describe('Search autocomplete dropdown', () => {
  var assertLinks,
    dashboardIssuesPath,
    dashboardMRsPath,
    groupIssuesPath,
    groupMRsPath,
    groupName,
    mockDashboardOptions,
    mockGroupOptions,
    mockProjectOptions,
    projectIssuesPath,
    projectMRsPath,
    projectName,
    userId,
    widget;
  var userName = 'root';

  widget = null;

  userId = 1;

  dashboardIssuesPath = '/dashboard/issues';

  dashboardMRsPath = '/dashboard/merge_requests';

  projectIssuesPath = '/gitlab-org/gitlab-ce/issues';

  projectMRsPath = '/gitlab-org/gitlab-ce/merge_requests';

  groupIssuesPath = '/groups/gitlab-org/issues';

  groupMRsPath = '/groups/gitlab-org/merge_requests';

  projectName = 'GitLab Community Edition';

  groupName = 'Gitlab Org';

  const removeBodyAttributes = function() {
    const $body = $('body');

    $body.removeAttr('data-page');
    $body.removeAttr('data-project');
    $body.removeAttr('data-group');
  };

  // Add required attributes to body before starting the test.
  // section would be dashboard|group|project
  const addBodyAttributes = function(section) {
    if (section == null) {
      section = 'dashboard';
    }

    const $body = $('body');
    removeBodyAttributes();
    switch (section) {
      case 'dashboard':
        return $body.attr('data-page', 'root:index');
      case 'group':
        $body.attr('data-page', 'groups:show');
        return $body.data('group', 'gitlab-org');
      case 'project':
        $body.attr('data-page', 'projects:show');
        return $body.data('project', 'gitlab-ce');
    }
  };

  const disableProjectIssues = function() {
    document.querySelector('.js-search-project-options').setAttribute('data-issues-disabled', true);
  };

  // Mock `gl` object in window for dashboard specific page. App code will need it.
  mockDashboardOptions = function() {
    window.gl || (window.gl = {});
    return (window.gl.dashboardOptions = {
      issuesPath: dashboardIssuesPath,
      mrPath: dashboardMRsPath,
    });
  };

  // Mock `gl` object in window for project specific page. App code will need it.
  mockProjectOptions = function() {
    window.gl || (window.gl = {});
    return (window.gl.projectOptions = {
      'gitlab-ce': {
        issuesPath: projectIssuesPath,
        mrPath: projectMRsPath,
        projectName: projectName,
      },
    });
  };

  mockGroupOptions = function() {
    window.gl || (window.gl = {});
    return (window.gl.groupOptions = {
      'gitlab-org': {
        issuesPath: groupIssuesPath,
        mrPath: groupMRsPath,
        projectName: groupName,
      },
    });
  };

  assertLinks = function(list, issuesPath, mrsPath) {
    if (issuesPath) {
      const issuesAssignedToMeLink = `a[href="${issuesPath}/?assignee_id=${userId}"]`;
      const issuesIHaveCreatedLink = `a[href="${issuesPath}/?author_id=${userId}"]`;
      expect(list.find(issuesAssignedToMeLink).length).toBe(1);
      expect(list.find(issuesAssignedToMeLink).text()).toBe('Issues assigned to me');
      expect(list.find(issuesIHaveCreatedLink).length).toBe(1);
      expect(list.find(issuesIHaveCreatedLink).text()).toBe("Issues I've created");
    }
    const mrsAssignedToMeLink = `a[href="${mrsPath}/?assignee_id=${userId}"]`;
    const mrsIHaveCreatedLink = `a[href="${mrsPath}/?author_id=${userId}"]`;
    expect(list.find(mrsAssignedToMeLink).length).toBe(1);
    expect(list.find(mrsAssignedToMeLink).text()).toBe('Merge requests assigned to me');
    expect(list.find(mrsIHaveCreatedLink).length).toBe(1);
    expect(list.find(mrsIHaveCreatedLink).text()).toBe("Merge requests I've created");
  };

  preloadFixtures('static/search_autocomplete.html.raw');
  beforeEach(function() {
    loadFixtures('static/search_autocomplete.html.raw');

    window.gon = {};
    window.gon.current_user_id = userId;
    window.gon.current_username = userName;

    return (widget = new SearchAutocomplete());
  });

  afterEach(function() {
    // Undo what we did to the shared <body>
    removeBodyAttributes();
    window.gon = {};
  });
  it('should show Dashboard specific dropdown menu', function() {
    var list;
    addBodyAttributes();
    mockDashboardOptions();
    widget.searchInput.triggerHandler('focus');
    list = widget.wrap.find('.dropdown-menu').find('ul');
    return assertLinks(list, dashboardIssuesPath, dashboardMRsPath);
  });
  it('should show Group specific dropdown menu', function() {
    var list;
    addBodyAttributes('group');
    mockGroupOptions();
    widget.searchInput.triggerHandler('focus');
    list = widget.wrap.find('.dropdown-menu').find('ul');
    return assertLinks(list, groupIssuesPath, groupMRsPath);
  });
  it('should show Project specific dropdown menu', function() {
    var list;
    addBodyAttributes('project');
    mockProjectOptions();
    widget.searchInput.triggerHandler('focus');
    list = widget.wrap.find('.dropdown-menu').find('ul');
    return assertLinks(list, projectIssuesPath, projectMRsPath);
  });
  it('should show only Project mergeRequest dropdown menu items when project issues are disabled', function() {
    addBodyAttributes('project');
    disableProjectIssues();
    mockProjectOptions();
    widget.searchInput.triggerHandler('focus');
    const list = widget.wrap.find('.dropdown-menu').find('ul');
    assertLinks(list, null, projectMRsPath);
  });
  it('should not show category related menu if there is text in the input', function() {
    var link, list;
    addBodyAttributes('project');
    mockProjectOptions();
    widget.searchInput.val('help');
    widget.searchInput.triggerHandler('focus');
    list = widget.wrap.find('.dropdown-menu').find('ul');
    link = "a[href='" + projectIssuesPath + '/?assignee_id=' + userId + "']";
    return expect(list.find(link).length).toBe(0);
  });
  it('should not submit the search form when selecting an autocomplete row with the keyboard', function() {
    var ENTER = 13;
    var DOWN = 40;
    addBodyAttributes();
    mockDashboardOptions(true);
    var submitSpy = spyOnEvent('form', 'submit');
    widget.searchInput.triggerHandler('focus');
    widget.wrap.trigger($.Event('keydown', { which: DOWN }));
    var enterKeyEvent = $.Event('keydown', { which: ENTER });
    widget.searchInput.trigger(enterKeyEvent);
    // This does not currently catch failing behavior. For security reasons,
    // browsers will not trigger default behavior (form submit, in this
    // example) on JavaScript-created keypresses.
    expect(submitSpy).not.toHaveBeenTriggered();
  });
});


text:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Plugin, Cordova } from './plugin';
/**
 * @beta
 * @name NativeGeocoder
 * @description
 * Cordova plugin for native forward and reverse geocoding
 *
 * @usage
 * ```typescript
 * import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from 'ionic-native';
 *
 * NativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
 *   .then((result: NativeGeocoderReverseResult) => console.log("The address is " + result.address + " in " + result.countryCode))
 *   .catch((error: any) => console.log(error));
 *
 * NativeGeocoder.forwardGeocode("Berlin")
 *   .then((coordinates: NativeGeocoderForwardResult) => console.log("The coordinates are latitude=" + coordinates.latitude + " and longitude=" + coordinates.longitude))
 *   .catch((error: any) => console.log(error));
 * ```
 * @interfaces
 * NativeGeocoderReverseResult
 * NativeGeocoderForwardResult
 */
export var NativeGeocoder = (function () {
    function NativeGeocoder() {
    }
    /**
     * Reverse geocode a given latitude and longitude to find location address
     * @param latitude {number} The latitude
     * @param longitude {number} The longitude
     * @return {Promise<any>}
     */
    NativeGeocoder.reverseGeocode = function (latitude, longitude) { return; };
    /**
     * Forward geocode a given address to find coordinates
     * @param addressString {string} The address to be geocoded
     * @return {Promise<any>}
     */
    NativeGeocoder.forwardGeocode = function (addressString) { return; };
    __decorate([
        Cordova({
            callbackOrder: 'reverse'
        })
    ], NativeGeocoder, "reverseGeocode", null);
    __decorate([
        Cordova({
            callbackOrder: 'reverse'
        })
    ], NativeGeocoder, "forwardGeocode", null);
    NativeGeocoder = __decorate([
        Plugin({
            pluginName: 'NativeGeocoder',
            plugin: 'cordova-plugin-nativegeocoder',
            pluginRef: 'nativegeocoder',
            repo: 'https://github.com/sebastianbaar/cordova-plugin-nativegeocoder',
            platforms: ['iOS', 'Android']
        })
    ], NativeGeocoder);
    return NativeGeocoder;
}());
//# sourceMappingURL=native-geocoder.js.map


text:
<?php

namespace RectorPrefix20210615;

if (\class_exists('Tx_Extbase_MVC_Exception_InvalidControllerName')) {
    return;
}
class Tx_Extbase_MVC_Exception_InvalidControllerName
{
}
\class_alias('Tx_Extbase_MVC_Exception_InvalidControllerName', 'Tx_Extbase_MVC_Exception_InvalidControllerName', \false);


text:
""" Coherence

Coherence (*Coh*) is one of the most commonly utilized connectivity estimators; it is a
measurement of the linear relationship of two signals at a specific frequency [Nolte2004_].

Given two time series :math:`x` and :math:`y`, coherece is given by:

.. math::
    coh^2_{xy}(f) = \\frac{ |G_{xy}(f)^2| }{ G_{xx}(f) G_{yy}(f) }

Where :math:`G_{xy}(f)` is the estimated cross-spectral density between :math:`x` and
:math:`y`, while :math:`G_{xx}(f)` and :math:`G_{yy}(f)` are the autospectrum of
:math:`x` and :math:`y` respectively.

The result is a symmetric matrix of size :math:`[n\_channels \\times n\_channels]`
bearing no information about the directionality of the interaction, with values
within the range :math:`[0,1]`.

|

-----

.. [Nolte2004] Nolte, G., Bai, O., Wheaton, L., Mari, Z., Vorbach, S., & Hallett, M. (2004). Identifying true brain interaction from EEG data using the imaginary part of coherency. Clinical neurophysiology, 115(10), 2292-2307.
.. [Thatcher2005] Thatcher, R. W., North, D., & Biver, C. (2005). EEG and intelligence: relations between EEG coherence, EEG phase delay and power. Clinical neurophysiology, 116(9), 2129-2141.
.. [Vinck2011] Vinck, M., Oostenveld, R., van Wingerden, M., Battaglia, F., & Pennartz, C. M. (2011). An improved index of phase-synchronization for electrophysiological data in the presence of volume-conduction, noise and sample-size bias. Neuroimage, 55(4), 1548-1565.
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>

from .estimator import Estimator
from ..analytic_signal import analytic_signal

import numpy as np
import matplotlib.mlab as mlab

def coherence(data, fb, fs, pairs=None, **kwargs):
    """ Coherence

    Estimate the Coherence for the given :attr:`data`,
    between the :attr:`pairs (if given) of channels.

    Parameters
    ----------
    data : array-like, shape(n_channels, n_samples)
        Multichannel recording data.

    fb : list of length 2
        The lower and upper frequency.

    fs : float
        Sampling frequency.

    pairs : array-like or `None`
        - If an `array-like` is given, notice that each element is a tuple of length two.
        - If `None` is passed, complete connectivity will be assumed.

    **kwargs :
        Keyword arguments to be passed to :meth:`matplotlib.mlab.csd`.

    Returns
    -------
    coh : array-like, shape(n_channels, n_channels)
        Estimated Coherence.

    See also
    --------
    dyconnmap.fc.Coherece: Coherece (Class Estimator)
    dyconnmap.fc.icoherence: Imaginary Coherence
    """
    n_channels, _ = np.shape(data)
    _, _, filtered = analytic_signal(data, fb, fs)

    if pairs is None:
        pairs = [(r1, r2) for r1 in range(n_channels) for r2 in range(n_channels)]

    coh = np.zeros((n_channels, n_channels))

    for pair in pairs:
        filt1, filt2 = filtered[pair,]

        csdxx, _ = mlab.csd(
            x=filt1, y=filt1, Fs=fs, scale_by_freq=True, sides="onesided", **kwargs
        )
        csdyy, _ = mlab.csd(
            x=filt2, y=filt2, Fs=fs, scale_by_freq=True, sides="onesided", **kwargs
        )
        csdxy, _ = mlab.csd(
            x=filt1, y=filt2, Fs=fs, scale_by_freq=True, sides="onesided", **kwargs
        )

        cohv = np.abs(csdxy * np.conj(csdxy)) / (csdxx * csdyy)

        coh[pair] = np.sum(cohv) / len(cohv)

    return coh

class Coherence(Estimator):
    """ Coherence

    An :mod:`dyconnmap.fc.Estimator` class that implements :mod:`dyconnmap.fc.coherence`.

    See also
    --------
    dyconnmap.fc.coherence: Coherence
    dyconnmap.tvfcg: Time-Varying Functional Connectivity Graphs
    """

    def __init__(self, fb, fs, pairs=None, **kwargs):
        Estimator.__init__(self, fs, pairs)

        self.fb = fb
        self.pairs = pairs
        self.csdargs = kwargs

    def preprocess(self, data):
        n_channels, _ = np.shape(data)

        _, _, filtered = analytic_signal(data, self.fb, self.fs)

        super().prepare_pairs(n_channels)

        return filtered

    def estimate_pair(self, ts1, ts2):
        csdxx, _ = mlab.csd(
            x=ts1,
            y=ts1,
            Fs=self.fs,
            scale_by_freq=True,
            sides="onesided",
            **self.csdargs
        )
        csdyy, _ = mlab.csd(
            x=ts2,
            y=ts2,
            Fs=self.fs,
            scale_by_freq=True,
            sides="onesided",
            **self.csdargs
        )
        csdxy, _ = mlab.csd(
            x=ts1,
            y=ts2,
            Fs=self.fs,
            scale_by_freq=True,
            sides="onesided",
            **self.csdargs
        )

        cohv = np.abs(csdxy * np.conj(csdxy)) / (csdxx * csdyy)

        return np.sum(cohv) / len(cohv)

    def estimate(self, data, data_against=None):
        """

        Returns
        -------
        ts : complex array-like, shape(n_channels, n_channels, n_samples)
            Estimated PLV time series (complex valued).

        avg : array-like, shape(n_channels, n_channels)
            Average PLV.

        Notes
        -----
        Called from :mod:`dyconnmap.tvfcgs.tvfcg`.
        """
        n_rois, _ = np.shape(data)

        super().prepare_pairs(n_rois)

        avg = np.zeros((n_rois, n_rois))

        for pair in self.pairs:
            ts1, ts2 = data[pair,]
            avg[pair] = self.estimate_pair(ts1, ts2)

        return (None, avg)


text:
namespace YanZhiwei.DotNet2.Utilities.WinForm
{
    using System.Collections.Generic;
    using System.Windows.Forms;

    /// <summary>
    /// CheckedList 帮助类
    /// </summary>
    public static class CheckedListBoxHelper
    {
        #region Methods

        /// <summary>
        /// 获取选中项集合
        /// </summary>
        /// <typeparam name="T">泛型</typeparam>
        /// <param name="checkedListBox">CheckedListBox</param>
        /// <returns>选中项集合</returns>
        public static List<T> GetCheckedItemList<T>(this CheckedListBox checkedListBox)
            where T : class
        {
            List<T> _checkedItemList = new List<T>();
            for (int i = 0; i < checkedListBox.CheckedItems.Count; i++)
            {
                T _item = (T)checkedListBox.Items[i];
                _checkedItemList.Add(_item);
            }
            return _checkedItemList;
        }

        /// <summary>
        /// 设置项勾选状态
        /// </summary>
        /// <param name="checkedListBox">CheckedListBox</param>
        /// <param name="state">是否勾选</param>
        public static void SetAllItemState(this CheckedListBox checkedListBox, bool state)
        {
            for (int i = 0; i < checkedListBox.Items.Count; i++)
            {
                checkedListBox.SetItemChecked(i, state);
            }
        }

        /// <summary>
        /// CheckedListBox 数据绑定
        /// </summary>
        /// <param name="checkedListBox">CheckedListBox</param>
        /// <param name="dataSource">绑定数据源</param>
        /// <param name="valueMember">隐式字段</param>
        /// <param name="displayMember">显示字段</param>
        public static void SetDataSource(this CheckedListBox checkedListBox, object dataSource, string valueMember, string displayMember)
        {
            checkedListBox.DataSource = dataSource;
            checkedListBox.ValueMember = valueMember;
            checkedListBox.DisplayMember = displayMember;
        }

        #endregion Methods
    }
}


text:
module MongoParserRB
  class Query
    class Expression

      INVERSION_OPERATORS = [:$not].freeze
      CONJUNCTION_OPERATORS = [:$and, :$or].freeze
      NEGATIVE_EQUALITY_OPERATORS = [:$nin, :$ne].freeze
      EQUALITY_OPERATORS = [:$eq, :$gt, :$lt, :$gte, :$lte, :$in, :$nin, :$ne].freeze
      ELEM_MATCH_OPERATORS = [:$elemMatch].freeze
      ALL_OPERATORS = [:$eq, :$gt, :$lt, :$gte, :$lte, :$in, :$nin, :$ne, :$and, :$or, :$not, :$elemMatch].freeze

      def initialize(operator, *args)
        @operator = operator

        if CONJUNCTION_OPERATORS.include?(@operator)
          @arguments = args[0]
        else
          @field = Field.new(args[0])
          @arguments = args[1]
        end
      end

      def evaluate(document)
        case @operator
        when *Expression::CONJUNCTION_OPERATORS
          evaluate_conjunction(document)
        when *Expression::NEGATIVE_EQUALITY_OPERATORS
          evaluate_negative_equality(document)
        when *Expression::EQUALITY_OPERATORS
          evaluate_equality(document)
        when *Expression::INVERSION_OPERATORS
          evaluate_inversion(document)
        when *Expression::ELEM_MATCH_OPERATORS
          evaluate_elemMatch(document)
        end
      rescue NoMethodError, TypeError
        false
      end

      private

      def evaluate_elemMatch(document)
        @field.value_in_document(document).any? do |subdocument|
          @arguments.all? do |arg|
            arg.evaluate(subdocument)
          end
        end
      end

      def evaluate_inversion(document)
        # Mongo negative equality operators return true when
        # the specified field does not exist on a document.
        return true if !@field.value_in_document(document) && !@field.in_document?(document)
        !@arguments.evaluate(document)
      end

      def evaluate_conjunction(document)
        case @operator
        when :$and
          @arguments.all? do |arg|
            arg.evaluate(document)
          end
        when :$or
          @arguments.any? do |arg|
            arg.evaluate(document)
          end
        end
      end

      def evaluate_negative_equality(document)
        value_for_field = @field.value_in_document(document)

        case @operator
        when :$ne
          # Mongo negative equality operators return true when
          # the specified field does not exist on a document.
          return true if !value_for_field && !@field.in_document?(document)

          if value_for_field.kind_of?(Array) && !@arguments.kind_of?(Array)
            !value_for_field.include?(@arguments)
          else
            value_for_field != @arguments
          end
        when :$nin
          if value_for_field.kind_of?(Array)
            (value_for_field & @arguments).length.zero?
          else
            !@arguments.include?(value_for_field)
          end
        end
      end

      def evaluate_equality(document)
        value_for_field = @field.value_in_document(document)

        case @operator
        when :$eq
          if @arguments.kind_of?(Regexp)
            !!(value_for_field =~ @arguments)
          elsif value_for_field.kind_of?(Array) && !@arguments.kind_of?(Array)
            value_for_field.include?(@arguments)
          else
            value_for_field == @arguments
          end
        when :$gt
          value_for_field > @arguments
        when :$gte
          value_for_field >= @arguments
        when :$lt
          value_for_field < @arguments
        when :$lte
          value_for_field <= @arguments
        when :$in
          if value_for_field.kind_of?(Array)
            (value_for_field & @arguments).length > 0
          else
            @arguments.include?(value_for_field)
          end
        end
      rescue ArgumentError
        false
      end
    end
  end
end


text:
group node['elasticsearch']['group'] do
  system true
  action :create
  only_if { node['elasticsearch']['setup_user'] }
end

user node['elasticsearch']['user'] do
  system true
  shell '/bin/false'
  gid node['elasticsearch']['group']
  action :create
  only_if { node['elasticsearch']['setup_user'] }
end


text:
* HotRod C++ client libraries
* C++03 plus shared_ptr TR1 support
* CMake 2.8
* Infinispan server running with the default standalone configuration

# Build instructions

    mkdir build
    cd build
    cmake ..
    cmake --build .

# Run instructions

Run the 'build' executable produced by the above


text:
add-apt-repository ppa:ubuntu-lxc/lxd-stable

# install packages
apt-get update
apt-get upgrade -y
apt-get install tmux git htop iftop ufw mosh weechat strace dstat mc swapspace cmatrix golang -y

# setup firewall rules

ufw allow 22
ufw allow 60000:60100/udp
ufw --force enable

# install rmate support

curl -o /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
sudo chmod +x /usr/local/bin/rmate

# install config files

curl -o ~/.gitconfig https://raw.githubusercontent.com/jwd83/dotfiles/master/.gitconfig
curl -o ~/.iftoprc https://raw.githubusercontent.com/jwd83/dotfiles/master/.iftoprc
curl -o ~/.nanorc https://raw.githubusercontent.com/jwd83/dotfiles/master/.nanorc
curl -o ~/.tmux.conf https://raw.githubusercontent.com/jwd83/dotfiles/master/.tmux.conf
curl -o ~/.vimrc https://raw.githubusercontent.com/jwd83/dotfiles/master/.vimrc

echo ""
echo "quick setup included..."
echo "-----------------------------------------------"
echo "git htop iftop ufw mosh weechat strace dstat mc"
echo "swapsace make cmatrix rmate"
echo ""
echo "firewall rules block all except"
echo "-----------------------------------------------"
echo "22          *   ssh"
echo "60000-60100 udp mosh"
echo ""


text:
<?php namespace GlobeCode\LaravelMultiTenant;

use Illuminate\Support\ServiceProvider;

class LaravelMultiTenantServiceProvider extends ServiceProvider {

	/**
	 * Indicates if loading of the provider is deferred.
	 *
	 * @var bool
	 */
	protected $defer = false;

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		$this->package('globecode/laravel-multitenant');
	}

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		// Register our config
		$this->app['config']->package('globecode/laravel-multitenant', __DIR__ . '/../../config');
	}

	/**
	 * Get the services provided by the provider.
	 *
	 * @return array
	 */
	public function provides()
	{
		return array();
	}

}


text:
from typing import List, Optional, Union

def _make_filter_string(
    schema_title: Optional[Union[str, List[str]]] = None,
    in_context: Optional[List[str]] = None,
    parent_contexts: Optional[List[str]] = None,
    uri: Optional[str] = None,
) -> str:
    """Helper method to format filter strings for Metadata querying.

    No enforcement of correctness.

    Args:
        schema_title (Union[str, List[str]]): Optional. schema_titles to filter for.
        in_context (List[str]):
            Optional. Context resource names that the node should be in. Only for Artifacts/Executions.
        parent_contexts (List[str]): Optional. Parent contexts the context should be in. Only for Contexts.
        uri (str): Optional. uri to match for. Only for Artifacts.
    Returns:
        String that can be used for Metadata service filtering.
    """
    parts = []
    if schema_title:
        if isinstance(schema_title, str):
            parts.append(f'schema_title="{schema_title}"')
        else:
            substring = " OR ".join(f'schema_title="{s}"' for s in schema_title)
            parts.append(f"({substring})")
    if in_context:
        for context in in_context:
            parts.append(f'in_context("{context}")')
    if parent_contexts:
        parent_context_str = ",".join([f'"{c}"' for c in parent_contexts])
        parts.append(f"parent_contexts:{parent_context_str}")
    if uri:
        parts.append(f'uri="{uri}"')
    return " AND ".join(parts)


text:
package at.ac.tuwien.infosys.jcloudscale.datastore.mapping.hbase;

import at.ac.tuwien.infosys.jcloudscale.datastore.driver.hbase.HbaseCell;
import at.ac.tuwien.infosys.jcloudscale.datastore.driver.hbase.HbaseRow;
import at.ac.tuwien.infosys.jcloudscale.datastore.mapping.Mapper;
import at.ac.tuwien.infosys.jcloudscale.datastore.mapping.ObjectNavigator;
import at.ac.tuwien.infosys.jcloudscale.datastore.mapping.ObjectNavigatorImpl;
import at.ac.tuwien.infosys.jcloudscale.datastore.mapping.Visitor;
import at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.TypeAdapterFactory;
import at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.hbase.HbaseTypeAdapterFactory;
import at.ac.tuwien.infosys.jcloudscale.datastore.util.ReflectionUtil;

public class HbaseMapperImpl implements Mapper<HbaseRow> {

    private TypeAdapterFactory<HbaseCell> typeAdapterFactory;

    public HbaseMapperImpl() {
        this.typeAdapterFactory = new HbaseTypeAdapterFactory();
    }

    @Override
    public HbaseRow serialize(Object object) {
        HbaseRow hbaseRow = new HbaseRow(getTableNameForObject(object));
        ObjectNavigator objectNavigator = new ObjectNavigatorImpl(typeAdapterFactory);
        Visitor vistor = new HbaseSerializationVisitor(hbaseRow);
        objectNavigator.navigate(object, vistor);
        return hbaseRow;
    }

    @Override
    public <K> K deserialize(HbaseRow serializedObject, Class<K> targetClass) {
        K object = ReflectionUtil.createInstance(targetClass);
        ObjectNavigator objectNavigator = new ObjectNavigatorImpl(typeAdapterFactory);
        Visitor visitor = new HbaseDeserializationVisitor(serializedObject, object);
        objectNavigator.navigate(object, visitor);
        return object;
    }

    private String getTableNameForObject(Object object) {
        return object.getClass().getSimpleName();
    }
}


text:
/**
 * WYSIHTML5 Editor
 *
 * @param {Element} editableElement Reference to the textarea which should be turned into a rich text interface
 * @param {Object} [config] See defaultConfig object below for explanation of each individual config option
 *
 * @events
 *    load
 *    beforeload (for internal use only)
 *    focus
 *    focus:composer
 *    focus:textarea
 *    blur
 *    blur:composer
 *    blur:textarea
 *    change
 *    change:composer
 *    change:textarea
 *    paste
 *    paste:composer
 *    paste:textarea
 *    newword:composer
 *    undo:composer
 *    redo:composer
 *    beforecommand:composer
 *    aftercommand:composer
 *    enable:composer
 *    disable:composer
 *    change_view
 */

import lang from "wysihtml5/lang";
import dom from "./dom";
import { browser } from "./browser";
import { Composer } from "./views/composer";
import quirks from "./quirks";

var undef;

var defaultConfig = {
  // Give the editor a name, the name will also be set as class name on the iframe and on the iframe's body
  name:                 undef,
  // Whether the editor should look like the textarea (by adopting styles)
  style:                true,
  // Whether urls, entered by the user should automatically become clickable-links
  autoLink:             true,
  // Includes table editing events and cell selection tracking
  handleTables:         false,
  // Object which includes parser rules to apply when html gets inserted via copy & paste
  // See parser_rules/*.js for examples
  parserRules:          { tags: { br: {}, span: {}, div: {}, p: {} }, classes: {} },
  // Parser method to use when the user inserts content via copy & paste
  parser:               dom.Parser,
  // Class name which should be set on the contentEditable element in the created sandbox iframe, can be styled via the 'stylesheets' option
  composerClassName:    "wysihtml5-editor",
  // Class name to add to the body when the wysihtml5 editor is supported
  bodyClassName:        "wysihtml5-supported",
  // By default wysihtml5 will insert a
 for line breaks, set this to false to use

  useLineBreaks:        false,
  // Whether the rich text editor should be rendered on touch devices (wysihtml5 >= 0.3.0 comes with basic support for iOS 5)
  supportTouchDevices:  true,
  // Whether senseless  elements (empty or without attributes) should be removed/replaced with their content
  cleanUp:              true,
  // Whether to use div instead of secure iframe
  contentEditableMode: true,
  noTextarea: true,
  // Classname of container that editor should not touch and pass through
  // Pass false to disable
  uneditableContainerClassname: "wysihtml5-uneditable-container"
};

var Editor = lang.Dispatcher.extend(
  /** @scope wysihtml5.Editor.prototype */ {
  constructor: function(editableElement, config) {
    this.editableElement  = editableElement;
    this.config           = lang.object({}).merge(defaultConfig).merge(config).get();
    this._isCompatible    = browser.supported();

    // Sort out unsupported/unwanted browsers here
    if (!this._isCompatible || (!this.config.supportTouchDevices && browser.isTouchDevice())) {
      var that = this;
      setTimeout(function() { that.fire("beforeload").fire("load"); }, 0);
      return;
    }

    // Add class name to body, to indicate that the editor is supported
    dom.addClass(document.body, this.config.bodyClassName);

    this.composer = new Composer(this, this.editableElement, this.config);
    this.currentView = this.composer;
  },

  isCompatible: function() {
    return this._isCompatible;
  },

  clear: function() {
    this.currentView.clear();
    return this;
  },

  getValue: function(options) {
    return this.currentView.getValue(options);
  },

  setValue: function(html, parse) {
    if (!html) {
      return this.clear();
    }

    this.currentView.setValue(html, parse);
    return this;
  },

  cleanUp: function() {
      this.currentView.cleanUp();
  },

  focus: function(setToEnd) {
    this.currentView.focus(setToEnd);
    return this;
  },

  /**
   * Deactivate editor (make it readonly)
   */
  disable: function() {
    this.currentView.disable();
    return this;
  },

  /**
   * Activate editor
   */
  enable: function() {
    this.currentView.enable();
    return this;
  },

  isEmpty: function() {
    return this.currentView.isEmpty();
  },

  parse: function(htmlOrElement) {
    var returnValue = this.config.parser(htmlOrElement, {
      rules: this.config.parserRules,
      cleanUp: this.config.cleanUp,
      context: document,
      uneditableClass: this.config.uneditableContainerClassname
    });

    if (typeof(htmlOrElement) === "object") {
      quirks.redraw(htmlOrElement);
    }
    return returnValue;
  }
});

export { Editor };


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\forms\EntryTypeSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'guid') ?>

    <?= $form->field($model, 'name') ?>

    <?= $form->field($model, 'description') ?>

    <?= $form->field($model, 'slug') ?>

    <?php // echo $form->field($model, 'title_label') ?>

    <?php // echo $form->field($model, 'admin_menu_label') ?>

    <?php // echo $form->field($model, 'hierarchical') ?>

    <?php // echo $form->field($model, 'created_at') ?>

    <?php // echo $form->field($model, 'update_time') ?>

    <?php // echo $form->field($model, 'created_by') ?>

    <?php // echo $form->field($model, 'updated_by') ?>

        <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
from datetime import timedelta
import mechanize
import locator

def generate_dates(start, end, day_delta):
    delta = timedelta(days=day_delta)
    flight_dates = []
    while start < end:
        depart_date = start.date().strftime("%d/%m/%Y")
        return_date = (start + delta).date().strftime("%d/%m/%Y")
        start += timedelta(days=7)
        flight_dates.append((depart_date, return_date))
    if len(flight_dates) == 0:
        print('No flight dates where generated! Check your start/end dates!!')
    return flight_dates

def parse_data(html_response):
    flights = html_response.select(locator.FLIGHT_ROW)
    data = []
    for flight in flights:
        location = flight.select(locator.FLIGHT_LOCATION)[0].get_text().replace("\n", "")
        date = flight.select(locator.FLIGHT_DATE)[0].get_text().replace("\n", "")
        time = flight.select(locator.FLIGHT_TIME)[0].get_text().replace("\n", "")
        cheapest_price = flight.select(locator.FLIGHT_PRICE)
        if len(cheapest_price) > 0:
            cheapest_price = cheapest_price[0].get_text().replace("\n", "") + '\n'
        else:
            cheapest_price = 'DID NOT FIND A PRICE' + '\n'
        row = location + '|' + date + '|' + time + '|' + cheapest_price
        data.append(row)
    return data

def hit_the_site(departure_date, return_date, origin_airport, destination_airport):
    browser = mechanize.Browser()
    #Dont respect Robots.txt
    browser.set_handle_robots(False)
    browser.addheaders = [('User-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) '
                                         'Gecko/20100101 Firefox/29.0')]
    url = get_url(departure_date, return_date, origin_airport, destination_airport)
    print 'Hitting URL %s' % url
    response = browser.open(url).read()
    browser.clear_history()
    browser.close()
    return response

def get_url(departure_date, return_date, origin_airport, destination_airport):
    url = 'https://caribbean.sita.aero/itd/itd/DoAirSearch'\
                            '?_originSelected=Airport.' + origin_airport +\
                            '&_destinationSelected=Airport.' + destination_airport +\
                            '&_tripType=Return'\
                            '&_depdateeu=' + departure_date +\
                            '&_retdateeu=' + return_date +\
                            '&_classType=Economy'\
                            '&requestor=AirSimpleReqsPage'\
                            '&_channelLocale=en'\
                            '&_children=0'\
                            '&_adults=1'\
                            '&_infants=0'
    return url


text:
package net.swisstech.swissarmyknife.io;

import net.swisstech.swissarmyknife.test.PrivateConstructor;
import org.testng.annotations.Test;

import java.io.Closeable;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.channels.Selector;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

import static org.mockito.Mockito.*;

public class CloseablesTest {

    @Test
    public void privateConstructor() throws IOException {
        PrivateConstructor.invoke(Closeables.class);
    }

    @Test
    public void shouldCloseCloseable() throws IOException {
        Closeable c = mock(Closeable.class);
        Closeables.close(c);
        verify(c).close();
    }

    @Test
    public void shouldIgnoreNullCloseable() {
        Closeables.close((Closeable) null);
    }

    @Test
    public void shouldLogCloseableException() throws IOException {
        Closeable c = mock(Closeable.class);
        doThrow(new IOException("testing Closeable")).when(c).close();
        Closeables.close(c);
        verify(c).close();
    }

    @Test
    public void shouldCloseSelector() throws IOException {
        Selector s = mock(Selector.class);
        Closeables.close(s);
        verify(s).close();
    }

    @Test
    public void shouldIgnoreNullSelector() {
        Closeables.close((Selector) null);
    }

    @Test
    public void shouldLogSelectorException() throws IOException {
        Selector s = mock(Selector.class);
        doThrow(new IOException("testing Selector")).when(s).close();
        Closeables.close(s);
        verify(s).close();
    }

    @Test
    public void shouldCloseServerSocket() throws IOException {
        ServerSocket s = mock(ServerSocket.class);
        Closeables.close(s);
        verify(s).close();
    }

    @Test
    public void shouldIgnoreNullServerSocket() {
        Closeables.close((ServerSocket) null);
    }

    @Test
    public void shouldLogServerSocketException() throws IOException {
        ServerSocket s = mock(ServerSocket.class);
        doThrow(new IOException("testing ServerSocket")).when(s).close();
        Closeables.close(s);
        verify(s).close();
    }

    @Test
    public void shouldCloseSocket() throws IOException {
        Socket s = mock(Socket.class);
        Closeables.close(s);
        verify(s).close();
    }

    @Test
    public void shouldIgnoreNullSocket() {
        Closeables.close((Socket) null);
    }

    @Test
    public void shouldLogSocketException() throws IOException {
        Socket s = mock(Socket.class);
        doThrow(new IOException("testing Socket")).when(s).close();
        Closeables.close(s);
        verify(s).close();
    }

    @Test
    public void shouldCloseHttpURLConnection() {
        HttpURLConnection huc = mock(HttpURLConnection.class);
        Closeables.close(huc);
        verify(huc).disconnect();
    }

    @Test
    public void shouldIgnoreNullHttpURLConnection() {
        Closeables.close((HttpURLConnection) null);
    }

    @Test
    public void shouldLogHttpURLConnectionException() {
        HttpURLConnection huc = mock(HttpURLConnection.class);
        doThrow(new RuntimeException("testing HttpURLConnection")).when(huc).disconnect();
        Closeables.close(huc);
        verify(huc).disconnect();
    }

    @Test
    public void shouldCloseExecutorService() throws InterruptedException {
        ExecutorService s = mock(ExecutorService.class);
        Closeables.shutdownAndAwaitTermination(s, 555);
        verify(s).awaitTermination(555, TimeUnit.MILLISECONDS);
    }

    @Test
    public void shouldIgnoreNullExecutorService() {
        Closeables.shutdownAndAwaitTermination(null, 777);

    }

    @Test
    public void shouldLogInterruptedException() throws InterruptedException {
        ExecutorService s = mock(ExecutorService.class);
        doThrow(new InterruptedException("testing ExecutorService")).when(s).awaitTermination(999, TimeUnit.MILLISECONDS);
        Closeables.shutdownAndAwaitTermination(s, 999);
        verify(s).awaitTermination(999, TimeUnit.MILLISECONDS);
    }
}


text:
#import "FBSimulator+Connection.h"

#import "FBSimulator+Private.h"
#import "FBSimulatorEventRelay.h"
#import "FBSimulatorError.h"
#import "FBSimulatorConnection.h"

@implementation FBSimulator (Connection)

- (nullable FBSimulatorConnection *)connectWithError:(NSError **)error
{
  if (self.eventRelay.connection) {
    return self.eventRelay.connection;
  }
  if (self.state != FBSimulatorStateBooted) {
    return [[[FBSimulatorError
      describeFormat:@"Cannot connect to Simulator in state %@", self.stateString]
      inSimulator:self]
      fail:error];
  }

  FBSimulatorConnection *connection = [[FBSimulatorConnection alloc] initWithSimulator:self framebuffer:nil hid:nil];
  [self.eventSink connectionDidConnect:connection];
  return connection;
}

- (BOOL)disconnectWithTimeout:(NSTimeInterval)timeout logger:(nullable id<FBControlCoreLogger>)logger error:(NSError **)error
{
  FBSimulatorConnection *connection = self.eventRelay.connection;
  if (!connection) {
    [logger.debug logFormat:@"Simulator %@ does not have an active connection", self.shortDescription];
    return YES;
  }

  [logger.debug logFormat:@"Simulator %@ has a connection %@, stopping & wait with timeout %f", self.shortDescription, connection, timeout];
  NSDate *date = NSDate.date;
  if (![connection terminateWithTimeout:timeout]) {
    return [[[[FBSimulatorError
      describeFormat:@"Simulator connection %@ did not teardown in less than %f seconds", connection, timeout]
      inSimulator:self]
      logger:logger]
      failBool:error];
  }
  [logger.debug logFormat:@"Simulator connection %@ torn down in %f seconds", connection, [NSDate.date timeIntervalSinceDate:date]];
  return YES;
}

@end


text:
package org.jasig.schedassist.impl.owner;

/**
 * Exception that may be thrown when an action that requires
 * completed {@link IScheduleOwner} registration is performed
 * by an {@link ICalendarAccount} that is not yet registered.
 *
 * @see OwnerDao#register(org.jasig.schedassist.model.ICalendarAccount)
 * @author Nicholas Blair, nblair@doit.wisc.edu
 * @version $Id: NotRegisteredException.java 1710 2010-02-15 16:19:35Z npblair $
 */
public class NotRegisteredException extends Exception {

	/**
	 *
	 */
	private static final long serialVersionUID = 53706L;

	/**
	 *
	 */
	public NotRegisteredException() {
		super();
	}

	/**
	 * @param message
	 * @param cause
	 */
	public NotRegisteredException(String message, Throwable cause) {
		super(message, cause);
	}

	/**
	 * @param message
	 */
	public NotRegisteredException(String message) {
		super(message);
	}

	/**
	 * @param cause
	 */
	public NotRegisteredException(Throwable cause) {
		super(cause);
	}

}


text:
/**
 * @provides javelin-aphlict
 * @requires javelin-install
 *           javelin-util
 *           javelin-websocket
 *           javelin-leader
 *           javelin-json
 */

/**
 * Client for the notification server. Example usage:
 *
 *   var aphlict = new JX.Aphlict('ws://localhost:22280', subscriptions)
 *     .setHandler(function(message) {
 *       // ...
 *     })
 *     .start();
 *
 */
JX.install('Aphlict', {

  construct: function(uri, subscriptions) {
    if (__DEV__) {
      if (JX.Aphlict._instance) {
        JX.$E('Aphlict object is a singleton.');
      }
    }

    this._uri = uri;
    this._subscriptions = subscriptions;
    this._setStatus('setup');
    this._startTime = new Date().getTime();

    JX.Aphlict._instance = this;
  },

  events: ['didChangeStatus'],

  members: {
    _uri: null,
    _socket: null,
    _subscriptions: null,
    _status: null,
    _isReconnect: false,
    _keepaliveInterval: false,
    _startTime: null,

    start: function() {
      JX.Leader.listen('onBecomeLeader', JX.bind(this, this._lead));
      JX.Leader.listen('onReceiveBroadcast', JX.bind(this, this._receive));
      JX.Leader.start();

      JX.Leader.call(JX.bind(this, this._begin));
    },

    getSubscriptions: function() {
      return this._subscriptions;
    },

    setSubscriptions: function(subscriptions) {
      this._subscriptions = subscriptions;
      JX.Leader.broadcast(
        null,
        {type: 'aphlict.subscribe', data: this._subscriptions});
    },

    clearSubscriptions: function(subscriptions) {
      this._subscriptions = null;
      JX.Leader.broadcast(
        null,
        {type: 'aphlict.unsubscribe', data: subscriptions});
    },

    getStatus: function() {
      return this._status;
    },

    getWebsocket: function() {
      return this._socket;
    },

    _begin: function() {
      JX.Leader.broadcast(
        null,
        {type: 'aphlict.getstatus'});
      JX.Leader.broadcast(
        null,
        {type: 'aphlict.subscribe', data: this._subscriptions});
    },

    _lead: function() {
      this._socket = new JX.WebSocket(this._uri);
      this._socket.setOpenHandler(JX.bind(this, this._open));
      this._socket.setMessageHandler(JX.bind(this, this._message));
      this._socket.setCloseHandler(JX.bind(this, this._close));

      this._socket.open();
    },

    _open: function() {
      // If this is a reconnect, ask the server to replay recent messages
      // after other tabs have had a chance to subscribe. Do this before we
      // broadcast that the connection status is now open.
      if (this._isReconnect) {
        setTimeout(JX.bind(this, this._didReconnect), 100);
      }

      this._broadcastStatus('open');
      JX.Leader.broadcast(null, {type: 'aphlict.getsubscribers'});

      // By default, ELBs terminate connections after 60 seconds with no
      // traffic. Other load balancers may have similar configuration. Send
      // a keepalive message every 15 seconds to prevent load balancers from
      // deciding they can reap this connection.

      var keepalive = JX.bind(this, this._keepalive);
      this._keepaliveInterval = setInterval(keepalive, 15000);
    },

    _didReconnect: function() {
      this.replay();
      this.reconnect();
    },

    replay: function() {
      var age = 60000;

      // If the page was loaded a few moments ago, only query for recent
      // history. This keeps us from replaying events over and over again as
      // a user browses normally.

      // Allow a small margin of error for the actual page load time. It's
      // also fine to replay a notification which the user saw for a brief
      // moment on the previous page.
      var extra_time = 500;
      var now = new Date().getTime();

      age = Math.min(extra_time + (now - this._startTime), age);

      var replay = {
        age: age
      };

      JX.Leader.broadcast(null, {type: 'aphlict.replay', data: replay});
    },

    reconnect: function() {
      JX.Leader.broadcast(null, {type: 'aphlict.reconnect', data: null});
    },

    _close: function() {
      if (this._keepaliveInterval) {
        clearInterval(this._keepaliveInterval);
        this._keepaliveInterval = null;
      }

      this._broadcastStatus('closed');
    },

    _broadcastStatus: function(status) {
      JX.Leader.broadcast(null, {type: 'aphlict.status', data: status});
    },

    _message: function(raw) {
      var message = JX.JSON.parse(raw);
      var id = message.uniqueID || null;

      // If this is just a keepalive response, don't bother broadcasting it.
      if (message.type == 'pong') {
        return;
      }

      JX.Leader.broadcast(id, {type: 'aphlict.server', data: message});
    },

    _receive: function(message, is_leader) {
      switch (message.type) {
        case 'aphlict.status':
          this._setStatus(message.data);
          break;

        case 'aphlict.getstatus':
          if (is_leader) {
            this._broadcastStatus(this.getStatus());
          }
          break;

        case 'aphlict.getsubscribers':
          JX.Leader.broadcast(
            null,
            {type: 'aphlict.subscribe', data: this._subscriptions});
          break;

        case 'aphlict.subscribe':
          if (is_leader) {
            this._writeCommand('subscribe', message.data);
          }
          break;

        case 'aphlict.replay':
          if (is_leader) {
            this._writeCommand('replay', message.data);
          }
          break;

        default:
          var handler = this.getHandler();
          handler && handler(message);
          break;
      }
    },

    _setStatus: function(status) {
      this._status = status;

      // If we've ever seen an open connection, any new connection we make
      // is a reconnect and should replay history.
      if (status == 'open') {
        this._isReconnect = true;
      }

      this.invoke('didChangeStatus');
    },

    _write: function(message) {
      this._socket.send(JX.JSON.stringify(message));
    },

    _writeCommand: function(command, message) {
      var frame = {
        command: command,
        data: message
      };

      return this._write(frame);
    },

    _keepalive: function() {
      this._writeCommand('ping', null);
    }

  },

  properties: {
    handler: null
  },

  statics: {
    _instance: null,

    getInstance: function() {
      var self = JX.Aphlict;
      if (!self._instance) {
        return null;
      }
      return self._instance;
    }

  }

});


text:
//
// Copyright 2014-2015 Amazon.com,
// Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Amazon Software License (the "License").
// You may not use this file except in compliance with the
// License. A copy of the License is located at
//
//     http://aws.amazon.com/asl/
//
// or in the "license" file accompanying this file. This file is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, express or implied. See the License
// for the specific language governing permissions and
// limitations under the License.
//

/*
 * Do not modify this file. This file is generated from the dynamodb-2012-08-10.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;

using Amazon.DynamoDBv2.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.DynamoDBv2.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// Response Unmarshaller for GlobalSecondaryIndexDescription Object
    /// </summary>
    public class GlobalSecondaryIndexDescriptionUnmarshaller : IUnmarshaller<GlobalSecondaryIndexDescription, XmlUnmarshallerContext>, IUnmarshaller<GlobalSecondaryIndexDescription, JsonUnmarshallerContext>
    {
        GlobalSecondaryIndexDescription IUnmarshaller<GlobalSecondaryIndexDescription, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
        {
            throw new NotImplementedException();
        }

        public GlobalSecondaryIndexDescription Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
                return null;

            GlobalSecondaryIndexDescription unmarshalledObject = new GlobalSecondaryIndexDescription();

            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Backfilling", targetDepth))
                {
                    var unmarshaller = BoolUnmarshaller.Instance;
                    unmarshalledObject.Backfilling = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("IndexName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    unmarshalledObject.IndexName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("IndexSizeBytes", targetDepth))
                {
                    var unmarshaller = LongUnmarshaller.Instance;
                    unmarshalledObject.IndexSizeBytes = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("IndexStatus", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    unmarshalledObject.IndexStatus = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("ItemCount", targetDepth))
                {
                    var unmarshaller = LongUnmarshaller.Instance;
                    unmarshalledObject.ItemCount = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("KeySchema", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<KeySchemaElement, KeySchemaElementUnmarshaller>(KeySchemaElementUnmarshaller.Instance);
                    unmarshalledObject.KeySchema = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Projection", targetDepth))
                {
                    var unmarshaller = ProjectionUnmarshaller.Instance;
                    unmarshalledObject.Projection = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("ProvisionedThroughput", targetDepth))
                {
                    var unmarshaller = ProvisionedThroughputDescriptionUnmarshaller.Instance;
                    unmarshalledObject.ProvisionedThroughput = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return unmarshalledObject;
        }

        private static GlobalSecondaryIndexDescriptionUnmarshaller _instance = new GlobalSecondaryIndexDescriptionUnmarshaller();

        public static GlobalSecondaryIndexDescriptionUnmarshaller Instance
        {
            get
            {
                return _instance;
            }
        }
    }
}


text:
<!doctype html>

    <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">

This test passes if the image below is treated as blockable content.


text:
#include <common.h>
#include <miiphy.h>
#include <phy.h>
#include <asm/io.h>
#include <fsl_memac.h>
#include <fm_eth.h>

#ifdef CONFIG_SYS_MEMAC_LITTLE_ENDIAN
#define memac_out_32(a, v)	out_le32(a, v)
#define memac_clrbits_32(a, v)	clrbits_le32(a, v)
#define memac_setbits_32(a, v)	setbits_le32(a, v)
#else
#define memac_out_32(a, v)	out_be32(a, v)
#define memac_clrbits_32(a, v)	clrbits_be32(a, v)
#define memac_setbits_32(a, v)	setbits_be32(a, v)
#endif

static u32 memac_in_32(u32 *reg)
{
#ifdef CONFIG_SYS_MEMAC_LITTLE_ENDIAN
	return in_le32(reg);
#else
	return in_be32(reg);
#endif
}

/*
 * Write value to the PHY for this device to the register at regnum, waiting
 * until the write is done before it returns.  All PHY configuration has to be
 * done through the TSEC1 MIIM regs
 */
int memac_mdio_write(struct mii_dev *bus, int port_addr, int dev_addr,
			int regnum, u16 value)
{
	u32 mdio_ctl;
	struct memac_mdio_controller *regs = bus->priv;
	u32 c45 = 1; /* Default to 10G interface */

	if (dev_addr == MDIO_DEVAD_NONE) {
		c45 = 0; /* clause 22 */
		dev_addr = regnum & 0x1f;
		memac_clrbits_32(&regs->mdio_stat, MDIO_STAT_ENC);
	} else
		memac_setbits_32(&regs->mdio_stat, MDIO_STAT_ENC);

	/* Wait till the bus is free */
	while ((memac_in_32(&regs->mdio_stat)) & MDIO_STAT_BSY)
		;

	/* Set the port and dev addr */
	mdio_ctl = MDIO_CTL_PORT_ADDR(port_addr) | MDIO_CTL_DEV_ADDR(dev_addr);
	memac_out_32(&regs->mdio_ctl, mdio_ctl);

	/* Set the register address */
	if (c45)
		memac_out_32(&regs->mdio_addr, regnum & 0xffff);

	/* Wait till the bus is free */
	while ((memac_in_32(&regs->mdio_stat)) & MDIO_STAT_BSY)
		;

	/* Write the value to the register */
	memac_out_32(&regs->mdio_data, MDIO_DATA(value));

	/* Wait till the MDIO write is complete */
	while ((memac_in_32(&regs->mdio_data)) & MDIO_DATA_BSY)
		;

	return 0;
}

/*
 * Reads from register regnum in the PHY for device dev, returning the value.
 * Clears miimcom first.  All PHY configuration has to be done through the
 * TSEC1 MIIM regs
 */
int memac_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr,
			int regnum)
{
	u32 mdio_ctl;
	struct memac_mdio_controller *regs = bus->priv;
	u32 c45 = 1;

	if (dev_addr == MDIO_DEVAD_NONE) {
		if (!strcmp(bus->name, DEFAULT_FM_TGEC_MDIO_NAME))
			return 0xffff;
		c45 = 0; /* clause 22 */
		dev_addr = regnum & 0x1f;
		memac_clrbits_32(&regs->mdio_stat, MDIO_STAT_ENC);
	} else
		memac_setbits_32(&regs->mdio_stat, MDIO_STAT_ENC);

	/* Wait till the bus is free */
	while ((memac_in_32(&regs->mdio_stat)) & MDIO_STAT_BSY)
		;

	/* Set the Port and Device Addrs */
	mdio_ctl = MDIO_CTL_PORT_ADDR(port_addr) | MDIO_CTL_DEV_ADDR(dev_addr);
	memac_out_32(&regs->mdio_ctl, mdio_ctl);

	/* Set the register address */
	if (c45)
		memac_out_32(&regs->mdio_addr, regnum & 0xffff);

	/* Wait till the bus is free */
	while ((memac_in_32(&regs->mdio_stat)) & MDIO_STAT_BSY)
		;

	/* Initiate the read */
	mdio_ctl |= MDIO_CTL_READ;
	memac_out_32(&regs->mdio_ctl, mdio_ctl);

	/* Wait till the MDIO write is complete */
	while ((memac_in_32(&regs->mdio_data)) & MDIO_DATA_BSY)
		;

	/* Return all Fs if nothing was there */
	if (memac_in_32(&regs->mdio_stat) & MDIO_STAT_RD_ER)
		return 0xffff;

	return memac_in_32(&regs->mdio_data) & 0xffff;
}

int memac_mdio_reset(struct mii_dev *bus)
{
	return 0;
}

int fm_memac_mdio_init(bd_t *bis, struct memac_mdio_info *info)
{
	struct mii_dev *bus = mdio_alloc();

	if (!bus) {
		printf("Failed to allocate FM TGEC MDIO bus\n");
		return -1;
	}

	bus->read = memac_mdio_read;
	bus->write = memac_mdio_write;
	bus->reset = memac_mdio_reset;
	strcpy(bus->name, info->name);

	bus->priv = info->regs;

	/*
	 * On some platforms like B4860, default value of MDIO_CLK_DIV bits
	 * in mdio_stat(mdio_cfg) register generates MDIO clock too high
	 * (much higher than 2.5MHz), violating the IEEE specs.
	 * On other platforms like T1040, default value of MDIO_CLK_DIV bits
	 * is zero, so MDIO clock is disabled.
	 * So, for proper functioning of MDIO, MDIO_CLK_DIV bits needs to
	 * be properly initialized.
	 * NEG bit default should be '1' as per FMAN-v3 RM, but on platform
	 * like T2080QDS, this bit default is '0', which leads to MDIO failure
	 * on XAUI PHY, so set this bit definitely.
	 */
	memac_setbits_32(
		&((struct memac_mdio_controller *)info->regs)->mdio_stat,
		MDIO_STAT_CLKDIV(258) | MDIO_STAT_NEG);

	return mdio_register(bus);
}


text:
'use strict';

const React = require('react');
const PropTypes = require('prop-types');
const { Dimensions, Image, TouchableOpacity } = require('react-native');
const { BaseComponent, Text, View } = require('react-native-ui-lib');

import StyleSheet from '../other/StyleSheet';

const SCREEN_WIDTH = Dimensions.get('window').width;
const IOS_ITEM_TEXT_SIZE = SCREEN_WIDTH < 375 ? 10 : 13;

class ItemWrapper extends BaseComponent {
  static displayName = 'Header.ItemWrapper';

  static propTypes = {
    /**
     * item object
     */
    item: PropTypes.shape({
      title: PropTypes.string,
      icon: PropTypes.oneOfType([
        PropTypes.element,
        PropTypes.string,
        PropTypes.number,
      ]),
      iconSource: PropTypes.any,
      layout: PropTypes.oneOf(['default', 'both', 'icon', 'title']),
      onPress: PropTypes.func,
      style: PropTypes.oneOfType([
        PropTypes.object,
        PropTypes.number,
        PropTypes.array,
      ]),
    }),
    /**
     * item color
     */
    color: PropTypes.string,
    /**
     * item size
     */
    size: PropTypes.number,
  };

  static defaultProps = {
    size: 30,
  };

  generateStyles() {
    this.styles = createStyles(this.props);
  }

  render() {
    const { item, color, size } = this.props;
    if (!item) {
      return null;
    }

    let content;
    const { title, icon, iconSource, layout, onPress, style } = item;

    if (layout !== 'icon' && title) {
      content = (
        <Text text90 style={[this.styles.itemText, { color }, style]}>
          {title.toUpperCase()}
        </Text>
      );
    } else if (layout === 'both' && title && icon) {
      if (React.isValidElement(icon)) {
        content = icon;
      } else if (typeof icon === 'string') {
        const Icon = iconSource;
        content = <Icon name={icon} color={color} size={size} />;
      } else {
        content = <Image source={icon} style={[{ tintColor: color }, style]} />;
      }
      content = (
        <View style={this.styles.itemGroup}>
          {content}
          <Text
            text90
            style={[this.styles.itemText, { color, paddingLeft: 5 }]}
          >
            {title.toUpperCase()}
          </Text>
        </View>
      );
    } else if (icon) {
      if (React.isValidElement(icon)) {
        content = icon;
      } else if (typeof icon === 'string') {
        const Icon = iconSource;
        content = <Icon name={icon} color={color} size={size} />;
      } else {
        content = <Image source={icon} style={[{ tintColor: color }, style]} />;
      }
    }

    return (
      <TouchableOpacity
        accessibilityLabel={title}
        accessibilityTraits="button"
        onPress={onPress}
        style={this.styles.itemWrapper}
      >
        {content}
      </TouchableOpacity>
    );
  }
}

function createStyles() {
  return StyleSheet.create({
    itemWrapper: {
      padding: 5,
    },
    itemGroup: {
      flexDirection: 'row',
      // alignItems: 'center',
    },
    itemText: {
      alignSelf: 'center',
      letterSpacing: 1,
      fontWeight: '500',
      ios: {
        fontSize: IOS_ITEM_TEXT_SIZE,
      },
    },
  });
}

module.exports = ItemWrapper;


text:
package org.apache.accumulo.shell;

import java.io.File;
import java.io.FileNotFoundException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Scanner;

import org.apache.commons.codec.binary.Base64;
import org.apache.hadoop.io.Text;

import com.google.common.collect.Lists;

public class ShellUtil {

  /**
   * Scans the given file line-by-line (ignoring empty lines) and returns a list containing those lines. If decode is set to true, every line is decoded using
   * {@link Base64#decodeBase64(byte[])} from the UTF-8 bytes of that line before inserting in the list.
   *
   * @param filename
   *          Path to the file that needs to be scanned
   * @param decode
   *          Whether to decode lines in the file
   * @return List of {@link Text} objects containing data in the given file
   * @throws FileNotFoundException
   *           if the given file doesn't exist
   */
  public static List<Text> scanFile(String filename, boolean decode) throws FileNotFoundException {
    String line;
    Scanner file = new Scanner(new File(filename), StandardCharsets.UTF_8.name());
    List<Text> result = Lists.newArrayList();
    try {
      while (file.hasNextLine()) {
        line = file.nextLine();
        if (!line.isEmpty()) {
          result.add(decode ? new Text(Base64.decodeBase64(line.getBytes(StandardCharsets.UTF_8))) : new Text(line));
        }
      }
    } finally {
      file.close();
    }
    return result;
  }
}


text:
package resource

// DocumentBuilder, ObjectsBuilder, and ObjectList satisfy this interface,
// which allows for either one object or multiple objects to be added depending on the context.
type IBuildObjects interface {
	NewObject(id, class string) *Object
	AddObject(obj *Object)
}

type ObjectBuilder struct {
	Object *Object
}

func (o *ObjectBuilder) NewObject(id, class string) *Object {
	obj := NewObject(id, class)
	o.AddObject(obj)
	return obj
}

func (o *ObjectBuilder) AddObject(obj *Object) {
	o.Object = obj
}


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/gpu/chromeos/image_processor_factory.h"

#include <stddef.h>

#include "base/bind.h"
#include "base/callback.h"
#include "base/containers/contains.h"
#include "base/memory/scoped_refptr.h"
#include "media/base/video_types.h"
#include "media/gpu/buildflags.h"
#include "media/gpu/chromeos/libyuv_image_processor_backend.h"
#include "media/gpu/macros.h"

#if BUILDFLAG(USE_VAAPI)
#include "media/gpu/vaapi/vaapi_image_processor_backend.h"
#include "media/gpu/vaapi/vaapi_wrapper.h"
#endif  // BUILDFLAG(USE_VAAPI)

#if BUILDFLAG(USE_V4L2_CODEC)
#include "media/gpu/v4l2/v4l2_device.h"
#include "media/gpu/v4l2/v4l2_image_processor_backend.h"
#include "media/gpu/v4l2/v4l2_vda_helpers.h"
#endif  // BUILDFLAG(USE_V4L2_CODEC)

namespace media {

namespace {

#if BUILDFLAG(USE_VAAPI)
std::unique_ptr<ImageProcessor> CreateVaapiImageProcessorWithInputCandidates(
    const std::vector<std::pair<Fourcc, gfx::Size>>& input_candidates,
    const gfx::Rect& input_visible_rect,
    const gfx::Size& output_size,
    scoped_refptr<base::SequencedTaskRunner> client_task_runner,
    ImageProcessorFactory::PickFormatCB out_format_picker,
    ImageProcessor::ErrorCB error_cb) {
  std::vector<Fourcc> vpp_supported_formats =
      VaapiWrapper::GetVppSupportedFormats();
  absl::optional<std::pair<Fourcc, gfx::Size>> chosen_input_candidate;
  for (const auto& input_candidate : input_candidates) {
    if (base::Contains(vpp_supported_formats, input_candidate.first) &&
        VaapiWrapper::IsVppResolutionAllowed(input_candidate.second)) {
      chosen_input_candidate = input_candidate;
      break;
    }
  }
  if (!chosen_input_candidate)
    return nullptr;

  // Note that we pick the first input candidate as the preferred output format.
  // The reason is that in practice, the VaapiVideoDecoder will make
  // |input_candidates| either {NV12} or {P010} depending on the bitdepth. So
  // choosing the first (and only) element will keep the bitdepth of the frame
  // which is needed to display HDR content.
  auto chosen_output_format =
      out_format_picker.Run(/*candidates=*/vpp_supported_formats,
                            /*preferred_fourcc=*/input_candidates[0].first);
  if (!chosen_output_format)
    return nullptr;

  // Note: the VaapiImageProcessorBackend doesn't use the ColorPlaneLayouts in
  // the PortConfigs, so we just pass an empty list of plane layouts.
  ImageProcessor::PortConfig input_config(
      /*fourcc=*/chosen_input_candidate->first,
      /*size=*/chosen_input_candidate->second, /*planes=*/{},
      input_visible_rect, {VideoFrame::STORAGE_GPU_MEMORY_BUFFER});
  ImageProcessor::PortConfig output_config(
      /*fourcc=*/*chosen_output_format, /*size=*/output_size, /*planes=*/{},
      /*visible_rect=*/gfx::Rect(output_size),
      {VideoFrame::STORAGE_GPU_MEMORY_BUFFER});
  return ImageProcessor::Create(
      base::BindRepeating(&VaapiImageProcessorBackend::Create), input_config,
      output_config, {ImageProcessor::OutputMode::IMPORT}, VIDEO_ROTATION_0,
      std::move(error_cb), std::move(client_task_runner));
}
#endif  // BUILDFLAG(USE_VAAPI)

#if BUILDFLAG(USE_V4L2_CODEC)
std::unique_ptr<ImageProcessor> CreateV4L2ImageProcessorWithInputCandidates(
    const std::vector<std::pair<Fourcc, gfx::Size>>& input_candidates,
    const gfx::Size& visible_size,
    size_t num_buffers,
    scoped_refptr<base::SequencedTaskRunner> client_task_runner,
    ImageProcessorFactory::PickFormatCB out_format_picker,
    ImageProcessor::ErrorCB error_cb) {
  // Pick a renderable output format, and try each available input format.
  // TODO(akahuang): let |out_format_picker| return a list of supported output
  // formats, and try all combination of input/output format, if any platform
  // fails to create ImageProcessor via current approach.
  const std::vector<uint32_t> supported_output_formats =
      V4L2ImageProcessorBackend::GetSupportedOutputFormats();
  std::vector<Fourcc> supported_fourccs;
  for (const auto& format : supported_output_formats) {
    const auto fourcc = Fourcc::FromV4L2PixFmt(format);
    if (fourcc.has_value())
      supported_fourccs.push_back(*fourcc);
  }

  const auto output_fourcc = out_format_picker.Run(
      /*candidates=*/supported_fourccs, /*preferred_fourcc=*/absl::nullopt);
  if (!output_fourcc)
    return nullptr;

  const auto supported_input_pixfmts =
      V4L2ImageProcessorBackend::GetSupportedInputFormats();
  for (const auto& input_candidate : input_candidates) {
    const Fourcc input_fourcc = input_candidate.first;
    const gfx::Size& input_size = input_candidate.second;

    if (!base::Contains(supported_input_pixfmts, input_fourcc.ToV4L2PixFmt()))
      continue;

    // Try to get an image size as close as possible to the final size.
    gfx::Size output_size = visible_size;
    size_t num_planes = 0;
    if (!V4L2ImageProcessorBackend::TryOutputFormat(
            input_fourcc.ToV4L2PixFmt(), output_fourcc->ToV4L2PixFmt(),
            input_size, &output_size, &num_planes)) {
      VLOGF(2) << "Failed to get output size and plane count of IP";
      continue;
    }

    return v4l2_vda_helpers::CreateImageProcessor(
        input_fourcc, *output_fourcc, input_size, output_size, visible_size,
        VideoFrame::StorageType::STORAGE_GPU_MEMORY_BUFFER, num_buffers,
        V4L2Device::Create(), ImageProcessor::OutputMode::IMPORT,
        std::move(client_task_runner), std::move(error_cb));
  }
  return nullptr;
}
#endif  // BUILDFLAG(USE_V4L2_CODEC)

}  // namespace

// static
std::unique_ptr<ImageProcessor> ImageProcessorFactory::Create(
    const ImageProcessor::PortConfig& input_config,
    const ImageProcessor::PortConfig& output_config,
    const std::vector<ImageProcessor::OutputMode>& preferred_output_modes,
    size_t num_buffers,
    VideoRotation relative_rotation,
    scoped_refptr<base::SequencedTaskRunner> client_task_runner,
    ImageProcessor::ErrorCB error_cb) {
  std::vector<ImageProcessor::CreateBackendCB> create_funcs;
#if BUILDFLAG(USE_VAAPI)
  create_funcs.push_back(
      base::BindRepeating(&VaapiImageProcessorBackend::Create));
#elif BUILDFLAG(USE_V4L2_CODEC)
  create_funcs.push_back(base::BindRepeating(
      &V4L2ImageProcessorBackend::Create, V4L2Device::Create(), num_buffers));
#endif  // BUILDFLAG(USE_V4L2_CODEC)
  create_funcs.push_back(
      base::BindRepeating(&LibYUVImageProcessorBackend::Create));

  std::unique_ptr<ImageProcessor> image_processor;
  for (auto& create_func : create_funcs) {
    image_processor =
        ImageProcessor::Create(std::move(create_func), input_config,
                               output_config, preferred_output_modes,
                               relative_rotation, error_cb, client_task_runner);
    if (image_processor)
      return image_processor;
  }
  return nullptr;
}

// static
std::unique_ptr<ImageProcessor>
ImageProcessorFactory::CreateWithInputCandidates(
    const std::vector<std::pair<Fourcc, gfx::Size>>& input_candidates,
    const gfx::Rect& input_visible_rect,
    const gfx::Size& output_size,
    size_t num_buffers,
    scoped_refptr<base::SequencedTaskRunner> client_task_runner,
    PickFormatCB out_format_picker,
    ImageProcessor::ErrorCB error_cb) {
#if BUILDFLAG(USE_VAAPI)
  auto processor = CreateVaapiImageProcessorWithInputCandidates(
      input_candidates, input_visible_rect, output_size, client_task_runner,
      out_format_picker, error_cb);
  if (processor)
    return processor;
#elif BUILDFLAG(USE_V4L2_CODEC)
  // TODO(andrescj): we need to pass the |input_visible_rect| along for the V4L2
  // ImageProcessor.
  auto processor = CreateV4L2ImageProcessorWithInputCandidates(
      input_candidates, output_size, num_buffers, client_task_runner,
      out_format_picker, error_cb);
  if (processor)
    return processor;
#endif  // BUILDFLAG(USE_V4L2_CODEC)

  // TODO(crbug.com/1004727): Implement LibYUVImageProcessorBackend. When doing
  // so, we must keep in mind that it might not be desirable to fallback to
  // libyuv if the hardware image processor fails (e.g., in the case of
  // protected content).
  return nullptr;
}

}  // namespace media


text:
 * id_connections:
    * lang: false
    * shop: false
    * validator: none
    * required: true
    * size: undefined
 * http_referer:
    * lang: false
    * shop: false
    * validator: none
    * required: false
    * size: undefined
 * request_uri:
    * lang: false
    * shop: false
    * validator: none
    * required: false
    * size: undefined
 * keywords:
    * lang: false
    * shop: false
    * validator: none
    * required: false
    * size: undefined
 * date_add:
    * lang: false
    * shop: false
    * validator: none
    * required: true
    * size: undefined


text:
require "spec_helper"

describe CC::Yaml::Parser::Psych do
  specify "emits error when no engines or languages key is found" do
    yaml = <<-YAML
    exclude_paths:
      - "*.rb"
      - "test/*"
    YAML
    config = CC::Yaml.parse yaml
    config.errors.must_include CC::Yaml::Parser::Psych::NO_ANALYSIS_KEY_FOUND_ERROR
  end

  specify "does not emit no-key error if other errors occurred" do
    yaml = <<-YAML
    engines:
    exclude_paths:
      - "*.rb"
      - "test/*"
    YAML
    config = CC::Yaml.parse yaml
    config.errors.count.must_be :>, 0
    config.errors.wont_include CC::Yaml::Parser::Psych::NO_ANALYSIS_KEY_FOUND_ERROR
  end

  specify "does not emit any errors for valid input" do
    yaml = <<-YAML
    engines:
      rubocop:
        enabled: true
    exclude_paths:
      - "*.rb"
      - "test/*"
    YAML
    config = CC::Yaml.parse yaml
    config.errors.count.must_equal 0
  end
end


text:
#ifndef PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_
#define PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_

#include <pcl/common/common.h>
#include <pcl/filters/uniform_sampling.h>

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT> void
pcl::UniformSampling<PointT>::applyFilter (PointCloud &output)
{
  // Has the input dataset been set already?
  if (!input_)
  {
    PCL_WARN ("[pcl::%s::detectKeypoints] No input dataset given!\n", getClassName ().c_str ());
    output.width = output.height = 0;
    output.points.clear ();
    return;
  }

  output.height       = 1;                    // downsampling breaks the organized structure
  output.is_dense     = true;                 // we filter out invalid points

  Eigen::Vector4f min_p, max_p;
  // Get the minimum and maximum dimensions
  pcl::getMinMax3D<PointT>(*input_, min_p, max_p);

  // Compute the minimum and maximum bounding box values
  min_b_[0] = static_cast<int> (floor (min_p[0] * inverse_leaf_size_[0]));
  max_b_[0] = static_cast<int> (floor (max_p[0] * inverse_leaf_size_[0]));
  min_b_[1] = static_cast<int> (floor (min_p[1] * inverse_leaf_size_[1]));
  max_b_[1] = static_cast<int> (floor (max_p[1] * inverse_leaf_size_[1]));
  min_b_[2] = static_cast<int> (floor (min_p[2] * inverse_leaf_size_[2]));
  max_b_[2] = static_cast<int> (floor (max_p[2] * inverse_leaf_size_[2]));

  // Compute the number of divisions needed along all axis
  div_b_ = max_b_ - min_b_ + Eigen::Vector4i::Ones ();
  div_b_[3] = 0;

  // Clear the leaves
  leaves_.clear ();

  // Set up the division multiplier
  divb_mul_ = Eigen::Vector4i (1, div_b_[0], div_b_[0] * div_b_[1], 0);

  // First pass: build a set of leaves with the point index closest to the leaf center
  for (size_t cp = 0; cp < indices_->size (); ++cp)
  {
    if (!input_->is_dense)
      // Check if the point is invalid
      if (!pcl_isfinite (input_->points[(*indices_)[cp]].x) ||
          !pcl_isfinite (input_->points[(*indices_)[cp]].y) ||
          !pcl_isfinite (input_->points[(*indices_)[cp]].z))
        continue;

    Eigen::Vector4i ijk = Eigen::Vector4i::Zero ();
    ijk[0] = static_cast<int> (floor (input_->points[(*indices_)[cp]].x * inverse_leaf_size_[0]));
    ijk[1] = static_cast<int> (floor (input_->points[(*indices_)[cp]].y * inverse_leaf_size_[1]));
    ijk[2] = static_cast<int> (floor (input_->points[(*indices_)[cp]].z * inverse_leaf_size_[2]));

    // Compute the leaf index
    int idx = (ijk - min_b_).dot (divb_mul_);
    Leaf& leaf = leaves_[idx];
    // First time we initialize the index
    if (leaf.idx == -1)
    {
      leaf.idx = (*indices_)[cp];
      continue;
    }

    // Check to see if this point is closer to the leaf center than the previous one we saved
    float diff_cur   = (input_->points[(*indices_)[cp]].getVector4fMap () - ijk.cast<float> ()).squaredNorm ();
    float diff_prev  = (input_->points[leaf.idx].getVector4fMap ()        - ijk.cast<float> ()).squaredNorm ();

    // If current point is closer, copy its index instead
    if (diff_cur < diff_prev)
      leaf.idx = (*indices_)[cp];
  }

  // Second pass: go over all leaves and copy data
  output.points.resize (leaves_.size ());
  int cp = 0;

  for (typename boost::unordered_map<size_t, Leaf>::const_iterator it = leaves_.begin (); it != leaves_.end (); ++it)
    output.points[cp++] = input_->points[it->second.idx];
  output.width = static_cast<uint32_t> (output.points.size ());
}

#define PCL_INSTANTIATE_UniformSampling(T) template class PCL_EXPORTS pcl::UniformSampling<T>;

#endif    // PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_


text:
use std::io;
use std::io::prelude::*;

use super::super::config::Config;
use super::super::helpers::path::build_path;
use super::super::helpers::oauth2;
use super::super::helpers::providers;
use super::super::results::{BearerResult, BearerError};

fn read_stdin(message: &str) -> BearerResult<String> {
    print!("{}", message);
    io::stdout().flush().unwrap();

    let mut buffer = String::new();
    match io::stdin().read_line(&mut buffer) {
        Ok(_) => Ok(buffer.trim().to_string()),
        Err(err) => Err(BearerError::IOError(format!("{}", err))),
    }
}

pub fn command(config_dir: &str, client_name: &str) -> BearerResult<()> {

    debug!("Registering new client {} in directory {}",
           client_name,
           config_dir);
    let (_, exists) = build_path(config_dir, client_name)?;
    if exists {
        return Err(BearerError::ValueError(format!("Client {} already registered", client_name)));
    }
    println!("Before continue, register the a client with the following url to the OAuth2 \
              Provider:");
    println!("");
    println!("http://localhost:6750/callback");
    println!("");
    println!("Ensure your port is not already open by another service.");
    println!("If the provider require a https url, please run an https reverse proxy before \
              continue.");
    println!("");
    let mut provider_name = read_stdin("Enter the OAuth2.0 Provider Name: ")?;

    let (authorize_url, token_url) = match providers::get_provider(&provider_name) {
        Some(provider) => {
            provider_name = provider.name.to_string();
            (provider.authorize_url.to_string(), provider.token_url.to_string())
        }
        None => {
            let authorize_url = read_stdin("Enter the OAuth2.0 Authorize Url: ")?;
            let token_url = read_stdin("Enter the OAuth2.0 Token Url: ")?;
            (authorize_url, token_url)
        }
    };
    let client_id = read_stdin("Enter the Client Id: ")?;
    let secret = read_stdin("Enter the Client Secret: ")?;
    let scope = read_stdin("Enter the scope (optional): ")?;

    let mut conf = Config::new(config_dir,
                               client_name,
                               provider_name.as_str(),
                               authorize_url.as_str(),
                               token_url.as_str(),
                               client_id.as_str(),
                               secret.as_str(),
                               match scope.len() {
                                   0 => None,
                                   _ => Some(scope.as_str()),
                               })?;

    println!("");
    println!("Visit to finish the configuration: http://localhost:6750/callback");

    debug!("Start server to retrieve tokens");
    let tokens = oauth2::get_tokens(&conf, 6750)?;
    debug!("Token retrieved: {:?}", tokens);
    conf.set_tokens(tokens);
    conf.write()?;
    println!("Tokens retrieved succesfully");
    Ok(())
}


text:
package org.apache.lucene.queries.function.valuesource;

import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;

/**
 * MinFloatFunction returns the min of it's components.
 */
public class MinFloatFunction extends MultiFloatFunction {
  public MinFloatFunction(ValueSource[] sources) {
    super(sources);
  }

  @Override
  protected String name() {
    return "min";
  }

  @Override
  protected float func(int doc, FunctionValues[] valsArr) {
    if (valsArr.length == 0) return 0.0f;
    float val = Float.POSITIVE_INFINITY;
    for (FunctionValues vals : valsArr) {
      val = Math.min(vals.floatVal(doc), val);
    }
    return val;
  }
}


text:
***********
Development
***********
.. _github: http://github.com/alisaifee/holmium.core/
.. _issue tracker: http://github.com/alisaifee/holmium.core/issues
.. _github actions: https://github.com/alisaifee/holmium.core/actions?query=workflow%3ACI
.. _develop: http://pythonhosted.org/distribute/setuptools.html#development-mode
.. _chromedriver page: https://chromedriver.chromium.org/getting-started

Contributors
============
.. include:: ../../CONTRIBUTORS.rst

Project Resources
=================
Continuous Integration
    The project is being continuously built using `github actions`_ against
    python 2.7, 3.5, 3.7 & 3.8

Code
    The code is hosted on `github`_.

Bugs, Feature Requests
    Tracked at the `issue tracker`_.

Installation
============

.. note::

   Holmium is tested and supported on pythons version 2.7 & 3.5+.

The stable version can be installed either via ``pip`` or ``easy_install``.

.. code-block:: bash

    pip install holmium.core
    # or
    easy_install holmium.core

To use holmium.core directly from source the preferred method is to use the
`develop`_ mode. This will make :mod:`holmium.core` available on your `PATH`,
but will point to the checkout. Any updates made in the checkout will be available
in the *installed* version.

.. code-block:: bash

    git clone git@github.com:alisaifee/holmium.core
    cd holmium.core
    sudo python setup.py develop

Tests
=====
:mod:`holmium.core` uses ``nosetests`` for running its tests. You will also
need ``chromedriver`` installed to run certain tests that make more sense without
mocking. For instructions on installing ``chromedriver`` go to the `chromedriver page`_.

.. code-block:: bash

    cd holmium.core
    nosetests --with-coverage --cover-html --cover-erase --cover-package=holmium.core


text:
import test from 'ava'
import { connect } from '../../src'

const db = connect(':memory:')

test.before(async () => {
  const tests = await db.model('tests', {
    id: 'increments',
    item: String
  }, {
    timestamps: true
  })

  await tests.create({
    item: 'test'
  })
})

test.after.always(() => db.close())

test('timestamp fields are available on created objects', async t => {
  const found = await db.findOne('tests', { item: 'test' })
  t.true(found.created_at instanceof Date)
  t.true(found.updated_at instanceof Date)
})


text:
using Huyn.PluralNet;
using Huyn.PluralNet.Interfaces;
using Huyn.PluralNet.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Huyn.PluralNet.Providers
{
    public class IcelandicProvider : IPluralProvider
    {
        public PluralTypeEnum ComputePlural(decimal n)
        {
            if (n.IsInt())
            {
                var integer = (int)n;
                if (integer % 10 == 1 && integer % 100 != 11)
                {
                    return PluralTypeEnum.ONE;
                }
                return PluralTypeEnum.OTHER;
            }
            else
            {
                return PluralTypeEnum.ONE;
            }

        }
    }
}


text:
import * as React from "react"

interface OutboundLinkProps {
  onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void
}

export class OutboundLink extends React.Component<
  OutboundLinkProps & React.HTMLProps<HTMLAnchorElement>,
  any
> {}


text:
module Asposeslidesjava
  module FormattingChartEntities
    def initialize()
        data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

        # Instantiate Presentation class that represents the presentation file
        pres = Rjb::import('com.aspose.slides.Presentation').new

        # Accessing the first slide
        slide = pres.getSlides().get_Item(0)

        # Adding the sample chart
        chart = slide.getShapes().addChart(Rjb::import('com.aspose.slides.ChartType').LineWithMarkers, 50, 50, 500, 400)

        # Setting Chart Titile
        chart.hasTitle(true)
        chart.getChartTitle().addTextFrameForOverriding("")
        chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0)
        chartTitle.setText("Sample Chart")
        chartTitle.getPortionFormat().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').GRAY)
        chartTitle.getPortionFormat().setFontHeight (20)
        chartTitle.getPortionFormat().setFontBold(Rjb::import('com.aspose.slides.NullableBool').True)
        chartTitle.getPortionFormat().setFontItalic(Rjb::import('com.aspose.slides.NullableBool').True)

        # Setting Major grid lines format for value axis
        chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').BLUE)
        chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5)
        chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(Rjb::import('com.aspose.slides.LineDashStyle').DashDot)

        # Setting Minor grid lines format for value axis
        chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').RED)
        chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3)

        # Setting value axis number format
        chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource(false)
        chart.getAxes().getVerticalAxis().setDisplayUnit(Rjb::import('com.aspose.slides.DisplayUnitType').Thousands)
        chart.getAxes().getVerticalAxis().setNumberFormat("0.0%")

        # Setting chart maximum, minimum values
        chart.getAxes().getVerticalAxis().isAutomaticMajorUnit(false)
        chart.getAxes().getVerticalAxis().isAutomaticMaxValue(false)
        chart.getAxes().getVerticalAxis().isAutomaticMinorUnit(false)
        chart.getAxes().getVerticalAxis().isAutomaticMinValue(false)

        chart.getAxes().getVerticalAxis().setMaxValue(15)
        chart.getAxes().getVerticalAxis().setMinValue(-2)
        chart.getAxes().getVerticalAxis().setMinorUnit(0.5)
        chart.getAxes().getVerticalAxis().setMajorUnit(2.0)

        # Setting Value Axis Text Properties
        txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat()
        txtVal.setFontBold(Rjb::import('com.aspose.slides.NullableBool').True)
        txtVal.setFontHeight(16)
        txtVal.setFontItalic(Rjb::import('com.aspose.slides.NullableBool').True)
        txtVal.getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        txtVal.getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').new(Rjb::import('com.aspose.slides.PresetColor').DarkGreen))
        txtVal.setLatinFont(Rjb::import('com.aspose.slides.FontData').new("Times New Roman"))

        # Setting value axis title
        chart.getAxes().getVerticalAxis().hasTitle(true)
        chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding("")
        valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0)
        valtitle.setText("Primary Axis")
        valtitle.getPortionFormat().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').GRAY)
        valtitle.getPortionFormat().setFontHeight(20)
        valtitle.getPortionFormat().setFontBold(Rjb::import('com.aspose.slides.NullableBool').True)
        valtitle.getPortionFormat().setFontItalic(Rjb::import('com.aspose.slides.NullableBool').True)

        # Setting Major grid lines format for Category axis
        chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').GREEN)
        chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5)

        # Setting Minor grid lines format for Category axis
        chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').YELLOW)
        chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3)

        #Setting Category Axis Text Properties
        txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat()
        txtCat.setFontBold(Rjb::import('com.aspose.slides.NullableBool').True)
        txtCat.setFontHeight(16)
        txtCat.setFontItalic(Rjb::import('com.aspose.slides.NullableBool').True)
        txtCat.getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        txtCat.getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').BLUE)
        txtCat.setLatinFont(Rjb::import('com.aspose.slides.FontData').new("Arial"))

        # Setting Category Titile
        chart.getAxes().getHorizontalAxis().hasTitle(true)
        chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding("")

        catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0)
        catTitle.setText("Sample Category")
        catTitle.getPortionFormat().getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').GRAY)
        catTitle.getPortionFormat().setFontHeight(20)
        catTitle.getPortionFormat().setFontBold(Rjb::import('com.aspose.slides.NullableBool').True)
        catTitle.getPortionFormat().setFontItalic(Rjb::import('com.aspose.slides.NullableBool').True)

        # Setting category axis lable position
        chart.getAxes().getHorizontalAxis().setTickLabelPosition(Rjb::import('com.aspose.slides.TickLabelPositionType').Low)

        # Setting category axis lable rotation angle
        chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45)

        # Setting Legends Text Properties
        txtleg = chart.getLegend().getTextFormat().getPortionFormat()
        txtleg.setFontBold(Rjb::import('com.aspose.slides.NullableBool').True)
        txtleg.setFontHeight(16)
        txtleg.setFontItalic(Rjb::import('com.aspose.slides.NullableBool').True)
        txtleg.getFillFormat().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        txtleg.getFillFormat().getSolidFillColor().setColor(Rjb::import('java.awt.Color').new(Rjb::import('com.aspose.slides.PresetColor').DarkRed))

        # Set show chart legends without overlapping chart
        chart.getLegend().setOverlay(true)
        #chart.ChartData.Series[0].PlotOnSecondAxis=true;
        chart.getChartData().getSeries().get_Item(0).setPlotOnSecondAxis(true)

        # Setting secondary value axis
        chart.getAxes().getSecondaryVerticalAxis().isVisible(true)
        chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setStyle(Rjb::import('com.aspose.slides.LineStyle').ThickBetweenThin)
        chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setWidth(20)

        # Setting secondary value axis Number format
        chart.getAxes().getSecondaryVerticalAxis().isNumberFormatLinkedToSource(false)
        chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(Rjb::import('com.aspose.slides.DisplayUnitType').Hundreds)
        chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%")

        # Setting chart maximum, minimum values
        chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit(false)
        chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue(false)
        chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit(false)
        chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue(false)

        chart.getAxes().getSecondaryVerticalAxis().setMaxValue(20)
        chart.getAxes().getSecondaryVerticalAxis().setMinValue(-5)
        chart.getAxes().getSecondaryVerticalAxis().setMinorUnit(0.5)
        chart.getAxes().getSecondaryVerticalAxis().setMajorUnit(2.0)

        # Setting chart back wall color
        chart.getBackWall().setThickness(1)
        chart.getBackWall().getFormat().getFill().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(Rjb::import('java.awt.Color').ORANGE)

        chart.getFloor().getFormat().getFill().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getFloor().getFormat().getFill().getSolidFillColor().setColor(Rjb::import('java.awt.Color').RED)

        # Setting Plot area color
        chart.getPlotArea().getFormat().getFill().setFillType(Rjb::import('com.aspose.slides.FillType').Solid)
        chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(Rjb::import('java.awt.Color').new(Rjb::import('com.aspose.slides.PresetColor').LightCyan))

        # Save Presentation
        pres.save(data_dir + "FormattedChart.pptx", Rjb::import('com.aspose.slides.SaveFormat').Pptx)

        puts "Formatted chart entities, please check the output file."
    end
  end
end


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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Requested by Google Analytics -->

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity
            android:name="com.example.fragmentor.app.ArticleDetailActivity"
            android:label="@string/title_article_detail"
            android:parentActivityName=".MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity" />
        </activity>

        <service
            android:name="com.example.fragmentor.app.service.RssDownloadService"
            android:icon="@drawable/ic_launcher"
            android:label="Rss download service" >
        </service>

    </application>

</manifest>