text:
<?php

if ( ! class_exists( 'QM_Backtrace' ) ) {
class QM_Backtrace {

	protected static $ignore_class = array(
		'wpdb'           => true,
		'QueryMonitor'   => true,
		'QueryMonitorDB' => true,
		'ExtQuery'       => true,
		'W3_Db'          => true,
		'Debug_Bar_PHP'  => true,
	);
	protected static $ignore_method = array();
	protected static $ignore_func = array(
		'include_once'         => true,
		'require_once'         => true,
		'include'              => true,
		'require'              => true,
		'call_user_func_array' => true,
		'call_user_func'       => true,
		'trigger_error'        => true,
		'_doing_it_wrong'      => true,
		'_deprecated_argument' => true,
		'_deprecated_file'     => true,
		'_deprecated_function' => true,
		'dbDelta'              => true,
	);
	protected static $show_args = array(
		'do_action'               => 1,
		'apply_filters'           => 1,
		'do_action_ref_array'     => 1,
		'apply_filters_ref_array' => 1,
		'get_template_part'       => 2,
		'section_template'        => 2,
		'load_template'           => 'dir',
		'get_header'              => 1,
		'get_sidebar'             => 1,
		'get_footer'              => 1,
	);
	protected static $filtered = false;
	protected $trace           = null;
	protected $filtered_trace  = null;
	protected $calling_line    = 0;
	protected $calling_file    = '';

	public function __construct( array $args = array() ) {
		# @TODO save the args as a property and process the trace JIT
		$args = array_merge( array(
			'ignore_current_filter' => true,
			'ignore_items'          => 0,
		), $args );
		$this->trace = debug_backtrace( false );
		$this->ignore( 1 ); # Self-awareness

		/**
		 * If error_handler() is in the trace, QM fails later when it tries
		 * to get $lowest['file'] in get_filtered_trace()
		 */
		if ( $this->trace[0]['function'] === 'error_handler' ) {
			$this->ignore( 1 );
		}

		if ( $args['ignore_items'] ) {
			$this->ignore( $args['ignore_items'] );
		}
		if ( $args['ignore_current_filter'] ) {
			$this->ignore_current_filter();
		}

	}

	public function get_stack() {

		$trace = $this->get_filtered_trace();
		$stack = wp_list_pluck( $trace, 'display' );

		return $stack;

	}

	public function get_caller() {

		$trace = $this->get_filtered_trace();

		return reset( $trace );

	}

	public function get_component() {

		$components = array();

		foreach ( $this->trace as $item ) {

			try {

				if ( isset( $item['class'] ) ) {
					if ( !is_object( $item['class'] ) and !class_exists( $item['class'], false ) ) {
						continue;
					}
					if ( !method_exists( $item['class'], $item['function'] ) ) {
						continue;
					}
					$ref = new ReflectionMethod( $item['class'], $item['function'] );
					$file = $ref->getFileName();
				} else if ( function_exists( $item['function'] ) ) {
					$ref = new ReflectionFunction( $item['function'] );
					$file = $ref->getFileName();
				} else if ( isset( $item['file'] ) ) {
					$file = $item['file'];
				} else {
					continue;
				}

				$comp = QM_Util::get_file_component( $file );
				$components[$comp->type] = $comp;
			} catch ( ReflectionException $e ) {
				# nothing
			}

		}

		foreach ( QM_Util::get_file_dirs() as $type => $dir ) {
			if ( isset( $components[$type] ) ) {
				return $components[$type];
			}
		}

		# This should not happen

	}

	public function get_trace() {
		return $this->trace;
	}

	public function get_filtered_trace() {

		if ( !isset( $this->filtered_trace ) ) {

			$trace = array_map( array( $this, 'filter_trace' ), $this->trace );
			$trace = array_values( array_filter( $trace ) );

			if ( empty( $trace ) && !empty($this->trace) ) {
				$lowest                 = $this->trace[0];
				$file                   = QM_Util::standard_dir( $lowest['file'], '' );
				$lowest['calling_file'] = $lowest['file'];
				$lowest['calling_line'] = $lowest['line'];
				$lowest['function']     = $file;
				$lowest['display']      = $file;
				$lowest['id']           = $file;
				unset( $lowest['class'], $lowest['args'], $lowest['type'] );
				$trace[0] = $lowest;
			}

			$this->filtered_trace = $trace;

		}

		return $this->filtered_trace;

	}

	public function ignore( $num ) {
		for ( $i = 0; $i < absint( $num ); $i++ ) {
			unset( $this->trace[$i] );
		}
		$this->trace = array_values( $this->trace );
		return $this;
	}

	public function ignore_current_filter() {

		if ( isset( $this->trace[2] ) and isset( $this->trace[2]['function'] ) ) {
			if ( in_array( $this->trace[2]['function'], array( 'apply_filters', 'do_action' ) ) ) {
				$this->ignore( 3 ); # Ignore filter and action callbacks
			}
		}

	}

	public function filter_trace( array $trace ) {

		if ( !self::$filtered and function_exists( 'did_action' ) and did_action( 'plugins_loaded' ) ) {

			# Only run apply_filters on these once
			self::$ignore_class  = apply_filters( 'query_monitor_ignore_class',  self::$ignore_class );
			self::$ignore_method = apply_filters( 'query_monitor_ignore_method', self::$ignore_method );
			self::$ignore_func   = apply_filters( 'query_monitor_ignore_func',   self::$ignore_func );
			self::$show_args     = apply_filters( 'query_monitor_show_args',     self::$show_args );
			self::$filtered = true;

		}

		$return = $trace;

		if ( isset( $trace['class'] ) ) {

			if ( isset( self::$ignore_class[$trace['class']] ) ) {
				$return = null;
			} else if ( isset( self::$ignore_method[$trace['class']][$trace['function']] ) ) {
				$return = null;
			} else if ( 0 === strpos( $trace['class'], 'QM_' ) ) {
				$return = null;
			} else {
				$return['id']      = $trace['class'] . $trace['type'] . $trace['function'] . '()';
				$return['display'] = $trace['class'] . $trace['type'] . $trace['function'] . '()';
			}

		} else {

			if ( isset( self::$ignore_func[$trace['function']] ) ) {

				$return = null;

			} else if ( isset( self::$show_args[$trace['function']] ) ) {

				$show = self::$show_args[$trace['function']];

				if ( 'dir' === $show ) {
					if ( isset( $trace['args'][0] ) ) {
						$arg = QM_Util::standard_dir( $trace['args'][0], '~/' );
						$return['id']      = $trace['function'] . '()';
						$return['display'] = $trace['function'] . "('{$arg}')";
					}
				} else {
					$args = array();
					for ( $i = 0; $i < $show; $i++ ) {
						if ( isset( $trace['args'][$i] ) )
							$args[] = '\'' . $trace['args'][$i] . '\'';
					}
					$return['id']      = $trace['function'] . '()';
					$return['display'] = $trace['function'] . '(' . implode( ',', $args ) . ')';
				}

			} else {

				$return['id']      = $trace['function'] . '()';
				$return['display'] = $trace['function'] . '()';

			}

		}

		if ( $return ) {

			$return['calling_file'] = $this->calling_file;
			$return['calling_line'] = $this->calling_line;

		}

		if ( isset( $trace['line'] ) ) {
			$this->calling_line = $trace['line'];
		}
		if ( isset( $trace['file'] ) ) {
			$this->calling_file = $trace['file'];
		}

		return $return;

	}

}
} else {

	add_action( 'init', 'QueryMonitor::symlink_warning' );

}


text:
set -euo pipefail

OPERATOR_PACKAGE=kf-operator/

