text:
/* eslint no-undef: 'error' */
/* eslint no-param-reassign: ["error", { "props": false }] */
import moment from 'moment';
import { t, SupersetClient } from '@superset-ui/core';
import { getControlsState } from 'src/explore/store';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
import {
  getAnnotationJsonUrl,
  getExploreUrl,
  getLegacyEndpointType,
  buildV1ChartDataPayload,
  postForm,
  shouldUseLegacyApi,
  getChartDataUri,
} from 'src/explore/exploreUtils';
import {
  requiresQuery,
  ANNOTATION_SOURCE_TYPES,
} from 'src/modules/AnnotationTypes';

import { addDangerToast } from 'src/components/MessageToasts/actions';
import { logEvent } from 'src/logger/actions';
import { Logger, LOG_ACTIONS_LOAD_CHART } from 'src/logger/LogUtils';
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import { allowCrossDomain as domainShardingEnabled } from 'src/utils/hostNamesConfig';
import { updateDataMask } from 'src/dataMask/actions';
import { waitForAsyncData } from 'src/middleware/asyncEvent';

export const CHART_UPDATE_STARTED = 'CHART_UPDATE_STARTED';
export function chartUpdateStarted(queryController, latestQueryFormData, key) {
  return {
    type: CHART_UPDATE_STARTED,
    queryController,
    latestQueryFormData,
    key,
  };
}

export const CHART_UPDATE_SUCCEEDED = 'CHART_UPDATE_SUCCEEDED';
export function chartUpdateSucceeded(queriesResponse, key) {
  return { type: CHART_UPDATE_SUCCEEDED, queriesResponse, key };
}

export const CHART_UPDATE_STOPPED = 'CHART_UPDATE_STOPPED';
export function chartUpdateStopped(key) {
  return { type: CHART_UPDATE_STOPPED, key };
}

export const CHART_UPDATE_FAILED = 'CHART_UPDATE_FAILED';
export function chartUpdateFailed(queriesResponse, key) {
  return { type: CHART_UPDATE_FAILED, queriesResponse, key };
}

export const CHART_RENDERING_FAILED = 'CHART_RENDERING_FAILED';
export function chartRenderingFailed(error, key, stackTrace) {
  return { type: CHART_RENDERING_FAILED, error, key, stackTrace };
}

export const CHART_RENDERING_SUCCEEDED = 'CHART_RENDERING_SUCCEEDED';
export function chartRenderingSucceeded(key) {
  return { type: CHART_RENDERING_SUCCEEDED, key };
}

export const REMOVE_CHART = 'REMOVE_CHART';
export function removeChart(key) {
  return { type: REMOVE_CHART, key };
}

export const ANNOTATION_QUERY_SUCCESS = 'ANNOTATION_QUERY_SUCCESS';
export function annotationQuerySuccess(annotation, queryResponse, key) {
  return { type: ANNOTATION_QUERY_SUCCESS, annotation, queryResponse, key };
}

export const ANNOTATION_QUERY_STARTED = 'ANNOTATION_QUERY_STARTED';
export function annotationQueryStarted(annotation, queryController, key) {
  return { type: ANNOTATION_QUERY_STARTED, annotation, queryController, key };
}

export const ANNOTATION_QUERY_FAILED = 'ANNOTATION_QUERY_FAILED';
export function annotationQueryFailed(annotation, queryResponse, key) {
  return { type: ANNOTATION_QUERY_FAILED, annotation, queryResponse, key };
}

export const DYNAMIC_PLUGIN_CONTROLS_READY = 'DYNAMIC_PLUGIN_CONTROLS_READY';
export const dynamicPluginControlsReady = () => (dispatch, getState) => {
  const state = getState();
  const controlsState = getControlsState(
    state.explore,
    state.explore.form_data,
  );
  dispatch({
    type: DYNAMIC_PLUGIN_CONTROLS_READY,
    key: controlsState.slice_id.value,
    controlsState,
  });
};

const legacyChartDataRequest = async (
  formData,
  resultFormat,
  resultType,
  force,
  method = 'POST',
  requestParams = {},
) => {
  const endpointType = getLegacyEndpointType({ resultFormat, resultType });
  const allowDomainSharding =
    // eslint-disable-next-line camelcase
    domainShardingEnabled && requestParams?.dashboard_id;
  const url = getExploreUrl({
    formData,
    endpointType,
    force,
    allowDomainSharding,
    method,
    requestParams: requestParams.dashboard_id
      ? { dashboard_id: requestParams.dashboard_id }
      : {},
  });
  const querySettings = {
    ...requestParams,
    url,
    postPayload: { form_data: formData },
  };

  const clientMethod =
    'GET' && isFeatureEnabled(FeatureFlag.CLIENT_CACHE)
      ? SupersetClient.get
      : SupersetClient.post;
  return clientMethod(querySettings).then(({ json, response }) =>
    // Make the legacy endpoint return a payload that corresponds to the
    // V1 chart data endpoint response signature.
    ({
      response,
      json: { result: [json] },
    }),
  );
};

const v1ChartDataRequest = async (
  formData,
  resultFormat,
  resultType,
  force,
  requestParams,
  setDataMask,
  ownState,
) => {
  const payload = buildV1ChartDataPayload({
    formData,
    resultType,
    resultFormat,
    force,
    setDataMask,
    ownState,
  });

  // The dashboard id is added to query params for tracking purposes
  const { slice_id: sliceId } = formData;
  const { dashboard_id: dashboardId } = requestParams;

  const qs = {};
  if (sliceId !== undefined) qs.form_data = `{"slice_id":${sliceId}}`;
  if (dashboardId !== undefined) qs.dashboard_id = dashboardId;
  if (force !== false) qs.force = force;

  const allowDomainSharding =
    // eslint-disable-next-line camelcase
    domainShardingEnabled && requestParams?.dashboard_id;
  const url = getChartDataUri({
    path: '/api/v1/chart/data',
    qs,
    allowDomainSharding,
  }).toString();

  const querySettings = {
    ...requestParams,
    url,
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(payload),
  };

  return SupersetClient.post(querySettings);
};

export async function getChartDataRequest({
  formData,
  setDataMask = () => {},
  resultFormat = 'json',
  resultType = 'full',
  force = false,
  method = 'POST',
  requestParams = {},
  ownState = {},
}) {
  let querySettings = {
    ...requestParams,
  };

  if (domainShardingEnabled) {
    querySettings = {
      ...querySettings,
      mode: 'cors',
      credentials: 'include',
    };
  }

  if (shouldUseLegacyApi(formData)) {
    return legacyChartDataRequest(
      formData,
      resultFormat,
      resultType,
      force,
      method,
      querySettings,
    );
  }
  return v1ChartDataRequest(
    formData,
    resultFormat,
    resultType,
    force,
    querySettings,
    setDataMask,
    ownState,
  );
}

export function runAnnotationQuery(
  annotation,
  timeout = 60,
  formData = null,
  key,
  isDashboardRequest = false,
  force = false,
) {
  return function (dispatch, getState) {
    const sliceKey = key || Object.keys(getState().charts)[0];
    // make a copy of formData, not modifying original formData
    const fd = {
      ...(formData || getState().charts[sliceKey].latestQueryFormData),
    };

    if (!requiresQuery(annotation.sourceType)) {
      return Promise.resolve();
    }

    const granularity = fd.time_grain_sqla || fd.granularity;
    fd.time_grain_sqla = granularity;
    fd.granularity = granularity;
    const overridesKeys = Object.keys(annotation.overrides);
    if (overridesKeys.includes('since') || overridesKeys.includes('until')) {
      annotation.overrides = {
        ...annotation.overrides,
        time_range: null,
      };
    }
    const sliceFormData = Object.keys(annotation.overrides).reduce(
      (d, k) => ({
        ...d,
        [k]: annotation.overrides[k] || fd[k],
      }),
      {},
    );

    if (!isDashboardRequest && fd) {
      const hasExtraFilters = fd.extra_filters && fd.extra_filters.length > 0;
      sliceFormData.extra_filters = hasExtraFilters
        ? fd.extra_filters
        : undefined;
    }

    const isNative = annotation.sourceType === ANNOTATION_SOURCE_TYPES.NATIVE;
    const url = getAnnotationJsonUrl(
      annotation.value,
      sliceFormData,
      isNative,
      force,
    );
    const controller = new AbortController();
    const { signal } = controller;

    dispatch(annotationQueryStarted(annotation, controller, sliceKey));

    return SupersetClient.get({
      url,
      signal,
      timeout: timeout * 1000,
    })
      .then(({ json }) =>
        dispatch(annotationQuerySuccess(annotation, json, sliceKey)),
      )
      .catch(response =>
        getClientErrorObject(response).then(err => {
          if (err.statusText === 'timeout') {
            dispatch(
              annotationQueryFailed(
                annotation,
                { error: 'Query timeout' },
                sliceKey,
              ),
            );
          } else if ((err.error || '').toLowerCase().includes('no data')) {
            dispatch(annotationQuerySuccess(annotation, err, sliceKey));
          } else if (err.statusText !== 'abort') {
            dispatch(annotationQueryFailed(annotation, err, sliceKey));
          }
        }),
      );
  };
}

export const TRIGGER_QUERY = 'TRIGGER_QUERY';
export function triggerQuery(value = true, key) {
  return { type: TRIGGER_QUERY, value, key };
}

// this action is used for forced re-render without fetch data
export const RENDER_TRIGGERED = 'RENDER_TRIGGERED';
export function renderTriggered(value, key) {
  return { type: RENDER_TRIGGERED, value, key };
}

export const UPDATE_QUERY_FORM_DATA = 'UPDATE_QUERY_FORM_DATA';
export function updateQueryFormData(value, key) {
  return { type: UPDATE_QUERY_FORM_DATA, value, key };
}

// in the sql lab -> explore flow, user can inline edit chart title,
// then the chart will be assigned a new slice_id
export const UPDATE_CHART_ID = 'UPDATE_CHART_ID';
export function updateChartId(newId, key = 0) {
  return { type: UPDATE_CHART_ID, newId, key };
}

export const ADD_CHART = 'ADD_CHART';
export function addChart(chart, key) {
  return { type: ADD_CHART, chart, key };
}