# Set up fake GOPATH
FAKE_GOPATH="$(mktemp -d)"
mkdir -p ${FAKE_GOPATH}/src/
cp -r ./vendor/* ${FAKE_GOPATH}/src/
FAKE_REPOPATH="${FAKE_GOPATH}/src/${OPERATOR_PACKAGE}"
mkdir -p "$(dirname "${FAKE_REPOPATH}")" && ln -s "$PWD" "${FAKE_REPOPATH}"

# Cleanup on exit
trap 'rm -rf ${FAKE_GOPATH}' EXIT

GOPATH=${FAKE_GOPATH}

export GO111MODULE=on

source "$(dirname "${BASH_SOURCE[0]}")/../vendor/knative.dev/hack/library.sh"
readonly OPERATOR_REPO_DIR="${REPO_ROOT_DIR}/operator"
source "${OPERATOR_REPO_DIR}/hack/library.sh"

CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${OPERATOR_REPO_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}

KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${OPERATOR_REPO_DIR}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)}

# generate the code with:
# --output-base    because this script should also be able to run inside the vendor dir of
#                  k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
#                  instead of the $GOPATH directly. For normal projects this can be dropped.
bash ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
  kf-operator/pkg/client kf-operator/pkg/apis \
  "operand:v1alpha1 kfsystem:v1alpha1" \
  --go-header-file ${OPERATOR_REPO_DIR}/hack/boilerplate/boilerplate.go.txt

bash ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \
  kf-operator/pkg/client kf-operator/pkg/apis \
  "operand:v1alpha1 kfsystem:v1alpha1" \
  --go-header-file ${OPERATOR_REPO_DIR}/hack/boilerplate/boilerplate.go.txt

# Depends on generate-groups.sh to install bin/deepcopy-gen
${GOPATH}/bin/deepcopy-gen \
  -O zz_generated.deepcopy \
  --go-header-file ${OPERATOR_REPO_DIR}/hack/boilerplate/boilerplate.go.txt \
  -i kf-operator/pkg/apis/kfsystem/kf \
  -i kf-operator/pkg/apis/kfsystem/v1alpha1 \

# Generate the mock interfaces
echo "Generating mock interfaces"
pushd ${OPERATOR_REPO_DIR}/pkg/operand
go run github.com/golang/mock/mockgen -source=api.go \
  -destination=mock/mock_api.go \
  -package=mock
popd

# Make sure our dependencies are up-to-date
${OPERATOR_REPO_DIR}/hack/update-deps.sh

redpajama_set_name: RedPajamaGithub


text:
class ActionDispatch::Routing::Mapper

  def comfy_route_cms(options = {})
    namespace :cms, :path => options[:path] do
      get 'cms-css/:site_id/:identifier' => 'content#render_css', :as => 'render_css'
      get 'cms-js/:site_id/:identifier'  => 'content#render_js',  :as => 'render_js'

      if options[:sitemap]
        get '(:cms_path)/sitemap' => 'content#render_sitemap',
          :as           => 'render_sitemap',
          :constraints  => {:format => /xml/},
          :format       => :xml
      end

      get '/' => 'content#render_html', :as => 'render_html', :path => "(*cms_path)"
    end
  end
end


text:
@interface PodsDummy_Pods_JACenterButton_Specta : NSObject
@end
@implementation PodsDummy_Pods_JACenterButton_Specta
@end


text:
using System.Collections.Generic;
using Umbraco.Cms.Core.Events;

namespace Umbraco.Cms.Core.Notifications
{
    public abstract class EmptyingRecycleBinNotification<T> : StatefulNotification, ICancelableNotification where T : class
    {
        protected EmptyingRecycleBinNotification(IEnumerable<T>? deletedEntities, EventMessages messages)
        {
            DeletedEntities = deletedEntities;
            Messages = messages;
        }

        public IEnumerable<T>? DeletedEntities { get; }

        public EventMessages Messages { get; }

        public bool Cancel { get; set; }
    }
}


text:
zaa.controller("CmsadminCreateController", function($scope, $q, $http) {

	$scope.data = {};
	$scope.data.isInline = false;

	$scope.save = function() {

		var headers = {"headers" : { "Content-Type" : "application/x-www-form-urlencoded; charset=UTF-8" }};

		return $q(function(resolve, reject) {

			if ($scope.data.nav_item_type == 1) {
				$http.post('admin/api-cms-nav/create-page', $.param($scope.data), headers).success(function(response) {
					resolve(response);
				}).error(function(response) {
					reject(response);
				});
			}

			if ($scope.data.nav_item_type == 2) {
				$http.post('admin/api-cms-nav/create-module', $.param($scope.data), headers).success(function(response) {
					resolve(response);
				}).error(function(response) {
					reject(response);
				});
			}
		});
	}
});

zaa.controller("CmsadminCreateInlineController", function($scope, $q, $http) {

	$scope.data = {
		nav_id : $scope.$parent.NavController.id
	};

	$scope.data.isInline = true;

	$scope.save = function() {

		$scope.data.lang_id = $scope.lang.id;

		var headers = {"headers" : { "Content-Type" : "application/x-www-form-urlencoded; charset=UTF-8" }};

		return $q(function(resolve, reject) {

			if ($scope.data.nav_item_type == 1) {
				$http.post('admin/api-cms-nav/create-page-item', $.param($scope.data), headers).success(function(response) {
					resolve(response);
				}).error(function(response) {
					reject(response);
				});
			}

			if ($scope.data.nav_item_type == 2) {
				$http.post('admin/api-cms-nav/create-module-item', $.param($scope.data), headers).success(function(response) {
					resolve(response);
				}).error(function(response) {
					reject(response);
				});
			}
		})
	}

});


text:
package uk.co.real_logic.aeron.driver.event;

import uk.co.real_logic.agrona.MutableDirectBuffer;
import uk.co.real_logic.agrona.collections.Int2ObjectHashMap;

/**
 * Event types and encoding/decoding
 */
public enum EventCode
{
    FRAME_IN(1, EventCodec::dissectAsFrame),
    FRAME_OUT(2, EventCodec::dissectAsFrame),
    CMD_IN_ADD_PUBLICATION(3, EventCodec::dissectAsCommand),
    CMD_IN_REMOVE_PUBLICATION(4, EventCodec::dissectAsCommand),
    CMD_IN_ADD_SUBSCRIPTION(5, EventCodec::dissectAsCommand),

    CMD_IN_REMOVE_SUBSCRIPTION(6, EventCodec::dissectAsCommand),
    CMD_OUT_PUBLICATION_READY(7, EventCodec::dissectAsCommand),
    CMD_OUT_CONNECTION_READY(8, EventCodec::dissectAsCommand),
    INVOCATION(9, EventCodec::dissectAsInvocation),
    EXCEPTION(10, EventCodec::dissectAsException),

    MALFORMED_FRAME_LENGTH(11, EventCodec::dissectAsCommand),
    CMD_OUT_ON_OPERATION_SUCCESS(12, EventCodec::dissectAsCommand),
    CMD_IN_KEEPALIVE_CLIENT(13, EventCodec::dissectAsCommand),
    REMOVE_PUBLICATION_CLEANUP(14, EventCodec::dissectAsString),
    REMOVE_SUBSCRIPTION_CLEANUP(15, EventCodec::dissectAsString),

    REMOVE_CONNECTION_CLEANUP(16, EventCodec::dissectAsString),
    CMD_OUT_ON_INACTIVE_CONNECTION(17, EventCodec::dissectAsCommand),
    FRAME_IN_DROPPED(18, EventCodec::dissectAsFrame),
    ERROR_DELETING_FILE(19, EventCodec::dissectAsString),

    INVALID_VERSION(22, EventCodec::dissectAsCommand),

    CHANNEL_CREATION(23, EventCodec::dissectAsString);

    private static final Int2ObjectHashMap<EventCode> EVENT_CODE_BY_ID_MAP = new Int2ObjectHashMap<>();

    @FunctionalInterface
    private interface DissectFunction
    {
        String dissect(final EventCode code, final MutableDirectBuffer buffer, final int offset, final int length);
    }

    private long tagBit;
    private final int id;
    private final DissectFunction dissector;

    static
    {
        for (final EventCode e : EventCode.values())
        {
            EVENT_CODE_BY_ID_MAP.put(e.id(), e);
        }
    }

    EventCode(final int id, final DissectFunction dissector)
    {
        this.id = id;
        this.tagBit = 1L << id;
        this.dissector = dissector;
    }

    public int id()
    {
        return id;
    }

    /**
     * returns the event code's tag bit. Each tag bit is a unique identifier for the event code used
     * when checking that the event code is enabled or not. Each EventCode has a unique tag bit.
     *
     * @return the tag bit
     */
    public long tagBit()
    {
        return tagBit;
    }

    public static EventCode get(final int id)
    {
        final EventCode code = EVENT_CODE_BY_ID_MAP.get(id);

        if (null == code)
        {
            throw new IllegalArgumentException("No EventCode for ID: " + id);
        }

        return code;
    }

    public String decode(final MutableDirectBuffer buffer, final int offset, final int length)
    {
        return dissector.dissect(this, buffer, offset, length);
    }
}


text:
<histogram-configuration>

<histograms>

<variants name="UserEligibilityTiming">

  <variant name="" summary="when the mic button is pressed"/>
  <variant name=".Startup" summary="on browser startup"/>
</variants>

<histogram name="Assistant.BetterOnboarding.Click"
    enum="AssistantBetterOnboardingType" expires_after="2023-05-01">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    The number of times Assistant better onboarding buttons are clicked.

</histogram>

<histogram name="Assistant.ButtonClickCount" enum="AssistantButtonId"
    expires_after="2023-03-21">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    The number of times buttons on Assistant UI (e.g., minimize) are clicked.

</histogram>

<histogram name="Assistant.ContextEnabledUserCount" enum="BooleanEnabled"
    expires_after="2023-03-21">
  <owner>updowndota@chromium.org</owner>
  <owner>xiaohuic@chromium.org</owner>

    Among eligible users, whether the user has the Assistant context (related
    info) enabled. Recorded once for every UMA upload. The set of eligible users
    includes all users with profiles that can allow Assistant service to be
    enabled (AssistantAllowedState is limited by locale, policy, etc).

</histogram>

<histogram name="Assistant.DspHotwordDetection"
    enum="DspHotwordDetectionStatus" expires_after="2023-04-23">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Counts the number of times Dsp hotword gets detected in each status, to help
    capture the hotword false acceptance rate.

</histogram>

<histogram name="Assistant.EntryPoint" enum="AssistantEntryPoint"
    expires_after="2023-04-16">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Record the Assistant entry point where Assistant UI becomes visible.
    ChromeOS only.

</histogram>

<histogram name="Assistant.ExitPoint" enum="AssistantExitPoint"
    expires_after="2023-02-12">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Record the Assistant exit point where Assistant UI becomes invisible.
    ChromeOS only.

</histogram>

<histogram name="Assistant.HotwordEnableNotification" enum="BooleanHit"
    expires_after="2023-10-31">
  <owner>updowndota@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Counts the number of times user click the hotword enable notification to
    open Assistant settings.

</histogram>

<histogram name="Assistant.Interaction.Resolution"
    enum="AssistantInteractionResolution" expires_after="2023-05-01">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Record the Assistant interaction resolution code. It indicates how the
    Assistant server interpreted a particular query and decision on the state,
    e.g. if the conversation is normal or timed out or ended with other errors.

</histogram>

<histogram name="Assistant.Libassistant.DlcInstallResult"
    enum="Assistant.LibassistantDlcInstallResult" expires_after="2023-06-30">
  <owner>wutao@chromium.org</owner>
  <owner>assistive-eng@google.com</owner>

    The result of an attempt to install the libassistant DLC package. Emitted
    when the Assistant service installs the DLC.

</histogram>

<histogram name="Assistant.Libassistant.DlcLoadStatus"
    enum="Assistant.LibassistantDlcLoadStatus" expires_after="2023-06-30">
  <owner>wutao@chromium.org</owner>
  <owner>assistive-eng@google.com</owner>

    Records if the libassistant DLC is loaded successfully. Emitted when the
    libassistant service initializes.

</histogram>

<histogram name="Assistant.OptInFlow.GetSettingsRequestTime" units="ms"
    expires_after="2023-10-15">
  <owner>updowndota@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Amount of time between get settings request and response. The request will
    be sent for each time the Assistant OptIn Flow is triggered to get string
    texts from the server.

</histogram>

<histogram name="Assistant.OptInFlow.LoadingTimeoutCount" units="timeouts"
    expires_after="2023-04-09">
  <owner>updowndota@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Number of times that the loading timeout triggers. The loading timeout is
    set by the Assistant OptIn Flow loading screen, which shows up during the
    server string texts and webviews are pending.

</histogram>

<histogram name="Assistant.OptInFlowStatus" enum="AssistantOptInFlowStatus"
    expires_after="2023-04-10">
  <owner>updowndota@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>
  Record the status of the Assistant opt-in flow.
</histogram>

<histogram name="Assistant.QueryCountPerEntryPoint" enum="AssistantEntryPoint"
    expires_after="2023-10-31">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>
  Number of queries fired for each entry point.
</histogram>

<histogram name="Assistant.QueryResponseType" enum="AssistantQueryResponseType"
    expires_after="2023-03-19">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>
  The Assistant query response type.
</histogram>

<histogram name="Assistant.QuerySource" enum="AssistantQuerySource"
    expires_after="2023-05-01">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    The source of Assistant query (e.g. dialog plate text field, voice input).
    Recorded when the query is committed.

</histogram>

<histogram name="Assistant.ServiceEnabledUserCount" enum="BooleanEnabled"
    expires_after="2023-05-01">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    Among eligible users, whether the user has the Assistant service enabled.
    Recorded once for every UMA upload. The set of eligible users includes all
    users with profiles that can allow Assistant service to be enabled
    (AssistantAllowedState is limited by locale, policy, etc).

</histogram>

<histogram name="Assistant.ServiceReadyTime" units="ms"
    expires_after="2023-08-15">
  <owner>xiaohuic@chromium.org</owner>
  <owner>assistive-eng@google.com</owner>

    Amount of time between when the Assistant service is launched, and when the
    Assistant back-end signals it is ready to process queries.

</histogram>

<histogram name="Assistant.ServiceStartTime" units="ms"
    expires_after="2023-08-15">
  <owner>updowndota@chromium.org</owner>
  <owner>xiaohuic@chromium.org</owner>
  <owner>assistive-eng@google.com</owner>
  Amount of time spent in starting Assistant service.
</histogram>

<histogram name="Assistant.ServiceState" enum="State"
    expires_after="2023-10-31">
  <owner>wutao@chromium.org</owner>
  <owner>assistive-eng@google.com</owner>

    Records the number of Assistant manager service in each state, to help
    capture the service failure rate. Recorded when the service state changes.

</histogram>

<histogram name="Assistant.SetDspHotwordLocale" enum="BooleanSuccess"
    expires_after="2023-05-01">
  <owner>xiaohuic@chromium.org</owner>
  <owner>croissant-eng@chromium.org</owner>

    For each attempt to set the hotword locale for a DSP device, counts whether
    the attempt succeeded.

</histogram>

<histogram name="Assistant.VoiceSearch.AgsaVersion{Timing}" units="Version"
    expires_after="2023-03-05">
  <owner>basiaz@google.com</owner>
  <owner>chrome-language@google.com</owner>

    (Android only) Reports the current Agsa version on the device. The version
    is reported as described in GSAState#parseAgsaMajorMinorVersionAsInteger.

    This is reported {Timing}.

  <token key="Timing" variants="UserEligibilityTiming"/>
</histogram>