export function exploreJSON(
  formData,
  force = false,
  timeout = 60,
  key,
  method,
  dashboardId,
  ownState,
) {
  return async dispatch => {
    const logStart = Logger.getTimestamp();
    const controller = new AbortController();

    const requestParams = {
      signal: controller.signal,
      timeout: timeout * 1000,
    };
    if (dashboardId) requestParams.dashboard_id = dashboardId;

    const setDataMask = dataMask => {
      dispatch(updateDataMask(formData.slice_id, dataMask));
    };
    const chartDataRequest = getChartDataRequest({
      setDataMask,
      formData,
      resultFormat: 'json',
      resultType: 'full',
      force,
      method,
      requestParams,
      ownState,
    });

    dispatch(chartUpdateStarted(controller, formData, key));

    const chartDataRequestCaught = chartDataRequest
      .then(({ response, json }) => {
        if (isFeatureEnabled(FeatureFlag.GLOBAL_ASYNC_QUERIES)) {
          // deal with getChartDataRequest transforming the response data
          const result = 'result' in json ? json.result : json;
          switch (response.status) {
            case 200:
              // Query results returned synchronously, meaning query was already cached.
              return Promise.resolve(result);
            case 202:
              // Query is running asynchronously and we must await the results
              if (shouldUseLegacyApi(formData)) {
                return waitForAsyncData(result[0]);
              }
              return waitForAsyncData(result);
            default:
              throw new Error(
                `Received unexpected response status (${response.status}) while fetching chart data`,
              );
          }
        }

        return json.result;
      })
      .then(queriesResponse => {
        queriesResponse.forEach(resultItem =>
          dispatch(
            logEvent(LOG_ACTIONS_LOAD_CHART, {
              slice_id: key,
              applied_filters: resultItem.applied_filters,
              is_cached: resultItem.is_cached,
              force_refresh: force,
              row_count: resultItem.rowcount,
              datasource: formData.datasource,
              start_offset: logStart,
              ts: new Date().getTime(),
              duration: Logger.getTimestamp() - logStart,
              has_extra_filters:
                formData.extra_filters && formData.extra_filters.length > 0,
              viz_type: formData.viz_type,
              data_age: resultItem.is_cached
                ? moment(new Date()).diff(moment.utc(resultItem.cached_dttm))
                : null,
            }),
          ),
        );
        return dispatch(chartUpdateSucceeded(queriesResponse, key));
      })
      .catch(response => {
        if (isFeatureEnabled(FeatureFlag.GLOBAL_ASYNC_QUERIES)) {
          return dispatch(chartUpdateFailed([response], key));
        }

        const appendErrorLog = (errorDetails, isCached) => {
          dispatch(
            logEvent(LOG_ACTIONS_LOAD_CHART, {
              slice_id: key,
              has_err: true,
              is_cached: isCached,
              error_details: errorDetails,
              datasource: formData.datasource,
              start_offset: logStart,
              ts: new Date().getTime(),
              duration: Logger.getTimestamp() - logStart,
            }),
          );
        };
        if (response.name === 'AbortError') {
          appendErrorLog('abort');
          return dispatch(chartUpdateStopped(key));
        }
        return getClientErrorObject(response).then(parsedResponse => {
          if (response.statusText === 'timeout') {
            appendErrorLog('timeout');
          } else {
            appendErrorLog(parsedResponse.error, parsedResponse.is_cached);
          }
          return dispatch(chartUpdateFailed([parsedResponse], key));
        });
      });

    // only retrieve annotations when calling the legacy API
    const annotationLayers = shouldUseLegacyApi(formData)
      ? formData.annotation_layers || []
      : [];
    const isDashboardRequest = dashboardId > 0;

    return Promise.all([
      chartDataRequestCaught,
      dispatch(triggerQuery(false, key)),
      dispatch(updateQueryFormData(formData, key)),
      ...annotationLayers.map(x =>
        dispatch(
          runAnnotationQuery(
            x,
            timeout,
            formData,
            key,
            isDashboardRequest,
            force,
          ),
        ),
      ),
    ]);
  };
}

export const GET_SAVED_CHART = 'GET_SAVED_CHART';
export function getSavedChart(
  formData,
  force = false,
  timeout = 60,
  key,
  dashboardId,
  ownState,
) {
  /*
   * Perform a GET request to `/explore_json`.
   *
   * This will return the payload of a saved chart, optionally filtered by
   * ad-hoc or extra filters from dashboards. Eg:
   *
   *  GET  /explore_json?{"chart_id":1}
   *  GET  /explore_json?{"chart_id":1,"extra_filters":"..."}
   *
   */
  return exploreJSON(
    formData,
    force,
    timeout,
    key,
    'GET',
    dashboardId,
    ownState,
  );
}

export const POST_CHART_FORM_DATA = 'POST_CHART_FORM_DATA';
export function postChartFormData(
  formData,
  force = false,
  timeout = 60,
  key,
  dashboardId,
  ownState,
) {
  /*
   * Perform a POST request to `/explore_json`.
   *
   * This will post the form data to the endpoint, returning a new chart.
   *
   */
  return exploreJSON(
    formData,
    force,
    timeout,
    key,
    'POST',
    dashboardId,
    ownState,
  );
}

export function redirectSQLLab(formData) {
  return dispatch => {
    getChartDataRequest({ formData, resultFormat: 'json', resultType: 'query' })
      .then(({ json }) => {
        const redirectUrl = '/superset/sqllab/';
        const payload = {
          datasourceKey: formData.datasource,
          sql: json.result[0].query,
        };
        postForm(redirectUrl, payload);
      })
      .catch(() =>
        dispatch(addDangerToast(t('An error occurred while loading the SQL'))),
      );
  };
}

export function refreshChart(chartKey, force, dashboardId) {
  return (dispatch, getState) => {
    const chart = (getState().charts || {})[chartKey];
    const timeout =
      getState().dashboardInfo.common.conf.SUPERSET_WEBSERVER_TIMEOUT;

    if (
      !chart.latestQueryFormData ||
      Object.keys(chart.latestQueryFormData).length === 0
    ) {
      return;
    }
    dispatch(
      postChartFormData(
        chart.latestQueryFormData,
        force,
        timeout,
        chart.id,
        dashboardId,
        getState().dataMask[chart.id]?.ownState,
      ),
    );
  };
}


text: [Git Intro (in russian)](http://git.rysenko.com)

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace oxide\util;

/**
 * File Parser
 */
class FileParser {
   protected
      $_parsers = [];

   /**
    *
    */
   public function __construct() {
      // add the json parser
      $this->addParser('json', function($file) {
         $raw = file_get_contents($file);
         $data =json_decode($raw, true);

         return $data;
      });

      // add php file parser
      $this->addParser('php', function($file) {
         return include $file;
      });

      // add ini parser
      $this->addParser('ini', function($file) {
         return parse_ini_file($file, true);
      });
   }

   /**
    * Add a parser for file $ext
    *
    * @param string $ext
    * @param \Closure $parser
    */
   public function addParser($ext, \Closure $parser) {
      $this->_parsers[strtolower($ext)] = $parser;
   }

   /**
    * Get the parser for file extension
    *
    * @param string $ext
    * @return \Closure
    */
   public function getParser($ext) {
      $lext = strtolower($ext);
      if(isset($this->_parsers[$lext])) {
         return $this->_parsers[$lext];
      }

      return null;
   }

   /**
    * Parse the given file
    *
    * @param string $file
    * @return mixed
    * @throws \Exception
    */
   public function parse($file) {
      // first we need to check if file exits
      if(!is_file($file)) {
         throw new \Exception("File: $file is not found.");
      }

      $info = pathinfo($file);
      $data = null;
      $ext = strtolower($info['extension']);

      $parser = $this->getParser($ext);
      if($parser) {
         $data = $parser($file);

      }

      return $data;
   }
}


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('xwing_data', '0014_statisticset_skill'),
    ]

    operations = [
        migrations.RenameField(
            model_name='statisticset',
            old_name='shields',
            new_name='shield',
        ),
    ]


text:
/* Contact Form variables
========================================================*/
/* Contact Form Basic Styles
========================================================*/
#contact-form {
  position: relative;
  text-align: left;
}
#contact-form .btns .btn1 {
  margin: 0 10px;
}
#contact-form p {
  margin: 12px 0 0 0;
  float: left;
  color: #fff;
}
.contactForm2 #contact-form {
  position: relative;
}
.contactForm2 #contact-form .btns {
  text-align: center;
}
.contactForm2 #contact-form .btns .btn3 {
  width: 100%;
  text-align: center;
  border-radius: 3px;
  line-height: 56px;
  font-size: 30px;
}
#contact-form label {
  position: relative;
  display: inline-block;
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin-bottom: 20px;
}
#contact-form fieldset {
  border: none;
}
.contactForm2 #contact-form fieldset {
  margin-bottom: 17px;
}
.contactForm2 .box {
  /*float:left;*/
  width: 100%;
}
/* Contact Form Placeholder Styles
========================================================*/
#contact-form ._placeholder {
  width: 100% !important;
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  cursor: text;
  border: 1px solid #f0efef;
  background: #f2f4f6;
  font: 14px/18px 'Roboto Condensed';
  height: 48px;
  color: #8c8c8c;
  padding: 14px 28px;
}
#contact-form ._placeholder.focused {
  opacity: 0.4;
  filter: alpha(opacity=40);
  -webkit-box-shadow: 0px 0px 7px 0px rgba(0, 0, 255, 0.5);
  box-shadow: 0px 0px 7px 0px rgba(0, 0, 255, 0.5);
}
#contact-form ._placeholder.hidden {
  display: none;
}
#contact-form .file ._placeholder {
  display: none;
}
.contactForm2 #contact-form ._placeholder {
  width: 100% !important;
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  cursor: text;
  border: 1px solid #f0efef;
  background: #f2f4f6;
  font: 14px/18px 'Roboto Condensed';
  height: 48px;
  color: #8c8c8c;
  padding: 14px 28px;
}
/* Contact Form Input
========================================================*/
#contact-form input[type='text'] {
  width: 100%;
  outline: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid #f0efef;
  background: #f2f4f6;
  font: 14px/18px 'Roboto Condensed';
  height: 48px;
  color: #8c8c8c;
  padding: 14px 28px;
}
.contactForm2 #contact-form input[type='text'] {
  border: 1px solid #f0efef;
  background: #f2f4f6;
  font: 14px/18px 'Roboto Condensed';
  height: 48px;
  color: #8c8c8c;
  padding: 14px 28px;
}
/* Contact Form File Input
========================================================*/
#contact-form .input-group {
  position: relative;
  display: table;
  border-collapse: separate;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
#contact-form input.form-control[disabled] {
  cursor: not-allowed;
  background-color: #eeeeee;
  opacity: 1;
}
#contact-form input.form-control {
  position: relative;
  z-index: 2;
  float: left;
  width: 100%;
  margin-bottom: 0;
  padding: 6px 12px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  -moz-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
#contact-form .input-group-btn:first-child > .btn {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  margin: 0 -1px 0 0;
}
#contact-form .input-group .form-control:last-child {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}
#contact-form .input-group-btn:last-child > .btn {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}
#contact-form .input-group .form-control:first-child {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}
#contact-form input.form-control,
#contact-form .input-group-btn {
  display: table-cell;
  border-collapse: separate;
  float: none !important;
}
#contact-form .input-group-btn label {
  width: auto;
  margin-left: -1px;
}
#contact-form .input-group-btn {
  position: relative;
  font-size: 0;
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}
#contact-form .btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  border-radius: 4px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
/*#contact-form .btn-default {
  color: #333333;
  background-color: #ffffff;
  border-color: #cccccc;
}

#contact-form .btn-default:hover {
  color: #333333;
  background-color: #ebebeb;
  border-color: #adadad;
}

#contact-form .btn-default:active, #contact-form .btn-default:focus {
  outline-offset: -2px;
  outline: none;
  .box-shadow(inset 0 3px 5px rgba(0, 0, 0, 0.125));
}*/
/* Contact Form Textarea
========================================================*/
#contact-form textarea {
  width: 100%;
  outline: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  resize: none;
  border: 1px solid #f0efef;
  background: #f2f4f6;
  font: 14px/18px 'Roboto Condensed';
  height: 244px;
  color: #8c8c8c;
  padding: 14px 28px
    resize:none;
}
#contact-form .form-div-1,
#contact-form .form-div-2,
#contact-form .form-div-3 {
  float: left;
  width: 242px;
  margin-right: 20px;
}
#contact-form .form-div-1 strong,
#contact-form .form-div-2 strong,
#contact-form .form-div-3 strong {
  font: 18px 'Roboto';
  color: #000;
  margin-bottom: 10px;
  display: block;
}
#contact-form .form-div-3 {
  margin-right: 0;
}
#contact-form .form-div-4 {
  margin-bottom: 22px;
}
#contact-form .form-div-4 textarea {
  line-height: 20px;
  padding: 12px 14px;
}
#contact-form .form-div-4 strong {
  font: 18px 'Roboto';
  color: #000;
  margin-bottom: 10px;
  display: block;
}
.contactForm2 {
  padding-bottom: 12px;
}
.contactForm2 #contact-form .form-div-4 {
  text-align: left;
  margin-bottom: 18px;
  /*float: left;*/
  width: 100%;
}
.contactForm2 #contact-form .form-div-4 strong {
  font: 18px 'Roboto';
  color: #000;
  margin-bottom: 6px;
  display: block;
}
.contactForm2 #contact-form textarea {
  border: 1px solid #f0efef;
  background: #f2f4f6;
  font: 14px/18px 'Roboto Condensed';
  height: 189px;
  color: #8c8c8c;
  padding: 14px 28px;
}
.contactForm2 #contact-form .form-div-1,
.contactForm2 #contact-form .form-div-2 {
  float: none;
  width: 100%;
  margin-bottom: 18px;
  margin-right: 0;
  text-align: left;
}
.contactForm2 #contact-form .form-div-1 strong,
.contactForm2 #contact-form .form-div-2 strong {
  font: 18px 'Roboto';
  color: #000;
  margin-bottom: 6px;
  display: block;
}
.contactForm2 #contact-form .form-div-2 {
  margin-right: 0;
}
.contactForm2 #contact-form .form-div-3 {
  margin-right: 0;
}
/* Contact Form Error messages
========================================================*/
#contact-form .empty-message,
#contact-form .error-message {
  position: absolute;
  right: 3px;
  top: 0;
  color: #53afee;
  font-weight: normal;
  height: 0;
  overflow: hidden;
  font-size: 10px;
  -webkit-transition: 0.3s ease-in height;
  transition: 0.3s ease-in height;
  z-index: 99;
}
#contact-form .invalid .error-message,
#contact-form .empty .empty-message {
  height: 20px;
}
.contactForm2 #contact-form .empty-message,
.contactForm2 #contact-form .error-message {
  top: 9px;
}
/* Contact Form Processing Box
========================================================*/
#contact-form .contact-form-loader {
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  background-image: url('../img/form-loader.gif');
  background-repeat: no-repeat;
  background-position: 50% 50%;
  opacity: 0;
}
#contact-form.processing .contact-form-loader {
  opacity: 1;
  z-index: 99;
  -webkit-transition: all 0.3s ease-in;
  transition: all 0.3s ease-in;
}
/* Contact Form Modal
========================================================*/
.modal-open {
  overflow: hidden;
}
#contact-form .modal {
  display: none;
  overflow: auto;
  overflow-y: scroll;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  font-family: Arial, "Times New Roman", sans-serif;
  font-size: 13px;
  overflow: hidden;
}
#contact-form .modal h4 {
  font-weight: bold;
  padding: 0;
  margin: 0;
  border: none;
}
.modal.fade .modal-dialog {
  -webkit-transform: translate(0, -25%);
  -ms-transform: translate(0, -25%);
  transform: translate(0, -25%);
  -webkit-transition: -webkit-transform 0.3s ease-out;
  -moz-transition: -moz-transform 0.3s ease-out;
  -o-transition: -o-transform 0.3s ease-out;
  transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
  -webkit-transform: translate(0, 0);
  -ms-transform: translate(0, 0);
  transform: translate(0, 0);
}
.modal-content {
  position: relative;
  background-color: #ffffff;
  border: 1px solid #999999;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  background-clip: padding-box;
  outline: none;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  background-color: #000000;
}
.modal-backdrop.fade {
  opacity: 0;
  filter: alpha(opacity=0);
}
.modal-backdrop.in {
  opacity: 0.5;
  filter: alpha(opacity=50);
}
.modal-header {
  padding: 15px;
  min-height: 16.42857143px;
}
.modal-header .close {
  margin-top: -2px;
}
.modal-title {
  margin: 0;
  line-height: 1.42857143;
}
.modal-body {
  position: relative;
  padding: 20px;
}
.modal-dialog {
  width: 600px;
  margin: 10px auto;
}
@media only screen and (max-width: 768px) {
  .modal-dialog {
    position: relative;
    width: auto;
    margin: 10px;
  }
}
/* Contact Form Close icon
========================================================*/
.close {
  float: right;
  font-size: 21px;
  font-weight: bold;
  line-height: 1;
  color: #000000;
  text-shadow: 0 1px 0 #ffffff;
  opacity: 0.2;
  filter: alpha(opacity=20);
}
.close:hover,
.close:focus {
  color: #000000;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.5;
  filter: alpha(opacity=50);
}
button.close {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-appearance: none;
}
/*---------------------------------------------------------------------------------------------------------------------------*/
@media (min-width: 992px) and (max-width: 1219px) {
  #contact-form .form-div-1,
  #contact-form .form-div-2,
  #contact-form .form-div-3 {
    float: none;
    width: 100%;
    margin-right: 0;
  }
  .contactForm2 #contact-form .form-div-1,
  .contactForm2 #contact-form .form-div-2,
  .contactForm2 #contact-form .form-div-3 {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 11px;
    text-align: left;
  }
}
/*---------------------------------------------------------------------------------------------------------------------------*/
@media (min-width: 768px) and (max-width: 991px) {
  #contact-form .form-div-1,
  #contact-form .form-div-2,
  #contact-form .form-div-3 {
    float: none;
    width: 100%;
    margin-right: 0;
  }
  .form-part {
    width: 100%;
    float: none;
  }
  .contactForm2 #contact-form .form-div-4 {
    float: none;
    width: 100%;
    margin-left: 0;
  }
  .contactForm2 #contact-form .form-div-1,
  .contactForm2 #contact-form .form-div-2,
  .contactForm2 #contact-form .form-div-3 {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 11px;
    text-align: left;
  }
}
/*---------------------------------------------------------------------------------------------------------------------------*/
@media (max-width: 767px) {
  #contact-form .form-div-1,
  #contact-form .form-div-2,
  #contact-form .form-div-3 {
    float: none;
    width: 100%;
    margin-right: 0;
  }
  .form-part {
    width: 100%;
    float: none;
  }
  .contactForm2 #contact-form .form-div-4 {
    float: none;
    width: 100%;
    margin-left: 0;
  }
  .contact-form-box {
    margin: 62px 0;
  }
  .contactForm2 #contact-form .form-div-1,
  .contactForm2 #contact-form .form-div-2,
  .contactForm2 #contact-form .form-div-3 {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 11px;
    text-align: left;
  }
}


text:
<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class OfferEditRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'         => 'required|regex:/^[a-zA-ZñÑÁÉÍÓÚáéíóú ]+$/|between:1,45',
            'duration'      => 'required|in:' . implode(config('select.duration'), ','),
            'level'         => 'required|in:' . implode(config('select.level'), ','),
            'experience'    => 'required|in:' . implode(config('select.experience'), ','),
            'kind'          => 'required|in:' . implode(config('select.kind'), ','),
            'name'          => 'required|exists:profFamilies,name',
            'wanted'        => 'required|integer|min:0',
            'description'   => 'required',
            'tagCount'      => 'required|exists:tags,tag',
            'workcenter'    =>'required|integer|workCenterValid',
            'enterpriseResponsable'    =>'required|integer|min:1|enterpriseResponsable',
        ];
    }
}


text:
<?php
return array (
  'System Check' => '',
  'Check again' => '',
  'Congratulations! Everything is ok and ready to start over!' => '',
  'Next' => 'Avanti',
  'This overview shows all system requirements of HumHub.' => '',
);


text:
#ifndef OPENSIM_POSITIONMOTION_H
#define OPENSIM_POSITIONMOTION_H

#include <simbody/internal/Motion.h>

#include <OpenSim/Common/FunctionSet.h>
#include <OpenSim/Common/TimeSeriesTable.h>
#include <OpenSim/Simulation/Model/ModelComponent.h>
#include "osimSimulationDLL.h"

namespace OpenSim {

class Function;
class Coordinate;
class StatesTrajectory;

/** This class prescribes the value, speed, and acceleration of all coordinates
in the model using SimTK::Motion. SimTK::Motion%s remove degrees of freedom
from the system rather than add constraints. This is an alternative to
prescribing kinematics using Coordinate's prescribed_function, which uses a
kinematic constraint. When prescribing motion, the system must compute
constraint forces to apply to enforce the prescribed motion;
such forces are available via SimbodyMatterSubsystem::findMotionForces().
@note This class requires that *all* coordinates are prescribed. */
class OSIMSIMULATION_API PositionMotion : public ModelComponent {
    OpenSim_DECLARE_CONCRETE_OBJECT(PositionMotion, ModelComponent);

public:
    OpenSim_DECLARE_PROPERTY(default_enabled, bool,
            "Whether or not this motion is enabled by default (default value: "
            "true).");
    OpenSim_DECLARE_PROPERTY(functions, FunctionSet,
            "Functions specifying the values of each coordinate.");

    PositionMotion() {
        constructProperty_default_enabled(true);
        constructProperty_functions(FunctionSet());
    }
    PositionMotion(std::string name) : PositionMotion() {
        setName(std::move(name));
    }
    ~PositionMotion() = default;
    /// Set a function to calculate the position for a given coordinate.
    /// The speed and acceleration of the coordinate are obtained as derivatives
    /// of the provided function.
    void setPositionForCoordinate(
            const Coordinate& coord, const Function& position);
    /// This determines if, after Model::initSystem(), these prescribed
    /// motions are enabled or disabled.
    void setDefaultEnabled(bool enabled) { set_default_enabled(enabled); }
    bool getDefaultEnabled() const { return get_default_enabled(); }
    /// Use this after Model::initSystem() to set if the prescribed motions
    /// are enforced.
    void setEnabled(SimTK::State& state, bool enabled) const;
    bool getEnabled(const SimTK::State& state) const;
    /// Create a PositionMotion that prescribes kinematics for all coordinates
    /// in a model, given a data table containing coordinate values for all
    /// coordinates using GCVSpline. If the table contains any columns that are
    /// not the names of coordinate value state variables, an exception is
    /// thrown (unless allowExtraColumns is true).
    ///
    /// @note If the data in the table violates kinematic constraints in the
    /// model, the resulting PositionMotion will also violate the kinematic
    /// constraints.
    ///
    /// @note This fuction ignores the inDegrees header metadata.
    static std::unique_ptr<PositionMotion> createFromTable(const Model& model,
            const TimeSeriesTable& coords, bool allowExtraColumns = false);
    /// Create a PositionMotion that prescribes kinematics for all coordinates
    /// in a model, given a StatesTrajectory.
    ///
    /// @note If the states trajectory violates kinematic constraints in the
    /// model, the resulting PositionMotion will also violate the kinematic
    /// constraints.
    static std::unique_ptr<PositionMotion> createFromStatesTrajectory(
            const Model& model, const StatesTrajectory& statesTraj);
    TimeSeriesTable exportToTable(const std::vector<double>& time) const;

private:
    /// Allocate SimTK::Motion%s.
    void extendAddToSystem(SimTK::MultibodySystem& system) const override;
    /// Set the functions on the SimTK::Motions. We need to wait until Topology
    /// so that we can iterate through the system's MobilizedBodies.
    void extendRealizeTopology(SimTK::State& state) const override;
    mutable SimTK::ResetOnCopy<std::vector<SimTK::Motion>> m_motions;
};

} // namespace OpenSim

#endif // OPENSIM_PRESCRIBEDPOSITIONMOTION_H


text:
'use strict';
var util = require('util'),
    path = require('path'),
    yeoman = require('yeoman-generator'),
    _ = require('lodash'),
    _s = require('underscore.string'),
    pluralize = require('pluralize'),
    asciify = require('asciify');