<histogram name="Assistant.VoiceSearch.ConsentOutcome"
    enum="AssistantConsentOutcome" expires_after="2023-03-05">
  <owner>basiaz@google.com</owner>
  <owner>chrome-language@google.com</owner>

    (Android only) Reports the outcome of the consent dialog shown for the
    assistant.

</histogram>

<histogram name="Assistant.VoiceSearch.UserEligibility.FailureReason{Timing}"
    enum="EligibilityFailureReason" expires_after="2023-03-05">
  <owner>basiaz@google.com</owner>
  <owner>chrome-language@google.com</owner>

    (Android only) Reports why users failed the eligibility check for the
    feature.

    Before M90, this histogram only reported the FailureReason which failed the
    eligibility check. If a client failed for multiple reasons, some would be
    ignored.

    From M90 onwards, this will report all FailureReasons that effect
    eligibility.

    This is reported {Timing}.

  <token key="Timing" variants="UserEligibilityTiming"/>
</histogram>

<histogram name="Assistant.VoiceSearch.UserEligibility{Timing}"
    enum="BooleanEligible" expires_after="2023-03-05">
  <owner>basiaz@google.com</owner>
  <owner>chrome-language@google.com</owner>

    (Android only) Reports user eligibility for Assistant voice search. This is
    reported even when the feature is disabled.

    This is reported {Timing}.

  <token key="Timing" variants="UserEligibilityTiming"/>
</histogram>

</histograms>

</histogram-configuration>


text: <img src="{{ chart.get_image }}" />


text:
package org.apache.lucene.analysis.es;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.BaseTokenStreamTestCase;

public class TestSpanishAnalyzer extends BaseTokenStreamTestCase {
  /** This test fails with NPE when the
   * stopwords file is missing in classpath */
  public void testResourcesAvailable() {
    new SpanishAnalyzer(TEST_VERSION_CURRENT);
  }

  /** test stopwords and stemming */
  public void testBasics() throws IOException {
    Analyzer a = new SpanishAnalyzer(TEST_VERSION_CURRENT);
    // stemming
    checkOneTermReuse(a, "chicana", "chican");
    checkOneTermReuse(a, "chicano", "chican");
    // stopword
    assertAnalyzesTo(a, "los", new String[] {});
  }

  /** test use of exclusion set */
  public void testExclude() throws IOException {
    Set<String> exclusionSet = new HashSet<String>();
    exclusionSet.add("chicano");
    Analyzer a = new SpanishAnalyzer(TEST_VERSION_CURRENT,
        SpanishAnalyzer.getDefaultStopSet(), exclusionSet);
    checkOneTermReuse(a, "chicana", "chican");
    checkOneTermReuse(a, "chicano", "chicano");
  }
}


text:
package com.rubengees.rxbus;

import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import io.reactivex.subjects.Subject;

import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.concurrent.locks.ReentrantLock;

/**
 * A simple event bus using RxJava 2.
 *
 * @author Ruben Gees
 */
public class RxBus {

    private final Subject<Object> subject = PublishSubject.create().toSerialized();
    private final HashMap<Class<?>, Integer> registeredObservers = new HashMap<>();

    private final ReentrantLock lock = new ReentrantLock();

    /**
     * Posts the event object on the bus. Interested components can listen for all types of this event with the
     * {@link #register(Class)} method.
     *
     * @param event The event. Can be any class.
     * @return True, if the event was delivered to at least one subscriber.
     */
    public boolean post(@Nonnull final Object event) {
        try {
            lock.lock();

            subject.onNext(event);

            final Integer existingObserverAmount = registeredObservers.get(event.getClass());
            return existingObserverAmount != null && existingObserverAmount > 0;
        } finally {
            lock.unlock();
        }
    }

    /**
     * Returns an {@link Observable} which emits all events of the specified type.
     * <p>
     * Note that it has to be the exact same class, inheritance is not taken into account.
     *
     * @param eventType The type of the event to observe on.
     * @param <T>       The type.
     * @return The Observable.
     */
    @Nonnull
    public <T> Observable<T> register(@Nonnull final Class<T> eventType) {
        return subject
                .filter(event -> event.getClass() == eventType)
                .cast(eventType)
                .doOnSubscribe(disposable -> {
                    try {
                        lock.lock();

                        final Integer existingObserverAmount = registeredObservers.get(eventType);

                        registeredObservers.put(eventType, existingObserverAmount == null ? 1 :
                                existingObserverAmount + 1);
                    } finally {
                        lock.unlock();
                    }
                })
                .doOnDispose(() -> {
                    try {
                        lock.lock();

                        final Integer existingObserverAmount = registeredObservers.get(eventType);

                        if (existingObserverAmount == null || existingObserverAmount - 1 <= 0) {
                            registeredObservers.remove(eventType);
                        } else {
                            registeredObservers.put(eventType, existingObserverAmount - 1);
                        }
                    } finally {
                        lock.unlock();
                    }
                });
    }
}


text:
import Vue from 'vue'
import VueRouter from 'vue-router'
import CodeEditor from 'src/components/CodeEditor'
import moxios from 'moxios'
import moment from 'moment'
import VeeValidate, {Validator} from 'vee-validate'
import simulant from 'simulant'

Validator.installDateTimeValidators(moment)
Vue.use(VeeValidate)

Vue.use(VueRouter)
var router = new VueRouter({
  routes: [
    {path: '/whatever', name: 'whatever', component: {render: h => '-'}},
    {path: '/code', name: 'code', component: CodeEditor}
  ]
})
const vm = new Vue({
  el: document.createElement('div'),
  router: router,
  render: h => h('router-view')
})

describe('CodeEditor.vue', () => {
  beforeEach(function (done) {
    moxios.install()
    router.push({path: 'home', query: {}})
    Vue.nextTick(() => {
      done()
    })
  })
  afterEach(function () {
    moxios.uninstall()
  })
  function routeToCodeEditor (queryParams) {
    router.push({path: 'code', query: queryParams})
  }

  it('should render empty form on new', done => {
    routeToCodeEditor()
    Vue.nextTick(() => {
      expect(vm.$el.querySelector('#codeId').value).to.be.empty
      expect(vm.$el.querySelector('#from').value).to.be.empty
      expect(vm.$el.querySelector('#to').value).to.be.empty
      expect(vm.$el.querySelector('#pub').checked).to.be.true
      expect(vm.$el.querySelector('#payload').textContent).to.be.empty
      expect(vm.$el.querySelector('#save')).to.exist
      expect(vm.$el.querySelector('#delete')).to.not.exist
      expect(vm.$el.querySelector('#generate')).to.exist
      expect(vm.$el.querySelector('#cancel')).to.exist
      done()
    })
  })
  it('should render filled form on edit', done => {
    var responseBody = {
      gameId: 'GM01',
      codeId: 'CD01',
      from: '2017-02-17T02:16:07+00:00',
      to: '2017-02-19T02:16:07+00:00',
      pub: false,
      payload: 'hello'
    }
    moxios.stubRequest(process.env.API_URL + '/games/GM01/codes/CD01', {
      status: 200,
      responseText: JSON.stringify(responseBody)
    })

    routeToCodeEditor({gameId: 'GM01', codeId: 'CD01'})
    Vue.nextTick(() => {
      moxios.wait(() => {
        expect(vm.$el.querySelector('#codeId').value).to.equal('CD01')
        expect(vm.$el.querySelector('#from').value).to.equal('2017-02-17')
        expect(vm.$el.querySelector('#to').value).to.equal('2017-02-19')
        expect(vm.$el.querySelector('#pub').checked).to.be.false
        expect(vm.$el.querySelector('#payload').value).to.equal('hello')
        expect(vm.$el.querySelector('#save')).to.exist
        expect(vm.$el.querySelector('#delete')).to.exist
        expect(vm.$el.querySelector('#generate')).to.not.exist
        expect(vm.$el.querySelector('#cancel')).to.exist
        done()
      })
    })
  })
  it('should re-generate code on button click', done => {
    routeToCodeEditor()
    Vue.nextTick(() => {
      expect(vm.$el.querySelector('#codeId').value).to.be.empty
      let button = vm.$el.querySelector('#generate')
      simulant.fire(button, 'click')
      Vue.nextTick(() => {
        expect(vm.$el.querySelector('#codeId').value).to.match(/^[A-Z0-9]{8}$/)
        done()
      })
    })
  })
})


text:
/**
 *
Smoke tests for the Sling Launchpad

 *
 *
This package contains a minimal set of tests for the Sling launchpad. The
 * tests validate that the launchpad is correctly assembled and that there are
 * no obvious mistakes such as bundles that can't be wired. More extensive
 * tests must be placed in specific test projects.

 *
 *
The launchpad tests don't depend on other Sling bundles,to prevent circular
 * dependencies. As such, there is some duplication of code ( at least intent, if
 * not implementation ) with some of the testing projects. This is another
 * argument for keeping the tests minimal.

 */
package org.apache.sling.launchpad;


text:
# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA

package GenTest::Transform::ExecuteAsInsertSelect;

require Exporter;
@ISA = qw(GenTest GenTest::Transform);

use strict;
use lib 'lib';

use GenTest;
use GenTest::Transform;
use GenTest::Constants;

sub transform {
	my ($class, $original_query, $executor) = @_;

	return STATUS_WONT_HANDLE if $original_query !~ m{^\s*SELECT}sio;

	my $table_name = 'transforms.insert_select_'.$$;

	return [
		"DROP TABLE IF EXISTS $table_name",

		"CREATE TABLE $table_name $original_query",
		"SELECT * FROM $table_name /* TRANSFORM_OUTCOME_UNORDERED_MATCH */",
		"DELETE FROM $table_name",

		"INSERT INTO $table_name $original_query",
		"SELECT * FROM $table_name /* TRANSFORM_OUTCOME_UNORDERED_MATCH */",
		"DELETE FROM $table_name",

		"REPLACE INTO $table_name $original_query",
		"SELECT * FROM $table_name /* TRANSFORM_OUTCOME_UNORDERED_MATCH */",
		"DROP TABLE $table_name"
	];
}

1;


text:
Are you sure you want to sign out?

 you are about to leave the website and logout.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias ipsum laudantium placeat similique. Animi asperiores

                        <button class="btn btn-default">yes</button>
                        <button class="btn btn-danger">no</button>


text:
/* eslint-disable no-console */

import webpack from 'webpack';
import {
  blue, red, yellow, green,
} from 'chalk';
import webpackConfig from '../webpack.config.prod';

console.log(blue('Generating minified bundle for production...'));

webpack(webpackConfig).run((err, stats) => {
  if (err) {
    console.log(red(err));
    return 1;
  }

  const jsonStats = stats.toJson();

  if (jsonStats.hasErrors) {
    return jsonStats.errors.map(error => console.log(red(error)));
  }

  if (jsonStats.hasWarnings) {
    console.log(yellow('Webpack generated some warnings:'));

    jsonStats.warnings.map(warning => console.log(yellow(warning)));
  }

  console.log(`Webpack stats: ${webpack.stats}`);
  console.log(green("Your app has been build for production. Check 'dist' folder"));

  return 0;
});


text:
package org.jadira.usertype.dateandtime.threetenbp.columnmapper;

import java.sql.Timestamp;
import java.util.TimeZone;

import org.jadira.usertype.spi.shared.AbstractTimestampColumnMapper;
import org.jadira.usertype.spi.shared.DatabaseZoneConfigured;
import org.threeten.bp.Instant;
import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.LocalTime;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import org.threeten.bp.format.DateTimeFormatterBuilder;
import org.threeten.bp.temporal.ChronoField;

public class TimestampColumnLocalTimeMapper extends AbstractTimestampColumnMapper<LocalTime> implements DatabaseZoneConfigured<ZoneOffset> {

    private static final long serialVersionUID = 1921591625617366103L;

    public static final DateTimeFormatter LOCAL_DATETIME_PRINTER = new DateTimeFormatterBuilder().appendPattern("0001-01-01 HH:mm:ss").appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true).toFormatter();
    public static final DateTimeFormatter LOCAL_DATETIME_PARSER = new DateTimeFormatterBuilder().appendPattern("yyyy-MM-dd HH:mm:ss").appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true).toFormatter();

	private static final int MILLIS_IN_SECOND = 1000;

    private ZoneOffset databaseZone = ZoneOffset.of("Z");

	public TimestampColumnLocalTimeMapper() {
	}

	public TimestampColumnLocalTimeMapper(ZoneOffset databaseZone) {
		this.databaseZone = databaseZone;
	}

    @Override
    public LocalTime fromNonNullString(String s) {
        return LocalTime.parse(s);
    }

    @Override
    public LocalTime fromNonNullValue(Timestamp value) {

    	ZoneOffset currentDatabaseZone = databaseZone == null ? getDefault() : databaseZone;

        int adjustment = TimeZone.getDefault().getOffset(value.getTime()) - (currentDatabaseZone.getRules().getOffset(LocalDateTime.now()).getTotalSeconds() * MILLIS_IN_SECOND);

        Instant instant = Instant.ofEpochMilli(value.getTime() + adjustment);
        instant = instant.with(ChronoField.NANO_OF_SECOND, value.getNanos());

        LocalDateTime ldt = LocalDateTime.ofInstant(instant, currentDatabaseZone);
        LocalTime localTime = ldt.toLocalTime();

        return localTime;
    }

    @Override
    public String toNonNullString(LocalTime value) {
        return value.toString();
    }

    @Override
    public Timestamp toNonNullValue(LocalTime value) {

    	ZoneOffset currentDatabaseZone = databaseZone == null ? getDefault() : databaseZone;

    	LocalDateTime ldt = value.atDate(LocalDate.of(1970, 1, 1));
    	ZonedDateTime zdt = ldt.atZone(currentDatabaseZone);
        int adjustment = TimeZone.getDefault().getOffset(zdt.toInstant().toEpochMilli()) - (currentDatabaseZone.getRules().getOffset(LocalDateTime.now()).getTotalSeconds() * MILLIS_IN_SECOND);

        final Timestamp timestamp = new Timestamp(zdt.toInstant().toEpochMilli() - adjustment);
        timestamp.setNanos(value.getNano());
        return timestamp;
    }

    private static ZoneOffset getDefault() {

    	ZoneOffset zone = null;
        try {
            try {
                String id = System.getProperty("user.timezone");
                if (id != null) {
                    zone = ZoneOffset.of(id);
                }
            } catch (RuntimeException ex) {
                zone = null;
            }
            if (zone == null) {
                zone = ZoneOffset.of(java.util.TimeZone.getDefault().getID());
            }
        } catch (RuntimeException ex) {
            zone = null;
        }
        if (zone == null) {
            zone = ZoneOffset.of("Z");
        }
        return zone;
    }

    @Override
    public void setDatabaseZone(ZoneOffset databaseZone) {
        this.databaseZone = databaseZone;
    }

	@Override
	public ZoneOffset parseZone(String zoneString) {
		return ZoneOffset.of(zoneString);
	}
}


text:
'use strict';

var h = require('react-hyperscript');
var moment = require('moment');
var React = require('react');
var Router = require('react-router');

var ApplicationAPI = require('../../apis/application.api');

/**
 * Application config page. User can edit
 * attributes of an application.
 */