var AngularCaveman2Generator = module.exports = function AngularCaveman2Generator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);

  this.on('end', function () {
    this.installDependencies({ skipInstall: options['skip-install'] });
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(AngularCaveman2Generator, yeoman.generators.Base);

AngularCaveman2Generator.prototype.askFor = function askFor() {

  var cb = this.async();

  console.log('\n' +
    '+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+\n' +
    '|a|n|g|u|l|a|r| |c|a|v|e|m|a|n|2| |g|e|n|e|r|a|t|o|r|\n' +
    '+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+\n' +
    '\n');

  var prompts = [{
    type: 'input',
    name: 'baseName',
    message: 'What is the name of your application?',
    default: 'myapp'
  },
  {
    type: 'list',
    name: 'orm',
    message: 'Which object-relational mapper would you like to use?',
    choices: ['Integral', 'Postmodern'],
    default: 'Integral'
  }];

  this.prompt(prompts, function (props) {
    this.baseName = props.baseName;
    this.orm = props.orm == 'Integral' ? 'integral' : 'postmodern';

    cb();
  }.bind(this));
};

AngularCaveman2Generator.prototype.app = function app() {

  this.entities = [];
  this.resources = [];
  this.generatorConfig = {
    "baseName": this.baseName,
    "orm": this.orm,
    "entities": this.entities,
    "resources": this.resources
  };
  this.generatorConfigStr = JSON.stringify(this.generatorConfig, null, '\t');

  this.template('_generator.json', 'generator.json');
  this.template('_package.json', 'package.json');
  this.template('_bower.json', 'bower.json');
  this.template('bowerrc', '.bowerrc');
  this.template('Gruntfile.js', 'Gruntfile.js');
  this.copy('gitignore', '.gitignore');

  var publicDir = 'static/'
  var srcDir = 'src/'
  var tDir = 't/'
  var templatesDir = 'templates/'
  var templatesErrorsDir = 'templates/_errors/'
  this.mkdir(publicDir);
  this.mkdir(srcDir);
  this.mkdir(tDir);
  this.mkdir(templatesDir);
  this.mkdir(templatesErrorsDir);
  this.template('_app.asd', this.baseName + '.asd');
  this.template('_app-test.asd', this.baseName + '-test.asd');
  this.template('_app.lisp', 'app.lisp');
  this.template('_shlyfile.lisp', 'shlyfile.lisp');
  this.template('src/_config.lisp', srcDir + 'config.lisp');
  this.template('src/_main.lisp', srcDir + 'main.lisp');
  this.template('src/_model.lisp', srcDir + 'model.lisp');
  this.template('src/_view.lisp', srcDir + 'view.lisp');
  this.template('src/_web.lisp', srcDir + 'web.lisp');
  this.template('t/_app.lisp', tDir + 'app.lisp');
  this.template('templates/_errors/404.html', templatesErrorsDir + '404.html');

  var publicCssDir = publicDir + 'css/';
  var publicJsDir = publicDir + 'js/';
  var publicViewDir = publicDir + 'views/';
  this.mkdir(publicCssDir);
  this.mkdir(publicJsDir);
  this.mkdir(publicViewDir);
  this.template('public/_index.html', publicDir + 'index.html');
  this.copy('public/css/app.css', publicCssDir + 'app.css');
  this.template('public/js/_app.js', publicJsDir + 'app.js');
  this.template('public/js/home/_home-controller.js', publicJsDir + 'home/home-controller.js');
  this.template('public/views/home/_home.html', publicViewDir + 'home/home.html');
};

AngularCaveman2Generator.prototype.projectfiles = function projectfiles() {
  this.copy('editorconfig', '.editorconfig');
  this.copy('jshintrc', '.jshintrc');
};


text: java -jar ./selenium-server-standalone-2.44.0.jar


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class org.apache.hadoop.mapred.TaskAttemptContext (Hadoop 0.20.1 API)
</TITLE>

<META NAME="date" CONTENT="2009-09-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.hadoop.mapred.TaskAttemptContext

Packages that use TaskAttemptContext

org.apache.hadoop.mapred
A software framework for easily writing applications which process vast
amounts of data (multi-terabyte data-sets) parallelly on large clusters
(thousands of nodes) built of commodity hardware in a reliable, fault-tolerant
manner.

Uses of TaskAttemptContext in org.apache.hadoop.mapred

Methods in org.apache.hadoop.mapred with parameters of type TaskAttemptContext

 void
FileOutputCommitter.abortTask(TaskAttemptContext context)

abstract  void
OutputCommitter.abortTask(TaskAttemptContext taskContext)

          Deprecated. Discard the task output

 void
FileOutputCommitter.commitTask(TaskAttemptContext context)

abstract  void
OutputCommitter.commitTask(TaskAttemptContext taskContext)

          Deprecated. To promote the task's temporary output to final output location

 The task's output is moved to the job's output directory.

 boolean
FileOutputCommitter.needsTaskCommit(TaskAttemptContext context)

abstract  boolean
OutputCommitter.needsTaskCommit(TaskAttemptContext taskContext)

          Deprecated. Check whether task needs a commit

 void
FileOutputCommitter.setupTask(TaskAttemptContext context)

abstract  void
OutputCommitter.setupTask(TaskAttemptContext taskContext)

          Deprecated. Sets up output for the task.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2009 The Apache Software Foundation


text:
contact: "Ben Osman"
contact_role: "Youth Worker"
contact_photo: "/images/people/ben-osman.jpg"
contact_email: "ben@coggesparish.com"
contact_bio: "Ben is our Youth Worker. Having grown up in Cogges, Ben is passionate about seeing young people in Witney find a personal relationship and faith in God. He particularly enjoys seeing teenagers building community and stepping out in their faith. He enjoys watching films, adventures in the outdoors and cooking experimental meals for his lovely wife, Claire."
---


text:
import {defineMessages} from 'react-intl';

const messages=defineMessages({
  app_name: 'dmprov',
  dashboard: 'Dashboard',
  about: 'About',
  page_not_found_demo: 'Page not found demo',
  '404': '404',
  warning_404_message: '404 Page not found',
  warning_404_description: 'We are sorry but the page you are looking for does not exist.',
  settings: 'Settings',
  language: 'Language',
  theme: 'Theme',
  responsive: 'Responsive',
  en: 'English',
  de: 'German',
  ru: 'Russian',
  es: 'Spanish',
  pl: 'Polish',
  sv: 'Swedish',
  dark: 'Dark',
  light: 'Light',
  ics: 'ICS',
  sign_out: 'Sign out',
  sign_in: 'Sign in',
  sign_up: 'Sign up',
  sign_in_with_google: 'Sign in with Google',
  sign_in_with_facebook: 'Sign in with Facebook',
  sign_in_with_twitter: 'Sign in with Twitter',
  sign_in_with_github: 'Sign in with Github',
  'link_with_google.com': 'Link with Google',
  'link_with_facebook.com': 'Link with Facebook',
  'link_with_twitter.com': 'Link with Twitter',
  'link_with_github.com': 'Link with Github',
  my_account: 'My Account',
  name: 'Name',
  email: 'E-Mail',
  password: 'Password',
  confirm_password: 'Confirm Password',
  forgort_password: 'Forgot Password?',
  reset_password: 'Reset Password',
  change_password: 'Change Password',
  change_photo: 'Change Photo',
  change_email: 'Change E-Mail',
  reset_password_hint: 'Enter your E-Mail',
  save: 'Save',
  delete_account: 'Delete account',
  select_file: 'Select file',
  cancel: 'Cancel',
  submit: 'Submit',
  delete: 'Delete',
  ok: 'OK',
  delete_account_dialog_title: 'Delete Account?',
  delete_account_dialog_message: 'Your account will be deleted and you will lose all your data!',
  email_not_verified: 'E-Mail is not verified!',
  email_verified: 'E-Mail is verified',
  send_verification_email: 'Send verification E-Mail',
  send_verification_email_again: 'Send verification E-Mail again',
  tasks: 'Tasks',
  create_task: 'Create task',
  edit_task: 'Edit task',
  users: 'Users',
  edit: 'Edit',
  online: 'Online',
  offline: 'Offline',
  no_connection_warning: 'No connection!',
  title_label: 'Title',
  title_hint: 'Enter title',
  no_connection: 'No connection',
  delete_task_title: 'Delete task?',
  delete_task_message: 'The task will be deleted!',
  error: 'Error!',
  error_required_field: 'Required Field',
  companies: 'Companies',
  create_company: 'Create company',
  edit_company: 'Edit company',
  delete_company_title: 'Delete company?',
  delete_company_message: 'The company will be deleted!',
  campaigns: 'Campaigns',
  create_campaign: 'Create Campaign',
  edit_campaign: 'Edit Campaign',
  delete_campaign_title: 'Delete Campaign?',
  delete_campaign_message: 'The Campaign will be deleted!',
  full_name_label: 'Full name',
  full_name_hint: 'Enter full name',
  vat_label: 'UID',
  vat_hint: 'Enter UID',
  description_label: 'Description',
  description_hint: 'Enter description',
  name_label: 'Name',
  name_hint: 'Enter name',
  public_chats: 'Public chat',
  delete_message_title: 'Delete message?',
  delete_message_message: 'Message will be deleted!',
  users_count_title: '{number} Users',
  user_registrationg_graph_label: 'User registrations',
  required: 'Required',
  facebook: 'Facebook',
  github: 'Github',
  twitter: 'Twitter',
  phone: 'Phone',
  google: 'Google',
  facebook_color: '#303F9F',
  github_color: '#263238',
  twitter_color: '#36A2EB',
  phone_color: '#90A4AE',
  google_color: '#EA4335',
  password_color: '#4CAF50',
  chats: 'Chats',
  write_message_hint: 'Write message...',
  load_more_label: 'More...',
  select_user: 'Select user',
  operator_like_label: 'like',
  operator_notlike_label: 'not like',
  operator_equal_label: 'equal',
  operator_notequal_label: 'not equal',
  operator_novalue_label: 'no value',
  administration: 'Administration',
  roles: 'Roles',
  grants: 'Grants',
  private: 'Private',
  public: 'Public',
  grant_read_companies: 'Read companies',
  grant_create_company: 'Create company',
  grant_edit_company: 'Edit company',
  grant_delete_company: 'Delete company',
  is_admin_label: 'Administrator',
  predefined_messages: 'Predefined messages',
  delete_predefined_chat_message_title: 'Delete predefined message?',
  delete_predefined_chat_message_message: 'Predefined message will be deleted!',
  select_field: 'Select field',
  sorting: 'Sorting',
  filters: 'Filters',
  filter: 'Filter',
  add_filter: 'Add filter',
  delete_filter: 'Delete filter',
  change_sort_orientation: 'Change orientation',
  enable_case_sensitivity: 'Case sensitivity',
  hint_autocomplete: 'Select',
  enter_query_text: 'Enter text',
  email_label: 'Email',
  close_filter: 'Close filter',
  open_filter: 'Open filter',
  select_operator: 'Select operator',
  not_match_found: 'No match found',
  edit_user: 'Edit user',
  archive: 'Archive',
  asset_archive: 'Asset Archive',
  campaign_archive: 'Campaign Archive',
  assets:'Assets',
  widgets: 'Widgets',
  media: 'Media',
  campaign_settings:'Campaign Settings',
  assets_used: '0 of 0 used',
  active_campaign: 'active campaign',
  app_settings:'App Settings',
  app_dashboard:'App Dashboard',
  recent:'Recent',
  frequent:'Frequent',
  new: 'New',
  type: 'Type',
  encounters:'Encounters',
  NPCs: 'NPCs',
  locations: 'Locations',
  vehicles:'Vehicles',
  items: 'Items',
  organizations: 'Organizations',
  puzzles_traps: 'Puzzles & Traps',
  spells_powers:'Spells & Powers',
  conditions:'Conditions',
  notes: 'Notes',
  generators:'Generators',
  operators: 'Operators',
  reference:'Reference',
  boards: 'Boards',
  other_tools:'Other Tools',
  create: 'Create',
  ranfiltrator:'Ranfiltrator',
  radient: 'Radient',
  weather: 'Weather',
  initiative_tracker:'Initiative Tracker',
  dice_roller: 'Dice Roller',
  combat_helper: 'Combat Helper',
  kanban: 'Kanban',
  timeline: 'Timeline',
  map: 'Map',
  family_tree: 'Family Tree',
  heroes_cycle: 'Heroes Cycle',
  messenger: 'Messenger',
  scheduler: 'Scheduler',
  images: 'Images',
  sounds: 'Sounds',
  other: 'Other',
  campaign_name: 'Campaign Name',
  campaign_label: 'Campaign Name',
  campaign_name_hint: 'Enter Campaign Name',
  campaign_slug_hint: 'Enter Short Description',
  campaign_slug_label: 'Short Description',
  player_count_hint: ' Enter Expected Player Count',
  player_count_label: 'Expected Player Count',
  system_hint: 'System',
  system_label: 'Enter Game System',
  genre_hint: 'Genre',
  genre_label: 'Enter Genre',
  link_widgets: 'Link Widgets',
  link_tags: 'Link Tags',
  search: 'Search',
  global_db: 'Global Data',
  create_asset: 'Create Asset',
  globalize: 'Make Public',
  player_count: 'Players',
  full_description_hint: 'Full Description',
  tags_label: 'Enter Tags',
  asset_type: 'Asset Type',
  asset_slug_label: 'Asset Short Description',
  asset_name_label: 'Asset Name',
  asset_subtype_label: 'Asset Subtype',

});

export default messages;


text:
package com.github.megatronking.svg.generator.svg.model;

import com.github.megatronking.svg.generator.svg.utils.PathBuilder;

/**
 * The polygon element model in the svg xml.
 *
 * @author Megatron King
 * @since 2016/11/23 9:47
 */

public class Polygon extends SvgNode {

    public String points;

    @Override
    public void toPath() {
        if (points == null || points.length() == 0) {
            return;
        }
        PathBuilder builder = new PathBuilder();
        String[] split = points.split("[\\s,]+");
        float baseX = Float.parseFloat(split[0]);
        float baseY = Float.parseFloat(split[1]);
        builder.absoluteMoveTo(baseX, baseY);
        for (int j = 2; j < split.length; j += 2) {
            float x = Float.parseFloat(split[j]);
            float y = Float.parseFloat(split[j + 1]);
            builder.relativeLineTo(x - baseX, y - baseY);
            baseX = x;
            baseY = y;
        }
        builder.relativeClose();
        pathData = builder.toString();
    }

}


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

namespace _8.Магазин_за_плодове
{
    class Program
    {
        static void Main(string[] args)
        {
            var fruit = Console.ReadLine().ToLower();
            var day = Console.ReadLine().ToLower();
            var quantity = double.Parse(Console.ReadLine().ToLower());
            if (day == "monday" || day == "tuesday" || day == "wednesday" || day == "thursday" || day == "friday")
            {
                if (fruit == "banana") Console.WriteLine(quantity * 2.50);
                else if (fruit == "apple") Console.WriteLine(quantity * 1.20);
                else if (fruit == "orange") Console.WriteLine(quantity * 0.85);
                else if (fruit == "grapefruit") Console.WriteLine(quantity * 1.45);
                else if (fruit == "kiwi") Console.WriteLine(quantity * 2.70);
                else if (fruit == "pineapple") Console.WriteLine(quantity * 5.50);
                else if (fruit == "grapes") Console.WriteLine(quantity * 3.85);
                else Console.WriteLine("error");
            }
            else if (day == "saturday" || day == "sunday")
            {
                if (fruit == "banana") Console.WriteLine(quantity * 2.70);
                else if (fruit == "apple") Console.WriteLine(quantity * 1.25);
                else if (fruit == "orange") Console.WriteLine(quantity * 0.90);
                else if (fruit == "grapefruit") Console.WriteLine(quantity * 1.60);
                else if (fruit == "kiwi") Console.WriteLine(quantity * 3.00);
                else if (fruit == "pineapple") Console.WriteLine(quantity * 5.60);
                else if (fruit == "grapes") Console.WriteLine(quantity * 4.20);
                else Console.WriteLine("error");
            }
            else Console.WriteLine("error");
        }
    }
}


text:
<img src="ProjectHearMe.jpg" alt="Hear Me!" style="width: 1024px;"/>

## Inputs

 * Voice commands from microphone.

## Outputs

 * Events emitted to the BioteManager which contain commands or requests
   for the robot to do things.

## Hints

 * Do not try to write the voice recognition software by hand.  Use an existing
   voice recognition framework and simply interface it with the Snackbot
   systems.


text:
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404

from wagtail.admin.forms.pages import PageViewRestrictionForm
from wagtail.admin.modal_workflow import render_modal_workflow
from wagtail.core.models import Page, PageViewRestriction

def set_privacy(request, page_id):
    page = get_object_or_404(Page, id=page_id)
    page_perms = page.permissions_for_user(request.user)
    if not page_perms.can_set_view_restrictions():
        raise PermissionDenied

    # fetch restriction records in depth order so that ancestors appear first
    restrictions = page.get_view_restrictions().order_by('page__depth')
    if restrictions:
        restriction = restrictions[0]
        restriction_exists_on_ancestor = (restriction.page != page)
    else:
        restriction = None
        restriction_exists_on_ancestor = False

    if request.method == 'POST':
        form = PageViewRestrictionForm(request.POST, instance=restriction)
        if form.is_valid() and not restriction_exists_on_ancestor:
            if form.cleaned_data['restriction_type'] == PageViewRestriction.NONE:
                # remove any existing restriction
                if restriction:
                    restriction.delete(user=request.user)
            else:
                restriction = form.save(commit=False)
                restriction.page = page
                restriction.save(user=request.user)
                # Save the groups many-to-many field
                form.save_m2m()

            return render_modal_workflow(
                request, None, None,
                None, json_data={
                    'step': 'set_privacy_done',
                    'is_public': (form.cleaned_data['restriction_type'] == 'none')
                }
            )

    else:  # request is a GET
        if not restriction_exists_on_ancestor:
            if restriction:
                form = PageViewRestrictionForm(instance=restriction)
            else:
                # no current view restrictions on this page
                form = PageViewRestrictionForm(initial={
                    'restriction_type': 'none'
                })

    if restriction_exists_on_ancestor:
        # display a message indicating that there is a restriction at ancestor level -
        # do not provide the form for setting up new restrictions
        return render_modal_workflow(
            request, 'wagtailadmin/page_privacy/ancestor_privacy.html', None,
            {
                'page_with_restriction': restriction.page,
            }
        )
    else:
        # no restriction set at ancestor level - can set restrictions here
        return render_modal_workflow(
            request, 'wagtailadmin/page_privacy/set_privacy.html', None, {
                'page': page,
                'form': form,
            }, json_data={'step': 'set_privacy'}
        )


text:
from flask_resty import Api

from . import app, views

api = Api(app, prefix="/api")

api.add_resource("/authors/", views.AuthorListView, views.AuthorView)
api.add_resource("/books/", views.BookListView, views.BookView)
api.add_ping("/ping/")


text:
package org.robolectric.util;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.TestRunners;

import java.sql.ResultSet;
import java.sql.SQLException;

import static org.fest.assertions.api.Assertions.assertThat;

@RunWith(TestRunners.WithDefaults.class)
public class H2MapTest {

    H2Map map;

    @Before
    public void setUp() throws Exception {
        map = new H2Map();
    }

    @Test
    public void testDriverClassName() {
        assertThat(map.getDriverClassName()).isEqualTo("org.h2.Driver");
    }

    @Test
    public void testConnectionString() {
        assertThat(map.getConnectionString()).isEqualTo("jdbc:h2:mem:");
    }

    @Test
    public void testScrubSQLReplacesAutoIncrement() throws SQLException {
        assertThat(map.getScrubSQL("autoincrement")).isEqualTo("auto_increment");
    }

    @Test
    public void testScrubSQLReplacesIntegerWithBigInt() throws SQLException {
        assertThat(map.getScrubSQL("integer")).isEqualTo("bigint(19)");
    }

    @Test
    public void testScrubSQLAcceptsIntegerPrimaryKey() throws SQLException {
        map.getScrubSQL("INTEGER PRIMARY KEY AUTOINCREMENT");
    }

    @Test(expected = SQLException.class)
    public void testScrubSQLRejectsIntPrimaryKeyThrowsException() throws SQLException {
        map.getScrubSQL("INT PRIMARY KEY AUTOINCREMENT");
    }

    @Test(expected = SQLException.class)
    public void testScrubSQLRejectsCharPrimaryKeyThrowsException2() throws SQLException {
        map.getScrubSQL("CHAR PRIMARY KEY AUTOINCREMENT");
    }

    @Test
    public void testGetSelectLastInsertIdentity() throws SQLException {
        assertThat(map.getSelectLastInsertIdentity()).isEqualTo("SELECT IDENTITY();");
    }

    @Test
    public void testGetH2ResultSetIs_TYPE_SCROLL_INSENSITIVE() throws SQLException {
        assertThat(map.getResultSetType()).isEqualTo(ResultSet.TYPE_SCROLL_INSENSITIVE);
    }

    @Test
    public void scrubSQL_shouldRemoveConflictAlgorithms() throws Exception {
        assertThat(map.getScrubSQL("INSERT INTO ")).isEqualTo("INSERT INTO ");
        assertThat(map.getScrubSQL("INSERT OR ROLLBACK INTO ")).isEqualTo("INSERT INTO ");
        assertThat(map.getScrubSQL("INSERT OR ABORT INTO ")).isEqualTo("INSERT INTO ");
        assertThat(map.getScrubSQL("INSERT OR FAIL INTO ")).isEqualTo("INSERT INTO ");
        assertThat(map.getScrubSQL("INSERT OR IGNORE INTO ")).isEqualTo("INSERT INTO ");
        assertThat(map.getScrubSQL("INSERT OR REPLACE INTO ")).isEqualTo("INSERT INTO ");
    }
}


text:
package io.aeron.logbuffer;

import io.aeron.protocol.DataHeaderFlyweight;
import org.agrona.ErrorHandler;
import org.agrona.concurrent.UnsafeBuffer;
import org.agrona.concurrent.status.Position;
import org.junit.*;
import org.mockito.InOrder;

import static io.aeron.logbuffer.FrameDescriptor.*;
import static io.aeron.protocol.HeaderFlyweight.HDR_TYPE_DATA;
import static org.agrona.BitUtil.align;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.*;

public class TermReaderTest
{
    private static final int TERM_BUFFER_CAPACITY = LogBufferDescriptor.TERM_MIN_LENGTH;
    private static final int HEADER_LENGTH = DataHeaderFlyweight.HEADER_LENGTH;
    private static final int INITIAL_TERM_ID = 7;

    private final Header header = new Header(INITIAL_TERM_ID, TERM_BUFFER_CAPACITY);
    private final UnsafeBuffer termBuffer = mock(UnsafeBuffer.class);
    private final ErrorHandler errorHandler = mock(ErrorHandler.class);
    private final FragmentHandler handler = mock(FragmentHandler.class);
    private final Position subscriberPosition = mock(Position.class);

    @Before
    public void setUp()
    {
        when(termBuffer.capacity()).thenReturn(TERM_BUFFER_CAPACITY);
    }

    @Test
    public void shouldReadFirstMessage()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int termOffset = 0;

        when(termBuffer.getIntVolatile(0)).thenReturn(frameLength);
        when(termBuffer.getShort(typeOffset(0))).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertThat(readOutcome, is(1));

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(0);
        inOrder.verify(handler).onFragment(eq(termBuffer), eq(HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength);
    }

    @Test
    public void shouldNotReadPastTail()
    {
        final int termOffset = 0;

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertThat(readOutcome, is(0));
        verify(subscriberPosition, never()).setOrdered(anyLong());

        verify(termBuffer).getIntVolatile(0);
        verify(handler, never()).onFragment(any(), anyInt(), anyInt(), any());
    }

    @Test
    public void shouldReadOneLimitedMessage()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int termOffset = 0;

        when(termBuffer.getIntVolatile(anyInt())).thenReturn(frameLength);
        when(termBuffer.getShort(anyInt())).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, 1, header, errorHandler, 0, subscriberPosition);
        assertThat(readOutcome, is(1));

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(0);
        inOrder.verify(handler).onFragment(eq(termBuffer), eq(HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength);
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void shouldReadMultipleMessages()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int termOffset = 0;

        when(termBuffer.getIntVolatile(0)).thenReturn(frameLength);
        when(termBuffer.getIntVolatile(alignedFrameLength)).thenReturn(frameLength);
        when(termBuffer.getShort(anyInt())).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertThat(readOutcome, is(2));

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(0);
        inOrder.verify(handler).onFragment(eq(termBuffer), eq(HEADER_LENGTH), eq(msgLength), any(Header.class));

        inOrder.verify(termBuffer).getIntVolatile(alignedFrameLength);
        inOrder
            .verify(handler)
            .onFragment(eq(termBuffer), eq(alignedFrameLength + HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength * 2);
    }

    @Test
    public void shouldReadLastMessage()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int frameOffset = TERM_BUFFER_CAPACITY - alignedFrameLength;

        when(termBuffer.getIntVolatile(frameOffset)).thenReturn(frameLength);
        when(termBuffer.getShort(typeOffset(frameOffset))).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, frameOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertThat(readOutcome, is(1));

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(frameOffset);
        inOrder.verify(handler).onFragment(
            eq(termBuffer), eq(frameOffset + HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength);
    }

    @Test
    public void shouldNotReadLastMessageWhenPadding()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int frameOffset = TERM_BUFFER_CAPACITY - alignedFrameLength;

        when(termBuffer.getIntVolatile(frameOffset)).thenReturn(frameLength);
        when(termBuffer.getShort(typeOffset(frameOffset))).thenReturn((short)PADDING_FRAME_TYPE);

        final int readOutcome = TermReader.read(
            termBuffer, frameOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertThat(readOutcome, is(0));

        final InOrder inOrder = inOrder(termBuffer, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(frameOffset);
        verify(handler, never()).onFragment(any(), anyInt(), anyInt(), any());
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength);
    }
}


text: default['my_cookbook']['message'] = 'Hello world!'


text:
namespace beat {
	namespace g2 {
		//! キャッシュ有りのTfLeaf
		template <class Shape, class Ud=spi::none_t>
		class TfLeafCached : public TfLeaf<Ud> {
			private:
				using base_t = TfLeaf<Ud>;

				using Ac_OP = spi::Optional<uint32_t>;
				mutable Ac_OP	_baseAccum;
				mutable Shape	_tfShape;
				const Shape& _getTfShape() const {
					const auto accum = base_t::getAccum();
					if(!_baseAccum || *_baseAccum != *accum) {
						_baseAccum = accum;
						this->getModel()->im_transform(&_tfShape, base_t::getGlobal());
					}
					return _tfShape;
				}
				template <class Ar, class S, class UD>
				friend void save(Ar&, const TfLeafCached<S,UD>&);
				template <class Ar, class S, class UD>
				friend void load(Ar&, TfLeafCached<S,UD>&);
			public:
				using base_t::base_t;
				bool im_canCacheShape() const override {
					return true;
				}
				Vec2 im_support(const Vec2& dir) const override {
					// 予め変換しておいた形状でサポート写像
					return _getTfShape().support(dir);
				}
				void im_getBVolume(Circle& c) const override {
					c = _getTfShape().bs_getBCircle();
				}
				void im_getBVolume(AABB& a) const override {
					a = _getTfShape().bs_getBBox();
				}
				const void* im_getCore() const override {
					return &_getTfShape();
				}
				void* im_getCore() override {
					_getTfShape();
					// データが改変されるかも知れないので更新フラグを立てる
					_baseAccum = spi::none;
					return &_tfShape;
				}
		};
	}
}


text:
module.exports = {
  __init__: [ 'testOrderingProvider' ],
  testOrderingProvider: [ 'type', require('./TestOrderingProvider') ]
};


text:
package registry

import (
	"crypto/tls"
	"fmt"
	"net/http"
	"net/url"
	"strings"

	"github.com/Sirupsen/logrus"
	"github.com/docker/docker/reference"
	"github.com/docker/engine-api/types"
	registrytypes "github.com/docker/engine-api/types/registry"
)

// Service is a registry service. It tracks configuration data such as a list
// of mirrors.
type Service struct {
	config *serviceConfig
}

// NewService returns a new instance of Service ready to be
// installed into an engine.
func NewService(options ServiceOptions) *Service {
	return &Service{
		config: newServiceConfig(options),
	}
}

// ServiceConfig returns the public registry service configuration.
func (s *Service) ServiceConfig() *registrytypes.ServiceConfig {
	return &s.config.ServiceConfig
}

// Auth contacts the public registry with the provided credentials,
// and returns OK if authentication was successful.
// It can be used to verify the validity of a client's credentials.
func (s *Service) Auth(authConfig *types.AuthConfig, userAgent string) (status, token string, err error) {
	serverAddress := authConfig.ServerAddress
	if !strings.HasPrefix(serverAddress, "https://") && !strings.HasPrefix(serverAddress, "http://") {
		serverAddress = "https://" + serverAddress
	}
	u, err := url.Parse(serverAddress)
	if err != nil {
		return "", "", fmt.Errorf("unable to parse server address: %v", err)
	}

	endpoints, err := s.LookupPushEndpoints(u.Host)
	if err != nil {
		return "", "", err
	}

	for _, endpoint := range endpoints {
		login := loginV2
		if endpoint.Version == APIVersion1 {
			login = loginV1
		}

		status, token, err = login(authConfig, endpoint, userAgent)
		if err == nil {
			return
		}
		if fErr, ok := err.(fallbackError); ok {
			err = fErr.err
			logrus.Infof("Error logging in to %s endpoint, trying next endpoint: %v", endpoint.Version, err)
			continue
		}
		return "", "", err
	}

	return "", "", err
}

// splitReposSearchTerm breaks a search term into an index name and remote name
func splitReposSearchTerm(reposName string) (string, string) {
	nameParts := strings.SplitN(reposName, "/", 2)
	var indexName, remoteName string
	if len(nameParts) == 1 || (!strings.Contains(nameParts[0], ".") &&
		!strings.Contains(nameParts[0], ":") && nameParts[0] != "localhost") {
		// This is a Docker Index repos (ex: samalba/hipache or ubuntu)
		// 'docker.io'
		indexName = IndexName
		remoteName = reposName
	} else {
		indexName = nameParts[0]
		remoteName = nameParts[1]
	}
	return indexName, remoteName
}

// Search queries the public registry for images matching the specified
// search terms, and returns the results.
func (s *Service) Search(term string, authConfig *types.AuthConfig, userAgent string, headers map[string][]string) (*registrytypes.SearchResults, error) {
	if err := validateNoScheme(term); err != nil {
		return nil, err
	}

	indexName, remoteName := splitReposSearchTerm(term)

	index, err := newIndexInfo(s.config, indexName)
	if err != nil {
		return nil, err
	}

	// *TODO: Search multiple indexes.
	endpoint, err := NewV1Endpoint(index, userAgent, http.Header(headers))
	if err != nil {
		return nil, err
	}

	r, err := NewSession(endpoint.client, authConfig, endpoint)
	if err != nil {
		return nil, err
	}

	if index.Official {
		localName := remoteName
		if strings.HasPrefix(localName, "library/") {
			// If pull "library/foo", it's stored locally under "foo"
			localName = strings.SplitN(localName, "/", 2)[1]
		}

		return r.SearchRepositories(localName)
	}
	return r.SearchRepositories(remoteName)
}

// ResolveRepository splits a repository name into its components
// and configuration of the associated registry.
func (s *Service) ResolveRepository(name reference.Named) (*RepositoryInfo, error) {
	return newRepositoryInfo(s.config, name)
}

// ResolveIndex takes indexName and returns index info
func (s *Service) ResolveIndex(name string) (*registrytypes.IndexInfo, error) {
	return newIndexInfo(s.config, name)
}

// APIEndpoint represents a remote API endpoint
type APIEndpoint struct {
	Mirror       bool
	URL          *url.URL
	Version      APIVersion
	Official     bool
	TrimHostname bool
	TLSConfig    *tls.Config
}

// ToV1Endpoint returns a V1 API endpoint based on the APIEndpoint
func (e APIEndpoint) ToV1Endpoint(userAgent string, metaHeaders http.Header) (*V1Endpoint, error) {
	return newV1Endpoint(*e.URL, e.TLSConfig, userAgent, metaHeaders)
}

// TLSConfig constructs a client TLS configuration based on server defaults
func (s *Service) TLSConfig(hostname string) (*tls.Config, error) {
	return newTLSConfig(hostname, isSecureIndex(s.config, hostname))
}

func (s *Service) tlsConfigForMirror(mirrorURL *url.URL) (*tls.Config, error) {
	return s.TLSConfig(mirrorURL.Host)
}

// LookupPullEndpoints creates a list of endpoints to try to pull from, in order of preference.
// It gives preference to v2 endpoints over v1, mirrors over the actual
// registry, and HTTPS over plain HTTP.
func (s *Service) LookupPullEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
	return s.lookupEndpoints(hostname)
}

// LookupPushEndpoints creates a list of endpoints to try to push to, in order of preference.
// It gives preference to v2 endpoints over v1, and HTTPS over plain HTTP.
// Mirrors are not included.
func (s *Service) LookupPushEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
	allEndpoints, err := s.lookupEndpoints(hostname)
	if err == nil {
		for _, endpoint := range allEndpoints {
			if !endpoint.Mirror {
				endpoints = append(endpoints, endpoint)
			}
		}
	}
	return endpoints, err
}