var ApplicationConfig = React.createClass({

  displayName: 'ApplicationConfig',

  mixins: [Router.Navigation, Router.State],

  getInitialState: function getInitialState() {
    return {
      configs: []
    };
  },

  componentDidMount: function componentDidMount() {
    var self = this;
    var isActiveRoute = this.isActive('applications-config-page', this.props.params, this.props.query);
    var options = {};

    if (!isActiveRoute) {
      ApplicationAPI.getApplicationConfigs(options, function setConfigs(err, configs) {
        if (err) {
          // TODO: handle err
        }
        self.setState({
          configs: configs
        });
      });
    }
  },

  _onSelection: function _onSelection(event) {
    var target = event.target;

    if (target.id) {
      this.transitionTo('application-config-page', {id: target.id});
    }
  },

  _getConfigs: function _getConfigs() {
    var self = this;
    var configs = this.state.configs;

    var configPanels = configs.map(function(config) {
      return h('div', {className: 'col-md-6'}, [
        h('div', {className: 'panel panel-default'}, [
          h('div', {className: 'panel-heading'}, [
            h('h3', {className: 'panel-title _panel-title'}, 'Role: '),
            h('span', config.role),
            h('button', {
              className: 'btn btn-link pull-right',
              onClick: self._onSelection,
              id: config._id
            }, 'Edit')
          ]),
          h('div', {className: 'panel-body'}, [
            h('ul', {className: 'list-unstyled'}, [
              h('li', [
                h('strong', 'Open: '),
                h('span', moment(config.open_at).format('lll'))
              ]),
              h('li', [
                h('strong', 'Close: '),
                h('span', moment(config.close_at).format('lll'))
              ]),
              h('li', [
                h('strong', 'Decision: '),
                h('span', moment(config.decision_at).format('lll'))
              ])
            ])
          ])
        ])
      ]);
    });

    return h('div', [
      configPanels
    ]);
  },

  _getConfigConent: function _getConfigConent() {
    var isActiveRoute = this.isActive('application-config-page', this.props.params, this.props.query);
    var content;

    if (!isActiveRoute) {
      content = this._getConfigs();
    } else {
      content = h(Router.RouteHandler);
    }

    return content;
  },

  render: function render() {
    var content = this._getConfigConent();

    return (
      h('div', {className: 'row'}, [
        h('div', {className: 'col-md-12'}, [
          content
        ])
      ])
    );
  }

});

module.exports = ApplicationConfig;


text:
pub use api::win32;
pub use api::win32::{MonitorId, get_available_monitors, get_primary_monitor};
pub use api::win32::{WindowProxy, PollEventsIterator, WaitEventsIterator};

use Api;
use ContextError;
use CreationError;
use PixelFormat;
use PixelFormatRequirements;
use GlAttributes;
use GlContext;
use WindowAttributes;

use api::egl::ffi::egl::Egl;
use api::egl;
use api::egl::Context as EglContext;

use std::ffi::CString;
use std::ops::{Deref, DerefMut};
use kernel32;

/// Stupid wrapper because `*const libc::c_void` doesn't implement `Sync`.
struct EglWrapper(Egl);
unsafe impl Sync for EglWrapper {}

lazy_static! {
    // An EGL implementation available on the system.
    static ref EGL: Option<EglWrapper> = {
        // the ATI drivers provide an EGL implementation in their DLLs
        let dll_name = if cfg!(target_pointer_width = "64") {
            b"atio6axx.dll\0"
        } else {
            b"atioglxx.dll\0"
        };

        let dll = unsafe { kernel32::LoadLibraryA(dll_name.as_ptr() as *const _) };

        if !dll.is_null() {
            let egl = Egl::load_with(|name| {
                let name = CString::new(name).unwrap();
                unsafe { kernel32::GetProcAddress(dll, name.as_ptr()) as *const _ }
            });

            Some(EglWrapper(egl))

        } else {
            None
        }
    };
}

#[derive(Clone, Default)]
pub struct PlatformSpecificWindowBuilderAttributes;
#[derive(Clone, Default)]
pub struct PlatformSpecificHeadlessBuilderAttributes;

/// The Win32 implementation of the main `Window` object.
pub struct Window(win32::Window);

impl Window {
    /// See the docs in the crate root file.
    #[inline]
    pub fn new(window: &WindowAttributes, pf_reqs: &PixelFormatRequirements,
               opengl: &GlAttributes<&Window>, _: &PlatformSpecificWindowBuilderAttributes)
               -> Result<Window, CreationError>
    {
        win32::Window::new(window, pf_reqs, &opengl.clone().map_sharing(|w| &w.0),
                           EGL.as_ref().map(|w| &w.0)).map(|w| Window(w))
    }
}

impl Deref for Window {
    type Target = win32::Window;

    #[inline]
    fn deref(&self) -> &win32::Window {
        &self.0
    }
}

impl DerefMut for Window {
    #[inline]
    fn deref_mut(&mut self) -> &mut win32::Window {
        &mut self.0
    }
}

///
pub enum HeadlessContext {
    /// A regular window, but invisible.
    HiddenWindow(win32::Window),
    /// An EGL pbuffer.
    EglPbuffer(EglContext),
}

impl HeadlessContext {
    pub fn new(dimensions: (u32, u32), pf_reqs: &PixelFormatRequirements,
               opengl: &GlAttributes<&HeadlessContext>,
               _: &PlatformSpecificHeadlessBuilderAttributes)
               -> Result<HeadlessContext, CreationError>
    {
        // if EGL is available, we try using EGL first
        // if EGL returns an error, we try the hidden window method
        if let &Some(ref egl) = &*EGL {
            let context = EglContext::new(egl.0.clone(), pf_reqs, &opengl.clone().map_sharing(|_| unimplemented!()),       // TODO:
                                          egl::NativeDisplay::Other(None))
                                .and_then(|prototype| prototype.finish_pbuffer(dimensions))
                                .map(|ctxt| HeadlessContext::EglPbuffer(ctxt));

            if let Ok(context) = context {
                return Ok(context);
            }
        }

        let window = try!(win32::Window::new(&WindowAttributes { visible: false, .. Default::default() },
                                             pf_reqs, &opengl.clone().map_sharing(|_| unimplemented!()),            //TODO:
                                             EGL.as_ref().map(|w| &w.0)));
        Ok(HeadlessContext::HiddenWindow(window))
    }
}

impl GlContext for HeadlessContext {
    #[inline]
    unsafe fn make_current(&self) -> Result<(), ContextError> {
        match self {
            &HeadlessContext::HiddenWindow(ref ctxt) => ctxt.make_current(),
            &HeadlessContext::EglPbuffer(ref ctxt) => ctxt.make_current(),
        }
    }

    #[inline]
    fn is_current(&self) -> bool {
        match self {
            &HeadlessContext::HiddenWindow(ref ctxt) => ctxt.is_current(),
            &HeadlessContext::EglPbuffer(ref ctxt) => ctxt.is_current(),
        }
    }

    #[inline]
    fn get_proc_address(&self, addr: &str) -> *const () {
        match self {
            &HeadlessContext::HiddenWindow(ref ctxt) => ctxt.get_proc_address(addr),
            &HeadlessContext::EglPbuffer(ref ctxt) => ctxt.get_proc_address(addr),
        }
    }

    #[inline]
    fn swap_buffers(&self) -> Result<(), ContextError> {
        match self {
            &HeadlessContext::HiddenWindow(ref ctxt) => ctxt.swap_buffers(),
            &HeadlessContext::EglPbuffer(ref ctxt) => ctxt.swap_buffers(),
        }
    }

    #[inline]
    fn get_api(&self) -> Api {
        match self {
            &HeadlessContext::HiddenWindow(ref ctxt) => ctxt.get_api(),
            &HeadlessContext::EglPbuffer(ref ctxt) => ctxt.get_api(),
        }
    }

    #[inline]
    fn get_pixel_format(&self) -> PixelFormat {
        match self {
            &HeadlessContext::HiddenWindow(ref ctxt) => ctxt.get_pixel_format(),
            &HeadlessContext::EglPbuffer(ref ctxt) => ctxt.get_pixel_format(),
        }
    }
}