func (s *Service) lookupEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
	endpoints, err = s.lookupV2Endpoints(hostname)
	if err != nil {
		return nil, err
	}

	if s.config.V2Only {
		return endpoints, nil
	}

	legacyEndpoints, err := s.lookupV1Endpoints(hostname)
	if err != nil {
		return nil, err
	}
	endpoints = append(endpoints, legacyEndpoints...)

	return endpoints, nil
}


text:
create event trigger regress_event_trigger
   on ddl_command_start
   execute procedure pg_backend_pid();

-- OK
create function test_event_trigger() returns event_trigger as $$
BEGIN
    RAISE NOTICE 'test_event_trigger: % %', tg_event, tg_tag;
END
$$ language plpgsql;

-- should fail, event triggers cannot have declared arguments
create function test_event_trigger_arg(name text)
returns event_trigger as $$ BEGIN RETURN 1; END $$ language plpgsql;

-- should fail, SQL functions cannot be event triggers
create function test_event_trigger_sql() returns event_trigger as $$
SELECT 1 $$ language sql;

-- should fail, no elephant_bootstrap entry point
create event trigger regress_event_trigger on elephant_bootstrap
   execute procedure test_event_trigger();

-- OK
create event trigger regress_event_trigger on ddl_command_start
   execute procedure test_event_trigger();

-- OK
create event trigger regress_event_trigger_end on ddl_command_end
   execute function test_event_trigger();

-- should fail, food is not a valid filter variable
create event trigger regress_event_trigger2 on ddl_command_start
   when food in ('sandwich')
   execute procedure test_event_trigger();

-- should fail, sandwich is not a valid command tag
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('sandwich')
   execute procedure test_event_trigger();

-- should fail, create skunkcabbage is not a valid command tag
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('create table', 'create skunkcabbage')
   execute procedure test_event_trigger();

-- should fail, can't have event triggers on event triggers
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('DROP EVENT TRIGGER')
   execute procedure test_event_trigger();

-- should fail, can't have event triggers on global objects
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('CREATE ROLE')
   execute procedure test_event_trigger();

-- should fail, can't have event triggers on global objects
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('CREATE DATABASE')
   execute procedure test_event_trigger();

-- should fail, can't have event triggers on global objects
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('CREATE TABLESPACE')
   execute procedure test_event_trigger();

-- should fail, can't have same filter variable twice
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('create table') and tag in ('CREATE FUNCTION')
   execute procedure test_event_trigger();

-- should fail, can't have arguments
create event trigger regress_event_trigger2 on ddl_command_start
   execute procedure test_event_trigger('argument not allowed');

-- OK
create event trigger regress_event_trigger2 on ddl_command_start
   when tag in ('create table', 'CREATE FUNCTION')
   execute procedure test_event_trigger();