text:
@extends('layouts.admin')
@section('content')

    Perfil Actualizado de Manera Exitosa

@include('perfiles.modal',['perfil'=>Auth::user(),'categoria'=>$categoria])
@include('perfiles.modal-busqueda')

    Tipo de Usuario : {{$categoria}}

@endsection
@section('scripts')
{!!Html::script('js/script-perfil.js')!!}
@endsection


text:
package Perun::beans::TaskResult;

use strict;
use warnings;

use Perun::Common;

use overload
'""' => \&toString;

sub toString {
	my $self = shift;

	my $id = $self->{_id};
	my $taskId = $self->{_taskId};
	my $destinationId = $self->{_destinationId};
	my $errorMessage = $self->{_errorMessage};
	my $standardMessage = $self->{_standardMessage};
	my $returnCode = $self->{_returnCode};
	my $timestamp = $self->{_timestamp};
	my $status = $self->{_status};
	my $destination = $self->{_destination};
	my $service = $self->{_service};

	my $str = 'TaskResult (';
	$str .= "id: $id, " if ($id);
	$str .= "taskId: $taskId, " if ($taskId);
	$str .= "destinationId: $destinationId, " if ($destinationId);
	$str .= "errorMessage: $errorMessage, " if ($errorMessage);
	$str .= "standardMessage: $standardMessage, " if ($standardMessage);
	$str .= "returnCode: $returnCode, " if ($returnCode);
	$str .= "timestamp: $timestamp, " if ($timestamp);
	$str .= "status: $status" if ($status);
	$str .= "destination: $destination" if ($destination);
	$str .= "service: $service" if ($service);
	$str .= ')';

	return $str;
}

sub new
{
	bless({});
}

sub fromHash
{
	return Perun::Common::fromHash(@_);
}

sub TO_JSON
{
	my $self = shift;

	my $id;
	if (defined($self->{_id})) {
		$id = $self->{_id}*1;
	} else {
		$id = 0;
	}

	my $taskId;
	if (defined($self->{_taskId})) {
		$taskId = $self->{_taskId}*1;
	} else {
		$taskId = 0;
	}

	my $destinationId;
	if (defined($self->{_destinationId})) {
		$destinationId = $self->{_destinationId}*1;
	} else {
		$destinationId = 0;
	}

	my $errorMessage;
	if (defined($self->{_errorMessage})) {
		$errorMessage = "$self->{_errorMessage}";
	} else {
		$errorMessage = undef;
	}

	my $standardMessage;
	if (defined($self->{_standardMessage})) {
		$standardMessage = "$self->{_standardMessage}";
	} else {
		$standardMessage = undef;
	}

	my $returnCode;
	if (defined($self->{_returnCode})) {
		$returnCode = $self->{_returnCode}*1;
	} else {
		$returnCode = 0;
	}

	my $service;
	if (defined($self->{_service})) {
		$service = $self->{_service};
	} else {
		$service = undef;
	}

	my $timestamp = $self->{_timestamp};
	my $status = $self->{_status};
	my $destination = $self->{_destination};

	return {id => $id, taskId => $taskId, destinationId => $destinationId, errorMessage => $errorMessage, standardMessage => $standardMessage, returnCode => $returnCode, timestamp => $timestamp, status => $status, destination => $destination, service => $service};
}

sub getCommonArrayRepresentation {
	my $self = shift;
	return ($self->{_id}, $self->{_taskId}, $self->{_destinationId}, $self->{_errorMessage},
		$self->{_standardMessage}, $self->{_returnCode}, $self->{_timestamp}, $self->{_status},
		$self->{_destination}->{destination}, $self->{_service}->{name});
}

sub getCommonArrayRepresentationHeading {
	return ('ID','TaskId', 'DestinationId', 'stderr', 'stdout', 'ReturnCode', 'Timestamp', 'Status', 'Destination', 'Service');
}

sub getId
{
	my $self = shift;

	return $self->{_id};
}

sub setId
{
	my $self = shift;
	$self->{_id} = shift;

	return;
}

sub getTaskId
{
	my $self = shift;

	return $self->{_taskId};
}

sub setTaskId
{
	my $self = shift;
	$self->{_taskId} = shift;

	return;
}

sub getDestinationId
{
	my $self = shift;

	return $self->{_destinationId};
}

sub setDestinationId
{
	my $self = shift;
	$self->{_destinationId} = shift;

	return;
}

sub getErrorMessage
{
	my $self = shift;

	return $self->{_errorMessage};
}

sub setErrorMessage
{
	my $self = shift;
	$self->{_errorMessage} = shift;

	return;
}

sub getStandardMessage
{
	my $self = shift;

	return $self->{_standardMessage};
}

sub setStandardMessage
{
	my $self = shift;
	$self->{_standardMessage} = shift;

	return;
}

sub getReturnCode
{
	my $self = shift;

	return $self->{_returnCode};
}

sub setReturnCode
{
	my $self = shift;
	$self->{_returnCode} = shift;

	return;
}

sub getTimestamp
{
	my $self = shift;

	return $self->{_timestamp};
}

sub setTimestamp
{
	my $self = shift;
	$self->{_timestamp} = shift;

	return;
}

sub getStatus
{
	my $self = shift;

	return $self->{_status};
}

sub setStatus
{
	my $self = shift;
	$self->{_status} = shift;

	return;
}

sub getDestination
{
	my $self = shift;

	return $self->{_destination};
}

sub setDestination
{
	my $self = shift;
	$self->{_destination} = shift;

	return;
}

sub getDestinationName
{
	my $destination = shift->{_destination};

	return $destination->{destination};
}

sub setService
{
	my $self = shift;
	$self->{_service} = shift;

	return;
}

sub getServiceName
{
	my $service = shift->{_service};

	return $service->{service};
}
1;


text:
<?php if(!$this->tpl_var['userhash']){ ?>
<?php $this->_compileInclude('header'); ?>

<?php $this->_compileInclude('nav'); ?>

			<?php $this->_compileInclude('menu'); ?>

<?php } ?>

<a href="index.php?<?php echo $this->tpl_var['_app']; ?>-master"><?php echo $this->tpl_var['apps'][$this->tpl_var['_app']]['appname']; ?> /

<a href="index.php?<?php echo $this->tpl_var['_app']; ?>-master-exams&page=<?php echo $this->tpl_var['page']; ?><?php echo $this->tpl_var['u']; ?>">试卷管理 /