-- OK
comment on event trigger regress_event_trigger is 'test comment';

-- drop as non-superuser should fail
create role regress_evt_user;
set role regress_evt_user;
create event trigger regress_event_trigger_noperms on ddl_command_start
   execute procedure test_event_trigger();
reset role;

-- test enabling and disabling
alter event trigger regress_event_trigger disable;
-- fires _trigger2 and _trigger_end should fire, but not _trigger
create table event_trigger_fire1 (a int);
alter event trigger regress_event_trigger enable;
set session_replication_role = replica;
-- fires nothing
create table event_trigger_fire2 (a int);
alter event trigger regress_event_trigger enable replica;
-- fires only _trigger
create table event_trigger_fire3 (a int);
alter event trigger regress_event_trigger enable always;
-- fires only _trigger
create table event_trigger_fire4 (a int);
reset session_replication_role;
-- fires all three
create table event_trigger_fire5 (a int);
-- non-top-level command
create function f1() returns int
language plpgsql
as $$
begin
  create table event_trigger_fire6 (a int);
  return 0;
end $$;
select f1();
-- non-top-level command
create procedure p1()
language plpgsql
as $$
begin
  create table event_trigger_fire7 (a int);
end $$;
call p1();

-- clean up
alter event trigger regress_event_trigger disable;
drop table event_trigger_fire2, event_trigger_fire3, event_trigger_fire4, event_trigger_fire5, event_trigger_fire6, event_trigger_fire7;
drop routine f1(), p1();

-- regress_event_trigger_end should fire on these commands
grant all on table event_trigger_fire1 to public;
comment on table event_trigger_fire1 is 'here is a comment';
revoke all on table event_trigger_fire1 from public;
drop table event_trigger_fire1;
create foreign data wrapper useless;
create server useless_server foreign data wrapper useless;
create user mapping for regress_evt_user server useless_server;
alter default privileges for role regress_evt_user
 revoke delete on tables from regress_evt_user;

-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regress_evt_user;

-- alter owner to superuser should work
alter role regress_evt_user superuser;
alter event trigger regress_event_trigger owner to regress_evt_user;

-- should fail, name collision
alter event trigger regress_event_trigger rename to regress_event_trigger2;

-- OK
alter event trigger regress_event_trigger rename to regress_event_trigger3;

-- should fail, doesn't exist any more
drop event trigger regress_event_trigger;

-- should fail, regress_evt_user owns some objects
drop role regress_evt_user;

-- cleanup before next test
-- these are all OK; the second one should emit a NOTICE
drop event trigger if exists regress_event_trigger2;
drop event trigger if exists regress_event_trigger2;
drop event trigger regress_event_trigger3;
drop event trigger regress_event_trigger_end;

-- test support for dropped objects
CREATE SCHEMA schema_one authorization regress_evt_user;
CREATE SCHEMA schema_two authorization regress_evt_user;
CREATE SCHEMA audit_tbls authorization regress_evt_user;
CREATE TEMP TABLE a_temp_tbl ();
SET SESSION AUTHORIZATION regress_evt_user;

CREATE TABLE schema_one.table_one(a int);
CREATE TABLE schema_one."table two"(a int);
CREATE TABLE schema_one.table_three(a int);
CREATE TABLE audit_tbls.schema_one_table_two(the_value text);

CREATE TABLE schema_two.table_two(a int);
CREATE TABLE schema_two.table_three(a int, b text);
CREATE TABLE audit_tbls.schema_two_table_three(the_value text);

CREATE OR REPLACE FUNCTION schema_two.add(int, int) RETURNS int LANGUAGE plpgsql
  CALLED ON NULL INPUT
  AS $$ BEGIN RETURN coalesce($1,0) + coalesce($2,0); END; $$;
CREATE AGGREGATE schema_two.newton
  (BASETYPE = int, SFUNC = schema_two.add, STYPE = int);

RESET SESSION AUTHORIZATION;

CREATE TABLE undroppable_objs (
	object_type text,
	object_identity text
);
INSERT INTO undroppable_objs VALUES
('table', 'schema_one.table_three'),
('table', 'audit_tbls.schema_two_table_three');

CREATE TABLE dropped_objects (
	type text,
	schema text,
	object text
);

-- This tests errors raised within event triggers; the one in audit_tbls
-- uses 2nd-level recursive invocation via test_evtrig_dropped_objects().
CREATE OR REPLACE FUNCTION undroppable() RETURNS event_trigger
LANGUAGE plpgsql AS $$
DECLARE
	obj record;
	undroppable_obj record;
BEGIN
	PERFORM 1 FROM pg_tables WHERE tablename = 'undroppable_objs';
	IF NOT FOUND THEN
		RAISE NOTICE 'table undroppable_objs not found, skipping';
		RETURN;
	END IF;

	-- This query has been modified from upstream's,
	-- to not do a join, because with the original query, the planner would
	-- execute the pg_event_trigger_dropped_objects() function in an entry DB
	-- worker process, not the QD process. That doesn't work, the function
	-- relies on information stored in backend-local memory, and it throws
	-- an error if it's executed in a different process. Work around that
	-- by looping through the rows in PL/pgSQL instead.
	FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects()
	LOOP
	  FOR undroppable_obj IN
		SELECT * FROM undroppable_objs WHERE object_type = obj.object_type AND object_identity = obj.object_identity
	  LOOP
		RAISE EXCEPTION 'object % of type % cannot be dropped',
			obj.object_identity, obj.object_type;
	  END LOOP;
	END LOOP;
END;
$$;

CREATE EVENT TRIGGER undroppable ON sql_drop
	EXECUTE PROCEDURE undroppable();

CREATE OR REPLACE FUNCTION test_evtrig_dropped_objects() RETURNS event_trigger
LANGUAGE plpgsql AS $$
DECLARE
    obj record;
BEGIN
    FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects()
    LOOP
        IF obj.object_type = 'table' THEN
                EXECUTE format('DROP TABLE IF EXISTS audit_tbls.%I',
					format('%s_%s', obj.schema_name, obj.object_name));
        END IF;

	INSERT INTO dropped_objects
		(type, schema, object) VALUES
		(obj.object_type, obj.schema_name, obj.object_identity);
    END LOOP;
END
$$;

CREATE EVENT TRIGGER regress_event_trigger_drop_objects ON sql_drop
	WHEN TAG IN ('drop table', 'drop function', 'drop view',
		'drop owned', 'drop schema', 'alter table')
	EXECUTE PROCEDURE test_evtrig_dropped_objects();

ALTER TABLE schema_one.table_one DROP COLUMN a;
DROP SCHEMA schema_one, schema_two CASCADE;
DELETE FROM undroppable_objs WHERE object_identity = 'audit_tbls.schema_two_table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
DELETE FROM undroppable_objs WHERE object_identity = 'schema_one.table_three';
DROP SCHEMA schema_one, schema_two CASCADE;

SELECT * FROM dropped_objects WHERE schema IS NULL OR schema <> 'pg_toast';

DROP OWNED BY regress_evt_user;
SELECT * FROM dropped_objects WHERE type = 'schema';

DROP ROLE regress_evt_user;

DROP EVENT TRIGGER regress_event_trigger_drop_objects;
DROP EVENT TRIGGER undroppable;

CREATE OR REPLACE FUNCTION event_trigger_report_dropped()
 RETURNS event_trigger
 LANGUAGE plpgsql
AS $$
DECLARE r record;
BEGIN
    FOR r IN SELECT * from pg_event_trigger_dropped_objects()
    LOOP
    IF NOT r.normal AND NOT r.original THEN
        CONTINUE;
    END IF;
    RAISE NOTICE 'NORMAL: orig=% normal=% istemp=% type=% identity=% name=% args=%',
        r.original, r.normal, r.is_temporary, r.object_type,
        r.object_identity, r.address_names, r.address_args;
    END LOOP;
END; $$;
CREATE EVENT TRIGGER regress_event_trigger_report_dropped ON sql_drop
    EXECUTE PROCEDURE event_trigger_report_dropped();
CREATE SCHEMA evttrig
	CREATE TABLE one (col_a SERIAL PRIMARY KEY, col_b text DEFAULT 'forty two')
	CREATE INDEX one_idx ON one (col_b)
	CREATE TABLE two (col_c INTEGER CHECK (col_c > 0) REFERENCES one DEFAULT 42);

-- Partitioned tables with a partitioned index
CREATE TABLE evttrig.parted (
    id int PRIMARY KEY)
    PARTITION BY RANGE (id);
CREATE TABLE evttrig.part_1_10 PARTITION OF evttrig.parted (id)
  FOR VALUES FROM (1) TO (10);
CREATE TABLE evttrig.part_10_20 PARTITION OF evttrig.parted (id)
  FOR VALUES FROM (10) TO (20) PARTITION BY RANGE (id);
CREATE TABLE evttrig.part_10_15 PARTITION OF evttrig.part_10_20 (id)
  FOR VALUES FROM (10) TO (15);
CREATE TABLE evttrig.part_15_20 PARTITION OF evttrig.part_10_20 (id)
  FOR VALUES FROM (15) TO (20);

ALTER TABLE evttrig.two DROP COLUMN col_c;
ALTER TABLE evttrig.one ALTER COLUMN col_b DROP DEFAULT;
ALTER TABLE evttrig.one DROP CONSTRAINT one_pkey;
DROP INDEX evttrig.one_idx;
DROP SCHEMA evttrig CASCADE;
DROP TABLE a_temp_tbl;

DROP EVENT TRIGGER regress_event_trigger_report_dropped;

-- only allowed from within an event trigger function, should fail
select pg_event_trigger_table_rewrite_oid();

-- test Table Rewrite Event Trigger
CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger
LANGUAGE plpgsql AS $$
BEGIN
  RAISE EXCEPTION 'rewrites not allowed';
END;
$$;

create event trigger no_rewrite_allowed on table_rewrite
  execute procedure test_evtrig_no_rewrite();

create table rewriteme (id serial primary key, foo float, bar timestamptz);
insert into rewriteme
     select x * 1.001 from generate_series(1, 500) as t(x);
alter table rewriteme alter column foo type numeric;
alter table rewriteme add column baz int default 0;