手工组卷修改

					手工组卷修改

					<a href="index.php?<?php echo $this->tpl_var['_app']; ?>-master-exams&page=<?php echo $this->tpl_var['page']; ?><?php echo $this->tpl_var['u']; ?>">试卷管理

	        <form action="index.php?exam-master-exams-modify" method="post" class="form-horizontal">

					试卷名称:

			  			<input type="text" name="args[exam]" value="<?php echo $this->tpl_var['exam']['exam']; ?>" needle="needle" msg="您必须为该试卷输入一个名称"/>

					评卷方式

							<input name="args[examdecide]" type="radio" value="1"<?php if($this->tpl_var['exam']['examdecide']){ ?> checked<?php } ?>/>教师评卷

							<input name="args[examdecide]" type="radio" value="0"<?php if(!$this->tpl_var['exam']['examdecide']){ ?> checked<?php } ?>/>学生自评

						教师评卷时有主观题则需要教师在后台评分后才能显示分数,无主观题自动显示分数。

					考试科目:

					  	<?php echo $this->tpl_var['subjects'][$this->tpl_var['exam']['examsubject']]['subject']; ?>

					考试时间:

			  			<input type="text" name="args[examsetting][examtime]" size="4" needle="needle" class="inline" value="<?php echo $this->tpl_var['exam']['examsetting']['examtime']; ?>"/> 分钟

					来源:

			  			<input type="text" name="args[examsetting][comfrom]" value="<?php echo $this->tpl_var['exam']['examsetting']['comfrom']; ?>" size="4"/>

					试卷总分:

			  			<input type="text" name="args[examsetting][score]" value="<?php echo $this->tpl_var['exam']['examsetting']['score']; ?>" size="4" needle="needle" msg="你要为本考卷设置总分" datatype="number"/>

					及格线:

			  			<input type="text" name="args[examsetting][passscore]" value="<?php echo $this->tpl_var['exam']['examsetting']['passscore']; ?>" size="4" needle="needle" msg="你要为本考卷设置一个及格分数线" datatype="number"/>

					题型排序

							<?php if($this->tpl_var['exam']['examsetting']['questypelite']){ ?>
							<?php $eqid = 0;
 foreach($this->tpl_var['exam']['examsetting']['questypelite'] as $key => $qlid){
 $eqid++; ?>
							<a class="btn questpanel panel_<?php echo $key; ?>"><?php echo $this->tpl_var['questypes'][$key]['questype']; ?><input type="hidden" name="args[examsetting][questypelite][<?php echo $key; ?>]" value="1" class="questypepanelinput" id="panel_<?php echo $key; ?>"/>
							<?php } ?>
							<?php } else { ?>
							<?php $qid = 0;
 foreach($this->tpl_var['questypes'] as $key => $questype){
 $qid++; ?>
							<a class="btn questpanel panel_<?php echo $questype['questid']; ?>"><?php echo $questype['questype']; ?><input type="hidden" name="args[examsetting][questypelite][<?php echo $questype['questid']; ?>]" value="1" class="questypepanelinput" id="panel_<?php echo $questype['questid']; ?>"/>
							<?php } ?>
							<?php } ?>

						拖拽进行题型排序

				<?php $qid = 0;
 foreach($this->tpl_var['questypes'] as $key => $questype){
 $qid++; ?>
				<div class="control-group questpanel panel_<?php echo $questype['questid']; ?>">
					<?php echo $questype['questype']; ?>:

						共
						<input id="iselectallnumber_<?php echo $questype['questid']; ?>" type="text" class="input-mini" needle="needle" name="args[examsetting][questype][<?php echo $questype['questid']; ?>][number]" value="<?php echo $this->tpl_var['exam']['examsetting']['questype'][$questype['questid']]['number']; ?>" size="2" msg="您必须填写总题数"/>
						 题,每题 <input class="input-mini" needle="needle" type="text" name="args[examsetting][questype][<?php echo $questype['questid']; ?>][score]" value="<?php echo $this->tpl_var['exam']['examsetting']['questype'][$questype['questid']]['score']; ?>" size="2" msg="您必须填写每题的分值"/>
						 分,描述 <input class="input-mini" type="text" name="args[examsetting][questype][<?php echo $questype['questid']; ?>][describe]" value="<?php echo $this->tpl_var['exam']['examsetting']['questype'][$questype['questid']]['describe']; ?>" size="12"/>
						 已选题数:<a id="ialreadyselectnumber_<?php echo $key; ?>"><?php echo intval($this->tpl_var['exam']['examnumber'][$key]); ?>  题
						 <a class="selfmodal btn" href="javascript:;" data-target="#modal" url="index.php?exam-master-exams-selected&questionids={iselectquestions_<?php echo $key; ?>}&rowsquestionids={iselectrowsquestions_<?php echo $key; ?>}" valuefrom="iselectquestions_<?php echo $key; ?>|iselectrowsquestions_<?php echo $key; ?>">看题
						 <a class="selfmodal btn" href="javascript:;" data-target="#modal" url="index.php?exam-master-exams-selectquestions&search[questionsubjectid]=<?php echo $this->tpl_var['exam']['examsubject']; ?>&search[questiontype]=<?php echo $key; ?>&questionids={iselectquestions_<?php echo $key; ?>}&rowsquestionids={iselectrowsquestions_<?php echo $key; ?>}&useframe=1" valuefrom="iselectquestions_<?php echo $key; ?>|iselectrowsquestions_<?php echo $key; ?>">选题
	  					<input type="hidden" id="iselectquestions_<?php echo $key; ?>" name="args[examquestions][<?php echo $key; ?>][questions]" value="<?php echo $this->tpl_var['exam']['examquestions'][$key]['questions']; ?>"/>
	  					<input type="hidden" id="iselectrowsquestions_<?php echo $key; ?>" name="args[examquestions][<?php echo $key; ?>][rowsquestions]" value="<?php echo $this->tpl_var['exam']['examquestions'][$key]['rowsquestions']; ?>"/>

				<?php } ?>

						<button class="btn btn-primary" type="submit">提交</button>
						<input type="hidden" name="submitsetting" value="1"/>
						<input name="examid" type="hidden" value="<?php echo $this->tpl_var['exam']['examid']; ?>">

			</form>

					<button aria-hidden="true" class="close" type="button" data-dismiss="modal">×</button>

						试题列表

					 <button aria-hidden="true" class="btn" data-dismiss="modal">完成</button>

<?php if(!$this->tpl_var['userhash']){ ?>

<?php } ?>


text:
using System;

namespace QuickGraph.Providers
{
	using QuickGraph.Concepts;
	using QuickGraph.Concepts.Providers;

	/// <summary>
	/// Default edge provider
	/// </summary>
	public sealed class EdgeProvider : IEdgeProvider
	{
		private int m_NextID = 0;

		/// <summary>
		/// Edge type.
		/// </summary>
		public Type EdgeType
		{
			get
			{
				return typeof(Edge);
			}
		}

		/// <summary>
		/// Creates a new edge
		/// </summary>
		/// <param name="u"></param>
		/// <param name="v"></param>
		/// <returns></returns>
		public Edge ProvideEdge(Vertex u, Vertex v)
		{
			return new Edge(m_NextID++,u,v);
		}
		IEdge IEdgeProvider.ProvideEdge(IVertex u, IVertex v)
		{
			return this.ProvideEdge((Vertex)u, (Vertex)v);
		}

		/// <summary>
		/// Updates an edge that has not been created with the provider
		/// </summary>
		/// <param name="e">edge to update</param>
		public void UpdateEdge(Edge e)
		{
			e.ID = m_NextID++;
		}

		/// <summary>
		/// Updates vertex
		/// </summary>
		/// <param name="e"></param>
		void IEdgeProvider.UpdateEdge(IEdge e)
		{
			this.UpdateEdge((Edge)e);
		}
	}
}


text:
var uploader = require('../lib/uploader');

var options = {
    url: 'http://localhost/labs/zhengxie/upload.php',
    files: {
      'file1': 'file1.txt',
      'file2': 'file2.txt'
    },
    data: {
      username: 'xiaobai'
    }
}

var callback = function(err, response){
  console.log(response);
}

uploader.upload(options, callback);


text:
local _, Engine = ...
local Module = Engine:NewModule("Blizzard: PlayerPowerBarAlt")

Module.OnInit = function(self)
	local content = _G.PlayerPowerBarAlt
	if (not content) then
		return
	end

	local config = self:GetDB("Blizzard").altpower

	local holder = Engine:CreateFrame("Frame", nil, "UICenter")
	holder:Place(unpack(config.position))

	content:SetMovable(true)
	content:SetUserPlaced(true)
	content:ClearAllPoints()
	content:SetPoint("BOTTOM", holder, "BOTTOM", 0, 0)

	_G.UIPARENT_MANAGED_FRAME_POSITIONS["PlayerPowerBarAlt"] = nil

	local lockdown
	hooksecurefunc(content, "SetPoint", function(self, _, anchor)
		if (not lockdown) then
			lockdown = true
			holder:SetWidth(self:GetWidth())
			holder:SetHeight(self:GetHeight())
			self:ClearAllPoints()
			self:SetPoint("BOTTOM", holder, "BOTTOM", 0, 0)
			lockdown = false
		end
	end)

end