-- test with more than one reason to rewrite a single table
CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger
LANGUAGE plpgsql AS $$
BEGIN
  RAISE NOTICE 'Table ''%'' is being rewritten (reason = %)',
               pg_event_trigger_table_rewrite_oid()::regclass,
               pg_event_trigger_table_rewrite_reason();
END;
$$;

alter table rewriteme
 add column onemore int default 0,
 add column another int default -1,
 alter column foo type numeric(10,4);

-- shouldn't trigger a table_rewrite event
alter table rewriteme alter column foo type numeric(12,4);
begin;
set timezone to 'UTC';
alter table rewriteme alter column bar type timestamp;
set timezone to '0';
alter table rewriteme alter column bar type timestamptz;
set timezone to 'Europe/London';
alter table rewriteme alter column bar type timestamp; -- does rewrite
rollback;

-- typed tables are rewritten when their type changes.  Don't emit table
-- name, because firing order is not stable.
CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger
LANGUAGE plpgsql AS $$
BEGIN
  RAISE NOTICE 'Table is being rewritten (reason = %)',
               pg_event_trigger_table_rewrite_reason();
END;
$$;

create type rewritetype as (a int);
create table rewritemetoo1 of rewritetype;
create table rewritemetoo2 of rewritetype;
alter type rewritetype alter attribute a type text cascade;

-- but this doesn't work
create table rewritemetoo3 (a rewritetype);
alter type rewritetype alter attribute a type varchar cascade;

drop table rewriteme;
drop event trigger no_rewrite_allowed;
drop function test_evtrig_no_rewrite();

-- test Row Security Event Trigger
RESET SESSION AUTHORIZATION;
CREATE TABLE event_trigger_test (a integer, b text);

CREATE OR REPLACE FUNCTION start_command()
RETURNS event_trigger AS $$
BEGIN
RAISE NOTICE '% - ddl_command_start', tg_tag;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION end_command()
RETURNS event_trigger AS $$
BEGIN
RAISE NOTICE '% - ddl_command_end', tg_tag;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION drop_sql_command()
RETURNS event_trigger AS $$
BEGIN
RAISE NOTICE '% - sql_drop', tg_tag;
END;
$$ LANGUAGE plpgsql;

CREATE EVENT TRIGGER start_rls_command ON ddl_command_start
    WHEN TAG IN ('CREATE POLICY', 'ALTER POLICY', 'DROP POLICY') EXECUTE PROCEDURE start_command();

CREATE EVENT TRIGGER end_rls_command ON ddl_command_end
    WHEN TAG IN ('CREATE POLICY', 'ALTER POLICY', 'DROP POLICY') EXECUTE PROCEDURE end_command();

CREATE EVENT TRIGGER sql_drop_command ON sql_drop
    WHEN TAG IN ('DROP POLICY') EXECUTE PROCEDURE drop_sql_command();

CREATE POLICY p1 ON event_trigger_test USING (FALSE);
ALTER POLICY p1 ON event_trigger_test USING (TRUE);
ALTER POLICY p1 ON event_trigger_test RENAME TO p2;
DROP POLICY p2 ON event_trigger_test;

DROP EVENT TRIGGER start_rls_command;
DROP EVENT TRIGGER end_rls_command;
DROP EVENT TRIGGER sql_drop_command;


text:
@charset('utf-8');

@import url('./vendor/reset.css');
@import url('./common/button.css');
@import url('./components/input.css');
@import url('./vendor/custom-select.css');

*,
*::before,
*::after {
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}

body {
	-webkit-transition: background-color 500ms ease;
	        transition: background-color 500ms ease;
	background: #306;
	color: #FFF;
	font-family: 'Helvetica Neue', sans-serif;
	font-size: 12px;
	will-change: background-color;
}

a {
	text-decoration: none;
}

body.is-processing * {
    cursor: wait !important;
}

#js-canvas {
    left: -9999px;
    position: absolute;
    visibility: hidden;
    top: -9999px;
}

svg {
    display: block;
    margin: 0 auto;
    max-width: 100vw;
}


text:
<?php

/**
 * XmlConnect device helper abstract
 *
 * @category    Mage
 * @package     Mage_XmlConnect
 * @author      Magento Core Team <core@magentocommerce.com>
 */
abstract class Mage_XmlConnect_Helper_Device_Abstract extends Mage_Core_Helper_Abstract
{
    /**
     * Country renderer block
     *
     * @var string
     */
    protected $_countryRendererBlock = 'xmlconnect/adminhtml_mobile_submission_renderer_country_istore';

    /**
     * Country field renderer
     *
     * @var Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element
     */
    protected $_countryRenderer;

    /**
     * Submission columns count
     *
     * @var int
     */
    protected $_countryColumnsCount = 4;

    /**
     * List of coutries that allowed in Ituens by Apple Store
     *
     * array(
     *      'country name' => 'country id at directory model'
     * )
     *
     * @var array
     */
    protected $_allowedCountries = array(
        'Argentina'     => 'AR',
        'Armenia'       => 'AM',
        'Australia'     => 'AU',
        'Austria'       => 'AT',
        'Belgium'       => 'BE',
        'Botswana'      => 'BW',
        'Brazil'        => 'BR',
        'Bulgaria'      => 'BG',
        'Canada'        => 'CA',
        'Chile'         => 'CL',
        'China'         => 'CN',
        'Colombia'      => 'CO',
        'Costa Rica'    => 'CR',
        'Croatia'       => 'HR',
        'Czech Republic' => 'CZ',
        'Denmark'       => 'DK',
        'Dominican Republic' => 'DO',
        'Ecuador'       => 'EC',
        'Egypt'         => 'EG',
        'El Salvador'   => 'SV',
        'Estonia'       => 'EE',
        'Finland'       => 'FI',
        'France'        => 'FR',
        'Germany'       => 'DE',
        'Greece'        => 'GR',
        'Guatemala'     => 'GT',
        'Honduras'      => 'HN',
        'Hong Kong SAR China' => 'HK',
        'Hungary'       => 'HU',
        'India'         => 'IN',
        'Indonesia'     => 'ID',
        'Ireland'       => 'IE',
        'Israel'        => 'IL',
        'Italy'         => 'IT',
        'Jamaica'       => 'JM',
        'Japan'         => 'JP',
        'Jordan'        => 'JO',
        'Kazakstan'     => 'KZ',
        'Kenya'         => 'KE',
        'South Korea'   => 'KR',
        'Kuwait'        => 'KW',
        'Latvia'        => 'LV',
        'Lebanon'       => 'LB',
        'Lithuania'     => 'LT',
        'Luxembourg'    => 'LU',
        'Macau SAR China' => 'MO',
        'Macedonia'     => 'MK',
        'Madagascar'    => 'MG',
        'Malaysia'      => 'MY',
        'Mali'          => 'ML',
        'Malta'         => 'MT',
        'Mauritius'     => 'MU',
        'Mexico'        => 'MX',
        'Moldova'       => 'MD',
        'Netherlands'   => 'NL',
        'New Zealand'   => 'NZ',
        'Nicaragua'     => 'NI',
        'Niger'         => 'NE',
        'Norway'        => 'NO',
        'Pakistan'      => 'PK',
        'Panama'        => 'PA',
        'Paraguay'      => 'PY',
        'Peru'          => 'PE',
        'Philippines'   => 'PH',
        'Poland'        => 'PL',
        'Portugal'      => 'PT',
        'Qatar'         => 'QA',
        'Romania'       => 'RO',
        'Russia'        => 'RU',
        'Saudi Arabia'  => 'SA',
        'Senegal'       => 'SN',
        'Singapore'     => 'SG',
        'Slovakia'      => 'SK',
        'Slovenia'      => 'SI',
        'South Africa'  => 'ZA',
        'Spain'         => 'ES',
        'Sri Lanka'     => 'LK',
        'Sweden'        => 'SE',
        'Switzerland'   => 'CH',
        'Taiwan'        => 'TW',
        'Thailand'      => 'TH',
        'Tunisia'       => 'TN',
        'Turkey'        => 'TR',
        'Uganda'        => 'UG',
        'United Arab Emirates' => 'AE',
        'United Kingdom' => 'GB',
        'United States' => 'US',
        'Uruguay'       => 'UY',
        'Venezuela'     => 'VE',
        'Vietnam'       => 'VN',
    );

    /**
     * Get submit images that are required for application submit
     *
     * @return array
     */
    public function getSubmitImages()
    {
        return $this->_imageIds;
    }

    /**
     * Default images list
     *
     * @return array
     */
    abstract function getImagesTypesList();

    /**
     * Get default application tabs
     *
     * @return array
     */
    abstract function getDefaultDesignTabs();

    /**
     * Default application configuration: font and color
     *
     * @return array
     */
    abstract function getDefaultConfiguration();

    /**
     * List of allowed fonts for application
     *
     * @return array
     */
    abstract function getFontList();

    /**
     * List of allowed font sizes for application
     *
     * @return array
     */
    public function getFontSizes()
    {
        $result = array();
        for ($i = 6; $i < 32; $i++) {
            $result[] = array(
                'value' => $i,
                'label' => $i . ' pt',
            );
        }
        return $result;
    }

    /**
     * Get list of countries that allowed by Magento Inc. for iOS
     *
     *
     * @return array
     */
    public function getAllowedCountriesArray()
    {
        return $this->_allowedCountries;
    }

    /**
     * Validate submit application data
     *
     * @param array $params
     * @return array
     */
    abstract function validateSubmit($params);

    /**
     * Get renderer for submission country
     *
     * @return Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element
     */
    public function getCountryRenderer()
    {
        if (empty($this->_countryRenderer)) {
            $this->_countryRenderer = Mage::app()->getLayout()->createBlock($this->_countryRendererBlock);
        }
        return $this->_countryRenderer;
    }

    /**
     * Get label for submission country
     *
     * @return string
     */
    public function getCountryLabel()
    {
        return Mage::helper('xmlconnect')->__('App Stores');
    }

    /**
     * Get count of columns for submission country
     *
     * @return int
     */
    public function getCountryColumns()
    {
        return $this->_countryColumnsCount;
    }

    /**
     * Get placement of Country Names for submission country
     *
     * @return bool
     */
    public function isCountryNamePlaceLeft()
    {
        return true;
    }

    /**
     * Get class name for submission country
     *
     * @return string
     */
    public function getCountryClass()
    {
        return 'istore stripy';
    }

    /**
     * Check the notifications are allowed for current type of application
     *
     * @return bool
     */
    public function isNotificationsAllowed()
    {
        return true;
    }

    /**
     * Get image count for image type
     *
     * @param string $imageType
     * @return int
     */
    public function getImageCount($imageType)
    {
        $imagesTypesList = $this->getImagesTypesList();
        if (!array_key_exists($imageType, $imagesTypesList)) {
            Mage::throwException(Mage::helper('xmlconnect')->__('Image type doesn\'t recognized: "%s".', $imageType));
        }
        return !empty($imagesTypesList[$imageType]['count']) ? $imagesTypesList[$imageType]['count'] : 0;
    }
}


text:
def velocityforboxes(boxes):
    frametobox = {box.frame: box for box in boxes}
    times = sorted(frametobox.keys())
    vels = {}
    for i, time in enumerate(times):
        last = times[max(0, i - 3)]
        nxt = times[min(len(times)-1, i + 3)]
        delta = nxt - last
        if frametobox[time].lost == 0 or delta == 0:
            velx = 0
            vely = 0
        else:

            velx = float(frametobox[nxt].xbr - frametobox[last].xbr) / float(delta)
            vely = float(frametobox[nxt].ybr - frametobox[last].ybr) / float(delta)
        vels[time] = (velx, vely)
    return vels