text:
var app = {};

(function() {
	'use strict';

	$(document).on("APPLICATION_READY", function (event, register) {
		console.info("[Eagle] Angular bootstrap...");

		var STATE_NAME_MATCH = /^[^.]*/;
		var state_next;
		var state_current;
		var param_next;
		var param_current;

		var modules = {};
		$.each(register.moduleList, function (i, module) {
			modules[module.application] = module;
		});

		// ======================================================================================
		// =                                   Initialization                                   =
		// ======================================================================================
		var eagleApp = angular.module('eagleApp', ['ngRoute', 'ngAnimate', 'ui.router', 'eagleControllers', 'eagle.service'].concat(register.appList));

		// ======================================================================================
		// =                                   Router config                                    =
		// ======================================================================================
		var defaultRouterStates = ['site', 'alertList', 'policyList', 'streamList', 'policyCreate', 'policyEdit', 'alertDetail', 'policyDetail'];

		function routeResolve(config) {
			var resolve = {};
			if(config === false) return resolve;

			config = $.extend({
				auth: true,
				site: true,
				application: true
			}, config);

			if(config.auth) {
				// TODO: need auth module
			}

			resolve.Server = function (Server) {
				return Server.getPromise();
			};

			resolve.Site = function (Site) {
				return Site.getPromise(config);
			};

			resolve.Application = function (Application) {
				return Application.getPromise();
			};

			resolve._router = function (Site, $wrapState, $q) {
				var name = state_next.name;
				var siteId = param_next.siteId;
				if (siteId && defaultRouterStates.indexOf(name) === -1) {
					return Site.getPromise(config).then(function () {
						var match =  false;
						$.each(common.getValueByPath(Site.find(siteId), ["applicationList"]), function (i, app) {
							var appType = app.descriptor.type;
							var module = modules[appType];
							if(!module) return;

							if(common.array.find(name, module.routeList, ["state"])) {
								match = true;
								return false;
							}
						});

						if(!match) {
							console.log("[Application] No route match:", name);
							$wrapState.go("site", {siteId: siteId});
							return $q.reject(false);
						}
					});
				} else {
					return true;
				}
			};

			resolve.Time = function (Time) {
				return Time.getPromise(config, state_next, param_next);
			};

			return resolve;
		}

		eagleApp.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $animateProvider) {
			$urlRouterProvider.otherwise("/");
			$stateProvider
				// ================================== Home ==================================
				.state('home', {
					url: "/",
					templateUrl: "partials/home.html?_=" + window._TRS(),
					controller: "homeCtrl",
					resolve: routeResolve()
				})
				.state('setup', {
					url: "/setup",
					templateUrl: "partials/setup.html?_=" + window._TRS(),
					controller: "setupCtrl",
					resolve: routeResolve({ site: false, application: false })
				})

				// ================================== Auth ==================================
				.state('login', {
					url: "/login",
					templateUrl: "partials/login.html?_=" + window._TRS(),
					controller: "loginCtrl",
					resolve: routeResolve()
				})

				// =============================== Integration ==============================
				.state('integration', {
					abstract: true,
					url: "/integration/",
					templateUrl: "partials/integration/main.html?_=" + window._TRS(),
					controller: "integrationCtrl",
					resolve: routeResolve(false)
				})
				.state('integration.siteList', {
					url: "siteList",
					templateUrl: "partials/integration/siteList.html?_=" + window._TRS(),
					controller: "integrationSiteListCtrl",
					resolve: routeResolve({ application: false })
				})
				.state('integration.site', {
					url: "site/:id",
					templateUrl: "partials/integration/site.html?_=" + window._TRS(),
					controller: "integrationSiteCtrl",
					resolve: routeResolve({ application: false })
				})
				.state('integration.applicationList', {
					url: "applicationList",
					templateUrl: "partials/integration/applicationList.html?_=" + window._TRS(),
					controller: "integrationApplicationListCtrl",
					resolve: routeResolve({ application: false })
				})
				.state('integration.publisherList', {
					url: "publisherList",
					templateUrl: "partials/integration/publisherList.html?_=" + window._TRS(),
					controller: "integrationPublisherListCtrl",
					resolve: routeResolve({ application: false })
				})

				// ================================= Metric =================================
				.state('metricPreview', {
					url: "/metric/preview?startTime&endTime&site&metric&groups&fields",
					templateUrl: "partials/metric/preview.html?_=" + window._TRS(),
					controller: "metricPreviewCtrl",
					reloadOnSearch: false,
					resolve: routeResolve({ application: false, time: true })
				})

				// ================================== Site ==================================
				.state('site', {
					url: "/site/:siteId",
					templateUrl: "partials/site/home.html?_=" + window._TRS(),
					controller: "siteCtrl",
					resolve: routeResolve()
				})

				// ============================== Site: Alerts ==============================
				.state('alertList', {
					url: "/site/:siteId/alerts?startTime&endTime",
					templateUrl: "partials/alert/list.html?_=" + window._TRS(),
					controller: "alertListCtrl",
					resolve: routeResolve({ time: { autoRefresh: true } })
				})
				.state('policyList', {
					url: "/site/:siteId/policies",
					templateUrl: "partials/alert/policyList.html?_=" + window._TRS(),
					controller: "policyListCtrl",
					resolve: routeResolve()
				})
				.state('streamList', {
					url: "/site/:siteId/streams",
					templateUrl: "partials/alert/streamList.html?_=" + window._TRS(),
					controller: "alertStreamListCtrl",
					resolve: routeResolve()
				})

				.state('policyCreate', {
					url: "/site/:siteId/policy/create",
					templateUrl: "partials/alert/policyEdit/main.html?_=" + window._TRS(),
					controller: "policyCreateCtrl",
					resolve: routeResolve()
				})
				.state('policyEdit', {
					url: "/site/:siteId/policy/edit/{name}",
					templateUrl: "partials/alert/policyEdit/main.html?_=" + window._TRS(),
					controller: "policyEditCtrl",
					resolve: routeResolve()
				})

				.state('alertDetail', {
					url: "/site/:siteId/alert/detail/{alertId}?timestamp",
					templateUrl: "partials/alert/detail.html?_=" + window._TRS(),
					controller: "alertDetailCtrl",
					resolve: routeResolve()
				})
				.state('policyDetail', {
					url: "/site/:siteId/policy/detail/{name}",
					templateUrl: "partials/alert/policyDetail.html?_=" + window._TRS(),
					controller: "policyDetailCtrl",
					resolve: routeResolve()
				})
			;

			// =========================== Application States ===========================
			$.each(register.routeList, function (i, route) {
				var config = $.extend({}, route.config);

				var resolve = {};
				var resolveConfig = {};
				if(route.config.resolve) {
					$.each(route.config.resolve, function (key, value) {
						if (typeof value === "function") {
							resolve[key] = value;
						} else {
							resolveConfig[key] = value;
						}
					});
				}
				config.resolve = $.extend(routeResolve(resolveConfig), resolve);

				$stateProvider.state(route.state, config);
			});

			/* $httpProvider.interceptors.push(function($q) {
				function eagleRequestHandle(res) {
					var data = res.data || {
						exception: "",
						message: ""
					};
					if(res.status === -1) {
						$.dialog({
							title: "AJAX Failed",
							content: $("<pre>")
								.text("url:\n" + common.getValueByPath(res, ["config", "url"]))
						});
					} else if(data.success === false || res.status === 404) {
						$.dialog({
							title: "AJAX Error",
							content: $("<pre>")
								.text(
									"url:\n" + common.getValueByPath(res, ["config", "url"]) + "\n\n" +
									"status:\n" + res.status + "\n\n" +
									"exception:\n" + data.exception + "\n\n" +
									"message:\n" + data.message
								)
						});
					}
					return res;
				}

				return {
					response: eagleRequestHandle,
					responseError: function(res) {
						return $q.reject(eagleRequestHandle(res));
					}
				};
			}); */
		});

		// ======================================================================================
		// =                                   Main Controller                                  =
		// ======================================================================================
		eagleApp.controller('MainCtrl', function (
			$scope, $wrapState, $urlRouter, $notification, $authHttp,
			Server, PageConfig, Portal, Widget, Entity, CompatibleEntity,
			Site, Application, UI, Time, Policy, Alert, Auth) {
			window._WrapState = $scope.$wrapState = $wrapState;
			window._Server = $scope.Server = Server;
			window._PageConfig = $scope.PageConfig = PageConfig;
			window._Portal = $scope.Portal = Portal;
			window._Widget = $scope.Widget = Widget;
			window._Entity = $scope.Entity = Entity;
			window._CompatibleEntity = $scope.CompatibleEntity = CompatibleEntity;
			window._Site = $scope.Site = Site;
			window._Application = $scope.Application = Application;
			window._UI = $scope.UI = UI;
			window._Time = $scope.Time = Time;
			window._Policy = $scope.Policy = Policy;
			window._Notification = $scope.$notification = $notification;
			window._Alert = $scope.Alert = Alert;
			window._Auth = $scope.Auth = Auth;
			window._AuthHttp = $scope.$authHttp = $authHttp;
			$scope.common = common;

			$scope._TRS = window._TRS();

			Object.defineProperty(window, "scope", {
				get: function () {
					var ele = $("#content .nav-tabs-custom.ng-scope .ng-scope[ui-view], #content .ng-scope[ui-view]").last();
					return angular.element(ele).scope();
				}
			});

			// ============================== Route Update ==============================
			$scope.$on('$stateChangeStart', function (event, next, nextParam, current, currentParam) {
				console.log("[Switch] current ->", current, currentParam);
				console.log("[Switch] next ->", next, nextParam);

				state_next = next || {};
				state_current = current || {};
				param_next = nextParam;
				param_current = currentParam;

				var currentName = (current || {}).name || "";
				var nextName = (next || {}).name || "";

				// Page initialization
				if(currentName.match(STATE_NAME_MATCH)[0] !== nextName.match(STATE_NAME_MATCH)[0]) {
					PageConfig.reset();
				}
			});

			$scope.$on('$stateChangeSuccess', function (event) {
				var _innerSearch = Time._innerSearch;
				Time._innerSearch = null;
				if(_innerSearch) {
					setTimeout(function () {
						$wrapState.go(".", $.extend({}, $wrapState.param, _innerSearch), {location: "replace", notify: false});
					}, 0);
				}
				console.log("[Switch] done ->", event);
			});

			// ================================ Function ================================
			// Get Page class by submenu
			$scope.getPageNavClass = function (subportals) {
				var classname = "";
				if (typeof subportals === 'undefined') {
					return "";
				}
				$.each(subportals, function (i) {
					if (classname === "active") {
						return;
					}
					classname = $scope.getNavClass(subportals[i]);
				});
				return classname;

			};

			// Get side bar navigation item class
			$scope.getNavClass = function (portal) {
				var path = (portal.path || "").replace(/^#/, '');

				if ($wrapState.path() === path) {
					return "active";
				} else {
					return "";
				}
			};

			// Customize time range
			$scope.customizeTimeRange = function () {
				$("#eagleStartTime").val(Time.format("startTime"));
				$("#eagleEndTime").val(Time.format("endTime"));
				$("#eagleTimeRangeMDL").modal();
			};

			$scope.updateTimeAutoRefresh = function () {
				Time.autoRefresh = !Time.autoRefresh;
			};

			$scope.setLastDuration = function (hours) {
				var endTime = new Time();
				var startTime = endTime.clone().subtract(hours, "hours");
				Time.timeRange(startTime, endTime);
			};

			$scope.updateTimeRange = function () {
				var startTime = Time.verifyTime($("#eagleStartTime").val());
				var endTime = Time.verifyTime($("#eagleEndTime").val());
				if(startTime && endTime) {
					Time.timeRange(startTime, endTime);
					$("#eagleTimeRangeMDL").modal("hide");
				} else {
					alert("Time range not validate");
				}
			};

			// ================================== Init ==================================
			$.each(register.portalList, function (i, config) {
				Portal.register(config.portal, config.isSite);
			});

			$.each(register.widgetList, function (i, config) {
				Widget.register(config.widget, config.isSite);
			});
		});

		// ======================================================================================
		// =                                      Bootstrap                                     =
		// ======================================================================================
		//noinspection JSCheckFunctionSignatures
		angular.element(document).ready(function() {
			console.info("[Eagle] UI start...");

			//noinspection JSCheckFunctionSignatures
			angular.bootstrap(document, ['eagleApp']);

			$("body").removeClass("ng-init-lock");
			$("#appLoadTip").remove();
		});
	});
})();


text:
#ifndef GPixel_DEFINED
#define GPixel_DEFINED

#include "GTypes.h"

#define GPIXEL_SHIFT_A  24
#define GPIXEL_SHIFT_R  16
#define GPIXEL_SHIFT_G   8
#define GPIXEL_SHIFT_B   0

/**
 *  Defines our 32bit pixel to be just an int. It stores its components based
 *  on the defines GPIXEL_SHIFT_... for each component.
 */
typedef uint32_t GPixel;

///////////////////////////////////////////////////////////////////////////////

static inline int GPixel_GetA(GPixel p) { return (p >> GPIXEL_SHIFT_A) & 0xFF; }
static inline int GPixel_GetR(GPixel p) { return (p >> GPIXEL_SHIFT_R) & 0xFF; }
static inline int GPixel_GetG(GPixel p) { return (p >> GPIXEL_SHIFT_G) & 0xFF; }
static inline int GPixel_GetB(GPixel p) { return (p >> GPIXEL_SHIFT_B) & 0xFF; }

/*
 *  Asserts that a, r, g, b are already in premultiply form, and simiply
 *  packs them into a GPixel.
 */
static inline GPixel GPixel_PackARGB(unsigned a, unsigned r,
                                     unsigned g, unsigned b) {
    GASSERT(a <= 255);
    GASSERT(r <= a);
    GASSERT(g <= a);
    GASSERT(b <= a);

    return  (a << GPIXEL_SHIFT_A) |
            (r << GPIXEL_SHIFT_R) |
            (g << GPIXEL_SHIFT_G) |
            (b << GPIXEL_SHIFT_B);
}

#endif

redpajama_set_name: RedPajamaGithub


text:
.class public abstract Lcom/mediatek/mmsdk/IMemoryHeap$Stub;
.super Landroid/os/Binder;
.source "IMemoryHeap.java"

# interfaces
.implements Lcom/mediatek/mmsdk/IMemoryHeap;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/mediatek/mmsdk/IMemoryHeap;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x409
    name = "Stub"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/mediatek/mmsdk/IMemoryHeap$Stub$Proxy;
    }
.end annotation

# static fields
.field private static final DESCRIPTOR:Ljava/lang/String; = "com.mediatek.mmsdk.IMemoryHeap"

.field static final TRANSACTION_getBase:I = 0x2

.field static final TRANSACTION_getFlags:I = 0x4

.field static final TRANSACTION_getHeapID:I = 0x1

.field static final TRANSACTION_getOffset:I = 0x5

.field static final TRANSACTION_getSize:I = 0x3

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 15
    invoke-direct {p0}, Landroid/os/Binder;-><init>()V

    .line 16
    const-string v0, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p0, p0, v0}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub;->attachInterface(Landroid/os/IInterface;Ljava/lang/String;)V

    .line 17
    return-void
.end method

.method public static asInterface(Landroid/os/IBinder;)Lcom/mediatek/mmsdk/IMemoryHeap;
    .locals 2
    .param p0, "obj"    # Landroid/os/IBinder;

    .prologue
    .line 24
    if-nez p0, :cond_0

    .line 25
    const/4 v0, 0x0

    .line 31
    :goto_0
    return-object v0

    .line 27
    :cond_0
    const-string v1, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-interface {p0, v1}, Landroid/os/IBinder;->queryLocalInterface(Ljava/lang/String;)Landroid/os/IInterface;

    move-result-object v0

    .line 28
    .local v0, "iin":Landroid/os/IInterface;
    if-eqz v0, :cond_1

    instance-of v1, v0, Lcom/mediatek/mmsdk/IMemoryHeap;

    if-eqz v1, :cond_1

    .line 29
    check-cast v0, Lcom/mediatek/mmsdk/IMemoryHeap;

    goto :goto_0

    .line 31
    :cond_1
    new-instance v0, Lcom/mediatek/mmsdk/IMemoryHeap$Stub$Proxy;

    .end local v0    # "iin":Landroid/os/IInterface;
    invoke-direct {v0, p0}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub$Proxy;-><init>(Landroid/os/IBinder;)V

    goto :goto_0
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 0

    .prologue
    .line 35
    return-object p0
.end method

.method public onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    .locals 5
    .param p1, "code"    # I
    .param p2, "data"    # Landroid/os/Parcel;
    .param p3, "reply"    # Landroid/os/Parcel;
    .param p4, "flags"    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v3, 0x1

    .line 39
    sparse-switch p1, :sswitch_data_0

    .line 91
    invoke-super {p0, p1, p2, p3, p4}, Landroid/os/Binder;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    move-result v3

    :goto_0
    return v3

    .line 43
    :sswitch_0
    const-string v4, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p3, v4}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    goto :goto_0

    .line 48
    :sswitch_1
    const-string v4, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p2, v4}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 50
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    .line 52
    .local v0, "_arg0":I
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v1

    .line 53
    .local v1, "_arg1":I
    invoke-virtual {p0, v0, v1}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub;->getHeapID(II)I

    move-result v2

    .line 54
    .local v2, "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 55
    invoke-virtual {p3, v2}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 60
    .end local v0    # "_arg0":I
    .end local v1    # "_arg1":I
    .end local v2    # "_result":I
    :sswitch_2
    const-string v4, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p2, v4}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 61
    invoke-virtual {p0}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub;->getBase()I

    move-result v2

    .line 62
    .restart local v2    # "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 63
    invoke-virtual {p3, v2}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 68
    .end local v2    # "_result":I
    :sswitch_3
    const-string v4, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p2, v4}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 69
    invoke-virtual {p0}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub;->getSize()I

    move-result v2

    .line 70
    .restart local v2    # "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 71
    invoke-virtual {p3, v2}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 76
    .end local v2    # "_result":I
    :sswitch_4
    const-string v4, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p2, v4}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 77
    invoke-virtual {p0}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub;->getFlags()I

    move-result v2

    .line 78
    .restart local v2    # "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 79
    invoke-virtual {p3, v2}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 84
    .end local v2    # "_result":I
    :sswitch_5
    const-string v4, "com.mediatek.mmsdk.IMemoryHeap"

    invoke-virtual {p2, v4}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 85
    invoke-virtual {p0}, Lcom/mediatek/mmsdk/IMemoryHeap$Stub;->getOffset()I

    move-result v2

    .line 86
    .restart local v2    # "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 87
    invoke-virtual {p3, v2}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 39
    nop

    :sswitch_data_0
    .sparse-switch
        0x1 -> :sswitch_1
        0x2 -> :sswitch_2
        0x3 -> :sswitch_3
        0x4 -> :sswitch_4
        0x5 -> :sswitch_5
        0x5f4e5446 -> :sswitch_0
    .end sparse-switch
.end method


text:
export interface Player {
    id?: number;
    name: string;
    teamname: string;
    totalpins: number;
    games: number;
    average: number;
    handicap: number;
}


text:
namespace realm {
class Realm;

namespace _impl {

class WeakRealmNotifier : public WeakRealmNotifierBase {
public:
    WeakRealmNotifier(const std::shared_ptr<Realm>& realm, bool cache);
    ~WeakRealmNotifier();

    WeakRealmNotifier(WeakRealmNotifier&&);
    WeakRealmNotifier& operator=(WeakRealmNotifier&&);

    WeakRealmNotifier(const WeakRealmNotifier&) = delete;
    WeakRealmNotifier& operator=(const WeakRealmNotifier&) = delete;

    // Asynchronously call notify() on the Realm on the appropriate thread
    void notify();

private:
    CFRunLoopRef m_runloop;
    CFRunLoopSourceRef m_signal;
};

} // namespace _impl
} // namespace realm


text:
module Myob
  module Api
    module Model
      class Tax < Base
        def model_route
          'Payroll/PayrollCategory/Tax'
        end
      end
    end
  end
end


text:
<?php

namespace Components\Wiki\Models;

use Hubzero\Database\Relational;
use Date;
use Lang;

/**
 * Wiki model for page URIs
 */
class Link extends Relational
{
	/**
	 * The table namespace
	 *
	 * @var  string
	 */
	protected $namespace = 'wiki';

	/**
	 * Default order by for model
	 *
	 * @var  string
	 */
	public $orderBy = 'created';

	/**
	 * Default order direction for select queries
	 *
	 * @var  string
	 */
	public $orderDir = 'asc';

	/**
	 * Fields and their validation criteria
	 *
	 * @var  array
	 */
	protected $rules = array(
		'page_id' => 'positive|nonzero',
		'scope'   => 'notempty'
	);

	/**
	 * Automatic fields to populate every time a row is created
	 *
	 * @var  array
	 */
	public $initiate = array(
		'timestamp'
	);

	/**
	 * Generates automatic owned by field value
	 *
	 * @param   array  $data  The data being saved
	 * @return  string
	 */
	public function automaticTimestamp($data)
	{
		if (!isset($data['timestamp']))
		{
			$data['timestamp'] = Date::of('now')->toSql();
		}
		return $data['timestamp'];
	}

	/**
	 * Defines a belongs to one relationship between task and liaison
	 *
	 * @return  object
	 */
	public function page()
	{
		return $this->belongsToOne('Page', 'page_id');
	}

	/**
	 * Return a formatted timestamp for created date
	 *
	 * @param   string  $as
	 * @param   string  $format
	 * @return  string
	 */
	public function created($as='', $format=null)
	{
		$as = strtolower($as);

		if ($as == 'date')
		{
			return Date::of($this->get('timestamp'))->toLocal(Lang::txt('DATE_FORMAT_HZ1'));
		}

		if ($as == 'time')
		{
			return Date::of($this->get('timestamp'))->toLocal(Lang::txt('TIME_FORMAT_HZ1'));
		}

		if ($format)
		{
			return Date::of($this->get('timestamp'))->toLocal($format);
		}

		return $this->get('timestamp');
	}

	/**
	 * Delete all entries for a specific page
	 *
	 * @param   array    $links
	 * @return  boolean  True on success
	 */
	public function addLinks($links=array())
	{
		if (count($links) <= 0)
		{
			return true;
		}

		$timestamp = Date::toSql();

		foreach ($links as $link)
		{
			if (!$link['page_id'])
			{
				$this->addError('Missing page ID for link "%s"', $link['link']);
				continue;
			}
			$row = self::blank();
			$row->set('page_id', intval($link['page_id']));
			$row->set('timestamp', $timestamp);
			$row->set('scope', $link['scope']);
			$row->set('scope_id', intval($link['scope_id']));
			$row->set('link', $link['link']);
			$row->set('url', $link['url']);

			if (!$row->save())
			{
				$this->addError($row->getError());
				return false;
			}
		}

		return true;
	}

	/**
	 * Update entries
	 *
	 * @param   integer  $page_id  Page ID
	 * @param   array    $data
	 * @return  boolean  True on success
	 */
	public function updateLinks($page_id, $data=array())
	{
		$links = array();

		foreach ($data as $data)
		{
			// Eliminate duplicates
			$links[$data['link']] = $data;
		}

		$rows = self::all()
			->whereEquals('page_id', $page_id)
			->rows();

		foreach ($rows as $row)
		{
			if (!isset($links[$row->get('link')]))
			{
				// Link wasn't found, delete it
				$row->destroy();
			}
			else
			{
				unset($links[$row->get('link')]);
			}
		}

		if (count($links) > 0)
		{
			return $this->addLinks($links);
		}

		return true;
	}
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.07.02 at 03:35:23 PM MSK
//

package ru.gov.zakupki.oos.types._1;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import ru.gov.zakupki.oos.base._1.PrintFormFileType;
import ru.gov.zakupki.oos.base._1.SignatureType;

/**
 * Электронный документ, полученный из внешней системы
 *
 *
Java class for zfcs_extPrintFormType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="zfcs_extPrintFormType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <choice>
 *           <element name="content" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
 *           <element name="url">
 *             <simpleType>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *                 <maxLength value="1024"/>
 *               </restriction>
 *             </simpleType>
 *           </element>
 *         </choice>
 *         <element name="signature">
 *           <complexType>
 *             <simpleContent>
 *               <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
 *                 <attribute name="type" type="{http://zakupki.gov.ru/oos/base/1}signatureType" />
 *               </extension>
 *             </simpleContent>
 *           </complexType>
 *         </element>
 *         <element name="fileType" type="{http://zakupki.gov.ru/oos/base/1}printFormFileType"/>
 *         <element name="controlPersonalSignature" minOccurs="0">
 *           <complexType>
 *             <simpleContent>
 *               <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
 *                 <attribute name="type" type="{http://zakupki.gov.ru/oos/base/1}signatureType" />
 *               </extension>
 *             </simpleContent>
 *           </complexType>
 *         </element>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "zfcs_extPrintFormType", propOrder = {
    "content",
    "url",
    "signature",
    "fileType",
    "controlPersonalSignature"
})
public class ZfcsExtPrintFormType {

    protected byte[] content;
    protected String url;
    @XmlElement(required = true)
    protected ZfcsExtPrintFormType.Signature signature;
    @XmlElement(required = true)
    @XmlSchemaType(name = "string")
    protected PrintFormFileType fileType;
    protected ZfcsExtPrintFormType.ControlPersonalSignature controlPersonalSignature;

    /**
     * Gets the value of the content property.
     *
     * @return
     *     possible object is
     *     byte[]
     */
    public byte[] getContent() {
        return content;
    }

    /**
     * Sets the value of the content property.
     *
     * @param value
     *     allowed object is
     *     byte[]
     */
    public void setContent(byte[] value) {
        this.content = value;
    }

    /**
     * Gets the value of the url property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getUrl() {
        return url;
    }

    /**
     * Sets the value of the url property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUrl(String value) {
        this.url = value;
    }

    /**
     * Gets the value of the signature property.
     *
     * @return
     *     possible object is
     *     {@link ZfcsExtPrintFormType.Signature }
     *
     */
    public ZfcsExtPrintFormType.Signature getSignature() {
        return signature;
    }

    /**
     * Sets the value of the signature property.
     *
     * @param value
     *     allowed object is
     *     {@link ZfcsExtPrintFormType.Signature }
     *
     */
    public void setSignature(ZfcsExtPrintFormType.Signature value) {
        this.signature = value;
    }

    /**
     * Gets the value of the fileType property.
     *
     * @return
     *     possible object is
     *     {@link PrintFormFileType }
     *
     */
    public PrintFormFileType getFileType() {
        return fileType;
    }

    /**
     * Sets the value of the fileType property.
     *
     * @param value
     *     allowed object is
     *     {@link PrintFormFileType }
     *
     */
    public void setFileType(PrintFormFileType value) {
        this.fileType = value;
    }

    /**
     * Gets the value of the controlPersonalSignature property.
     *
     * @return
     *     possible object is
     *     {@link ZfcsExtPrintFormType.ControlPersonalSignature }
     *
     */
    public ZfcsExtPrintFormType.ControlPersonalSignature getControlPersonalSignature() {
        return controlPersonalSignature;
    }

    /**
     * Sets the value of the controlPersonalSignature property.
     *
     * @param value
     *     allowed object is
     *     {@link ZfcsExtPrintFormType.ControlPersonalSignature }
     *
     */
    public void setControlPersonalSignature(ZfcsExtPrintFormType.ControlPersonalSignature value) {
        this.controlPersonalSignature = value;
    }

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

     * <complexType>
     *   <simpleContent>
     *     <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
     *       <attribute name="type" type="{http://zakupki.gov.ru/oos/base/1}signatureType" />
     *     </extension>
     *   </simpleContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "value"
    })
    public static class ControlPersonalSignature {

        @XmlValue
        protected byte[] value;
        @XmlAttribute(name = "type")
        protected SignatureType type;

        /**
         * Gets the value of the value property.
         *
         * @return
         *     possible object is
         *     byte[]
         */
        public byte[] getValue() {
            return value;
        }

        /**
         * Sets the value of the value property.
         *
         * @param value
         *     allowed object is
         *     byte[]
         */
        public void setValue(byte[] value) {
            this.value = value;
        }

        /**
         * Gets the value of the type property.
         *
         * @return
         *     possible object is
         *     {@link SignatureType }
         *
         */
        public SignatureType getType() {
            return type;
        }

        /**
         * Sets the value of the type property.
         *
         * @param value
         *     allowed object is
         *     {@link SignatureType }
         *
         */
        public void setType(SignatureType value) {
            this.type = value;
        }

    }

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

     * <complexType>
     *   <simpleContent>
     *     <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
     *       <attribute name="type" type="{http://zakupki.gov.ru/oos/base/1}signatureType" />
     *     </extension>
     *   </simpleContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "value"
    })
    public static class Signature {

        @XmlValue
        protected byte[] value;
        @XmlAttribute(name = "type")
        protected SignatureType type;

        /**
         * Gets the value of the value property.
         *
         * @return
         *     possible object is
         *     byte[]
         */
        public byte[] getValue() {
            return value;
        }

        /**
         * Sets the value of the value property.
         *
         * @param value
         *     allowed object is
         *     byte[]
         */
        public void setValue(byte[] value) {
            this.value = value;
        }

        /**
         * Gets the value of the type property.
         *
         * @return
         *     possible object is
         *     {@link SignatureType }
         *
         */
        public SignatureType getType() {
            return type;
        }

        /**
         * Sets the value of the type property.
         *
         * @param value
         *     allowed object is
         *     {@link SignatureType }
         *
         */
        public void setType(SignatureType value) {
            this.type = value;
        }

    }

}


text:
using System.IO;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Util;

namespace Sitecore.AdvancedSearch.Analyzers
{
    public class StemmingAnalyzerNoStopFilter : Analyzer
    {
        private readonly Version _version;
        public StemmingAnalyzerNoStopFilter(Version version)
        {
            _version = version;
        }
        public override TokenStream TokenStream(string fieldName, TextReader reader)
        {
            TokenStream result =
                new LowerCaseFilter(

                    new StandardTokenizer(_version, reader));
            return result;
        }
    }
}


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

import ghidra.util.classfinder.ExtensionPoint;

/**
 * NOTE:  ALL ProgramBasedDynamicTableColumnExtensionPoint CLASSES MUST END IN "TableColumn".  If not,
 * the ClassSearcher will not find them.
 */
public abstract class ProgramBasedDynamicTableColumnExtensionPoint<ROW_TYPE, COLUMN_TYPE> extends
		AbstractProgramBasedDynamicTableColumn<ROW_TYPE, COLUMN_TYPE> implements ExtensionPoint {

	// subclasses must implement

	public ProgramBasedDynamicTableColumnExtensionPoint() {
		super();
	}

	public ProgramBasedDynamicTableColumnExtensionPoint(String uniqueID) {
		super(uniqueID);
	}
}


text:
package org.scalactic

/**
 * Provides an implicit conversion that enables pretty to be invoked on any
 * object, to transform that object into a String representation.
 */
trait PrettyMethods {

  /**
   * Implicit class that adds a pretty method to any object.
   *
   *

   * The constructor of this class, besides taking an object o to prettify,
   * also takes an implicit Prettifier that the pretty method will use to prettify the
   * object.
   *

   *
   * @param o the object to prettify
   * @param prettifier an implicit Prettifier that will be used
   *     to prettify the passed object o
   */
  implicit class Prettyizer(o: Any)(implicit prettifier: Prettifier) {

    /**
     * Returns a pretty String representation of the object o
     */
    def pretty: String = prettifier(o)
  }
}

/**
 * Companion object for trait PrettyMethods enabling its members to be imported as an
 * alternative to mixing them in.
 */
object PrettyMethods extends PrettyMethods


text:
<Data>
    <Contract>
        <RequestHandlers>
            <RequestHandler Classification="spectrads3" Name="com.spectralogic.s3.server.handler.reqhandler.spectrads3.job.GetJobRequestHandler">
                <Request Action="SHOW" HttpVerb="GET" IncludeIdInPath="true" Resource="JOB" ResourceType="NON_SINGLETON">
                    <OptionalQueryParams/>
                    <RequiredQueryParams/>
                </Request>
                <ResponseCodes>
                    <ResponseCode>
                        200
                        <ResponseTypes>
                            <ResponseType Type="com.spectralogic.s3.server.domain.JobWithChunksApiBean"/>
                        </ResponseTypes>
                    </ResponseCode>
                </ResponseCodes>
                <Version>12.D2E1E5F53C787AAE87CD6C64E57DF392</Version>
            </RequestHandler>
        </RequestHandlers>
    </Contract>
</Data>


text:
"""
Demonstrate the use of motmot.wxglvideo.simple_overlay.
"""

import pkg_resources
import numpy
import wx
import motmot.wxglvideo.demo as demo
import motmot.wxglvideo.simple_overlay as simple_overlay

SIZE=(240,320)

class DemoOverlapApp( demo.DemoApp ):
    def OnAddDisplay(self,event):
        if not hasattr(self, 'overlay_canvas'):
            self.main_panel = wx.Panel( self.target_panel )
            self.main_panel_sizer = wx.BoxSizer(wx.VERTICAL)
            self.main_panel.SetSizer(self.main_panel_sizer)
            self.target_box.Add(  self.main_panel, 1, wx.EXPAND )

            self.overlay_canvas = simple_overlay.DynamicImageCanvas(self.main_panel)
            self.main_panel_sizer.Add(  self.overlay_canvas, 1, wx.EXPAND )

            self.horiz_panel = wx.Panel( self.main_panel )
            self.horiz_panel_sizer = wx.BoxSizer(wx.HORIZONTAL)
            self.horiz_panel.SetSizer(self.horiz_panel_sizer)
            self.main_panel_sizer.Add(  self.horiz_panel, 0, wx.EXPAND )

            self.target_panel.Layout()
            self.count = 0
            self.id_vals = []
            self.widgets = {}

        self.count += 1
        ni = numpy.random.uniform( 0, 255, SIZE).astype(numpy.uint8)
        id_val = 'id %d'%self.count

        if 1:
            ctrl = wx.StaticText( self.horiz_panel, label=id_val)
            self.horiz_panel_sizer.Add(  ctrl, wx.LEFT, border=5 )

            btn = wx.Button(self.horiz_panel, -1, "close")
            btn.id_val = id_val # store data in wx object
            wx.EVT_BUTTON(btn, btn.GetId(), self.OnCloseView)
            self.horiz_panel_sizer.Add(  btn, 0, wx.RIGHT, border=5 )
            self.widgets[id_val] = [ctrl, btn]

        self.overlay_canvas.update_image(id_val, ni)
        self.id_vals.append( id_val )

        self.target_panel.Layout()

    def OnTimer(self, event):
        if hasattr(self,'id_vals'):
            points = [ (10,10) ]
            linesegs = [ (20,10, 20,30) ]
            for id_val in self.id_vals:
                ni = numpy.random.uniform( 0, 255, SIZE).astype(numpy.uint8)
                self.overlay_canvas.update_image_and_drawings(id_val, ni,
                                                              points=points,
                                                              linesegs=linesegs,
                                                              )

    def OnCloseView(self, event):
        widget = event.GetEventObject()
        id_val = widget.id_val # retrieve id value
        idx = self.id_vals.index(id_val)
        del self.id_vals[idx]
        self.overlay_canvas.delete_image(id_val)
        for widget in self.widgets[id_val]:
            self.horiz_panel_sizer.Remove( widget )
            widget.Destroy()
            self.horiz_panel_sizer.Layout()
def main():
    import os
    if int(os.environ.get('NO_REDIRECT','0')):
        kw = {}
    else:
	kw = dict(redirect=True,filename='demo.log')
    app = DemoOverlapApp(**kw)
    app.MainLoop()

if __name__=='__main__':
    main()


text:
<?php

namespace AppBundle\Form\Handler;

use FOS\UserBundle\Form\Handler\RegistrationFormHandler as BaseHandler;
use FOS\UserBundle\Model\UserInterface;

class RegistrationFormHandler extends BaseHandler
{
    public function process($confirmation = false)
    {
        $user = $this->userManager->createUser()->addRole('ROLE_USER');
        $this->form->setData($user);

        if ('POST' == $this->request->getMethod()) {
            $this->form->bind($this->request);
            if ($this->form->isValid()) {

                $this->onSuccess($user, $confirmation);

                return true;
            }
        }

        return false;
    }
}


text:
#include "bytecode-data.h"
#include "jrt.h"
#include "vm.h"
#include "opcodes.h"
#include "opcodes-ecma-support.h"

/**
 * 'Try' opcode handler.
 *
 * See also: ECMA-262 v5, 12.14
 *
 * @return completion value
 *         Returned value must be freed with ecma_free_completion_value
 */
ecma_completion_value_t
opfunc_try_block (vm_instr_t instr, /**< instruction */
                  vm_frame_ctx_t *frame_ctx_p) /**< interpreter context */
{
  const vm_idx_t block_end_oc_idx_1 = instr.data.try_block.oc_idx_1;
  const vm_idx_t block_end_oc_idx_2 = instr.data.try_block.oc_idx_2;
  const vm_instr_counter_t try_end_oc = (vm_instr_counter_t) (
    vm_calc_instr_counter_from_idx_idx (block_end_oc_idx_1, block_end_oc_idx_2) + frame_ctx_p->pos);

  frame_ctx_p->pos++;

  vm_run_scope_t run_scope_try = { frame_ctx_p->pos, try_end_oc };
  ecma_completion_value_t try_completion = vm_loop (frame_ctx_p, &run_scope_try);
  JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos <= try_end_oc)
                || (ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos == try_end_oc));
  frame_ctx_p->pos = try_end_oc;

  vm_instr_t next_instr = vm_get_instr (frame_ctx_p->bytecode_header_p->instrs_p, frame_ctx_p->pos);
  JERRY_ASSERT (next_instr.op_idx == VM_OP_META);

  if (next_instr.data.meta.type == OPCODE_META_TYPE_CATCH)
  {
    const vm_instr_counter_t catch_end_oc = (vm_instr_counter_t) (
      vm_read_instr_counter_from_meta (OPCODE_META_TYPE_CATCH,
                                       frame_ctx_p->bytecode_header_p,
                                       frame_ctx_p->pos) + frame_ctx_p->pos);
    frame_ctx_p->pos++;

    if (ecma_is_completion_value_throw (try_completion))
    {
      next_instr = vm_get_instr (frame_ctx_p->bytecode_header_p->instrs_p, frame_ctx_p->pos);
      JERRY_ASSERT (next_instr.op_idx == VM_OP_META);
      JERRY_ASSERT (next_instr.data.meta.type == OPCODE_META_TYPE_CATCH_EXCEPTION_IDENTIFIER);

      lit_cpointer_t catch_exc_val_var_name_lit_cp = bc_get_literal_cp_by_uid (next_instr.data.meta.data_1,
                                                                               frame_ctx_p->bytecode_header_p,
                                                                               frame_ctx_p->pos);
      frame_ctx_p->pos++;

      ecma_string_t *catch_exc_var_name_str_p = ecma_new_ecma_string_from_lit_cp (catch_exc_val_var_name_lit_cp);

      ecma_object_t *old_env_p = frame_ctx_p->lex_env_p;
      ecma_object_t *catch_env_p = ecma_create_decl_lex_env (old_env_p);
      ecma_completion_value_t completion = ecma_op_create_mutable_binding (catch_env_p,
                                                                           catch_exc_var_name_str_p,
                                                                           false);
      JERRY_ASSERT (ecma_is_completion_value_empty (completion));

      completion = ecma_op_set_mutable_binding (catch_env_p,
                                                catch_exc_var_name_str_p,
                                                ecma_get_completion_value_value (try_completion),
                                                false);
      JERRY_ASSERT (ecma_is_completion_value_empty (completion));

      ecma_deref_ecma_string (catch_exc_var_name_str_p);

      frame_ctx_p->lex_env_p = catch_env_p;

      ecma_free_completion_value (try_completion);

      vm_run_scope_t run_scope_catch = { frame_ctx_p->pos, catch_end_oc };
      try_completion = vm_loop (frame_ctx_p, &run_scope_catch);

      frame_ctx_p->lex_env_p = old_env_p;

      ecma_deref_object (catch_env_p);

      JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos <= catch_end_oc)
                    || (ecma_is_completion_value_empty (try_completion) && frame_ctx_p->pos == catch_end_oc));
    }

    frame_ctx_p->pos = catch_end_oc;
  }

  next_instr = vm_get_instr (frame_ctx_p->bytecode_header_p->instrs_p, frame_ctx_p->pos);
  JERRY_ASSERT (next_instr.op_idx == VM_OP_META);

  if (next_instr.data.meta.type == OPCODE_META_TYPE_FINALLY)
  {
    const vm_instr_counter_t finally_end_oc = (vm_instr_counter_t) (
      vm_read_instr_counter_from_meta (OPCODE_META_TYPE_FINALLY,
                                       frame_ctx_p->bytecode_header_p,
                                       frame_ctx_p->pos) + frame_ctx_p->pos);
    frame_ctx_p->pos++;

    vm_run_scope_t run_scope_finally = { frame_ctx_p->pos, finally_end_oc };
    ecma_completion_value_t finally_completion = vm_loop (frame_ctx_p, &run_scope_finally);

    JERRY_ASSERT ((!ecma_is_completion_value_empty (finally_completion) && frame_ctx_p->pos <= finally_end_oc)
                  || (ecma_is_completion_value_empty (finally_completion) && frame_ctx_p->pos == finally_end_oc));
    frame_ctx_p->pos = finally_end_oc;

    if (!ecma_is_completion_value_empty (finally_completion))
    {
      ecma_free_completion_value (try_completion);
      try_completion = finally_completion;
    }
  }

  next_instr = vm_get_instr (frame_ctx_p->bytecode_header_p->instrs_p, frame_ctx_p->pos++);
  JERRY_ASSERT (next_instr.op_idx == VM_OP_META);
  JERRY_ASSERT (next_instr.data.meta.type == OPCODE_META_TYPE_END_TRY_CATCH_FINALLY);

  return try_completion;
} /* opfunc_try_block */


text:
package org.apache.camel.management;

import java.util.Date;
import javax.management.MBeanServer;
import javax.management.ObjectName;

import org.apache.camel.builder.RouteBuilder;

/**
 * @version
 */
public class ManagedRoutePerformanceCounterTest extends ManagementTestSupport {

    public void testPerformanceCounterStats() throws Exception {
        // JMX tests dont work well on AIX CI servers (hangs them)
        if (isPlatform("aix")) {
            return;
        }

        // get the stats for the route
        MBeanServer mbeanServer = getMBeanServer();
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route1\"");

        Long delta = (Long) mbeanServer.getAttribute(on, "DeltaProcessingTime");
        assertEquals(0, delta.intValue());

        getMockEndpoint("mock:result").expectedMessageCount(1);

        template.asyncSendBody("direct:start", "Hello World");

        // cater for slow boxes
        Integer inFlight = null;
        for (int i = 0; i < 10; i++) {
            Thread.sleep(500);
            inFlight = (Integer) mbeanServer.getAttribute(on, "InflightExchanges");
            if (inFlight.longValue() == 1) {
                break;
            }
        }
        assertNotNull("too slow server", inFlight);
        assertEquals(1, inFlight.longValue());

        assertMockEndpointsSatisfied();

        Thread.sleep(3000);

        Long completed = (Long) mbeanServer.getAttribute(on, "ExchangesCompleted");
        assertEquals(1, completed.longValue());

        delta = (Long) mbeanServer.getAttribute(on, "DeltaProcessingTime");
        Long last = (Long) mbeanServer.getAttribute(on, "LastProcessingTime");
        Long total = (Long) mbeanServer.getAttribute(on, "TotalProcessingTime");

        assertNotNull(delta);
        assertTrue("Should take around 3 sec: was " + last, last > 2900);
        assertTrue("Should take around 3 sec: was " + total, total > 2900);

        // send in another message
        template.sendBody("direct:start", "Bye World");

        completed = (Long) mbeanServer.getAttribute(on, "ExchangesCompleted");
        assertEquals(2, completed.longValue());
        delta = (Long) mbeanServer.getAttribute(on, "DeltaProcessingTime");
        last = (Long) mbeanServer.getAttribute(on, "LastProcessingTime");
        total = (Long) mbeanServer.getAttribute(on, "TotalProcessingTime");

        assertNotNull(delta);
        assertTrue("Should take around 3 sec: was " + last, last > 2900);
        assertTrue("Should be around 5 sec now: was " + total, total > 4900);

        Date reset = (Date) mbeanServer.getAttribute(on, "ResetTimestamp");
        assertNotNull(reset);

        Date lastFailed = (Date) mbeanServer.getAttribute(on, "LastExchangeFailureTimestamp");
        Date firstFailed = (Date) mbeanServer.getAttribute(on, "FirstExchangeFailureTimestamp");
        assertNull(lastFailed);
        assertNull(firstFailed);

        inFlight = (Integer) mbeanServer.getAttribute(on, "InflightExchanges");
        assertEquals(0, inFlight.longValue());
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("log:foo").delay(3000).to("mock:result");
            }
        };
    }

}


text:
BOOST_AUTO_TEST_SUITE(durations_are_valid)

using namespace osrm;
using namespace osrm::util;

BOOST_AUTO_TEST_CASE(all_necessary_test)
{
    BOOST_CHECK_EQUAL(extractor::durationIsValid("00:01"), true);
    BOOST_CHECK_EQUAL(extractor::durationIsValid("00:01:01"), true);
    BOOST_CHECK_EQUAL(extractor::durationIsValid("PT15M"), true);
}

BOOST_AUTO_TEST_CASE(common_durations_get_translated)
{
    BOOST_CHECK_EQUAL(extractor::parseDuration("00:01"), 60);
    BOOST_CHECK_EQUAL(extractor::parseDuration("00:01:01"), 61);
    BOOST_CHECK_EQUAL(extractor::parseDuration("01:01"), 3660);

    // check all combinations of iso duration tokens
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT1M1S"), 61);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT1H1S"), 3601);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT15M"), 900);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT15S"), 15);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT15H"), 54000);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT1H15M"), 4500);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT1H15M1S"), 4501);
}

BOOST_AUTO_TEST_CASE(iso_8601_durations_case_insensitive)
{
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT15m"), 900);
    BOOST_CHECK_EQUAL(extractor::parseDuration("PT1h15m"), 4500);
}

BOOST_AUTO_TEST_SUITE_END()


text:
#import "TestCommon.h"
#import "ETActionHandler.h"
#import "ETApplication.h"
#import "ETArrowTool.h"
#import "ETController.h"
#import "ETLayoutItem.h"
#import "ETLayoutItemGroup.h"
#import "ETLayoutItemFactory.h"
#import "ETSelectTool.h"
#import "ETScrollableAreaItem.h"
#import "ETWindowItem.h"
#import "ETCompatibility.h"
#include <objc/runtime.h>

@interface ETBipActionHandler : ETActionHandler
- (void) bip: (id)sender onItem: (ETLayoutItem *)anItem;
@end

@interface ETFirstResponderActionHandler : ETActionHandler
@end

/* This gives us access to the first main and key responders since we cannot
   use -makeMainWindow since main or key are resigned immediately while running
   tests (at least from Xcode because the test process runs in background). */
@interface ETTestResponderApplication : ETApplication
{

}

- (void) setMainItem: (ETLayoutItem *)anItem;
- (void) setKeyItem: (ETLayoutItem *)anItem;

@end

@interface TestResponder : TestCommon <UKTest>
{
	ETLayoutItem *item;
	ETLayoutItemGroup *mainItem;
	ETScrollableAreaItem *scrollableAreaItem;
	ETWindowItem *windowItem;
	ETController *controller;
	Class previousAppClass;
}

@end

@implementation TestResponder

- (id) init
{
	SUPERINIT;

	previousAppClass = [ETApp class];
	object_setClass([ETApplication sharedApplication], [ETTestResponderApplication class]);

	ETAssert([ETApp isMemberOfClass: [ETTestResponderApplication class]]);

	[self prepareNewResponderChain];

	return self;
}

- (void) dealloc
{
	object_setClass(ETApp, previousAppClass);
	previousAppClass = nil;

	[[itemFactory windowGroup] removeItem: mainItem];
}

// TODO: Write a subclass testing mainItem as -[ETApp mainItem]
- (void) prepareNewResponderChain
{
	item = [itemFactory item];
	scrollableAreaItem = [ETScrollableAreaItem itemWithObjectGraphContext: [itemFactory objectGraphContext]];

	[item setActionHandler: [ETFirstResponderActionHandler sharedInstanceForObjectGraphContext: [item objectGraphContext]]];
	[item setDecoratorItem: scrollableAreaItem];

	mainItem = [itemFactory itemGroupWithItems: @[item]];
	controller = [[ETController alloc] initWithObjectGraphContext: [itemFactory objectGraphContext]];

	[mainItem setController: controller];
	[mainItem setActionHandler: [ETBipActionHandler sharedInstanceForObjectGraphContext: [itemFactory objectGraphContext]]];

	[[itemFactory windowGroup] addItem: mainItem];

	/* Bringing the test suite to the front doesn't work or is unreliable if
	   the test suite is run inside an IDE. Unless the test suite is brought
	   to the front, -makeMainWindow and -makeKeyWindow are useless. */
	[(ETTestResponderApplication *)ETApp setKeyItem: mainItem];

	windowItem = (ETWindowItem *)[mainItem decoratorItem];
}

- (void) testControllerAndDecoratorInResponderChain
{
	UKObjectsSame(scrollableAreaItem, [item nextResponder]);
	UKObjectsSame(mainItem, [scrollableAreaItem nextResponder]);
	UKObjectsSame(controller, [mainItem nextResponder]);
	UKObjectsSame(windowItem, [controller nextResponder]);
	UKObjectsSame([itemFactory windowGroup], [windowItem nextResponder]);
}

- (void) prepareFirstResponder
{
	UKNotNil([ETTool activeTool]);

	NSLog(@"Key %@ and main %@", [ETApp keyWindow], [ETApp mainWindow]);
	[[item firstResponderSharingArea] makeFirstResponder: (id)item];

	UKObjectsSame(item, [[item firstResponderSharingArea] firstResponder]);
	UKObjectsSame(item, [[item firstResponderSharingArea] focusedItem]);
}

- (void) testExceptionOnInvalidFirstResponder
{
	UKRaisesException([[item firstResponderSharingArea] makeFirstResponder: (id)[windowItem window]]);
	UKRaisesException([[item firstResponderSharingArea] makeFirstResponder: (id)[mainItem view]]);
	UKRaisesException([[item firstResponderSharingArea] makeFirstResponder: (id)[mainItem supervisorView]]);
}

- (void) testFirstResponderLookup
{
	[self prepareFirstResponder];

	UKObjectsSame(item, [ETApp targetForAction: @selector(sendBackward:)]);
	UKObjectsSame(mainItem, [ETApp targetForAction: @selector(bip:)]);
	UKObjectsSame(controller, [ETApp targetForAction: @selector(add:)]);
	UKNil([ETApp targetForAction: @selector(nonExistentAction:)]);
}

- (void) testTargetLookup
{
	[self prepareFirstResponder];

	UKObjectsSame(mainItem, [ETApp targetForAction: @selector(sendBackward:) to: mainItem from: nil]);
	UKNil([ETApp targetForAction: @selector(bip:) to: item from: nil]);
	UKNil([ETApp targetForAction: @selector(add:) to: mainItem from: nil]);
	UKObjectsSame(controller, [ETApp targetForAction: @selector(addNewGroup:) to: controller from: nil]);
}

- (void) testSendAction
{
	[self prepareFirstResponder];

	[ETApp sendAction: @selector(bip:) to: nil from: self];

	UKTrue([mainItem isSelected]);
}

- (void) testFocusedItemForWindowAsFirstResponder
{
	[[windowItem window] makeFirstResponder: (id)[windowItem window]];

	// FIXME: UKObjectsEqual(mainItem, [windowItem focusedItem]);
}

/* For this test case, the select tool just as the first responder and not the active tool */
- (void) testSelectToolAsFirstResponder
{
	[self prepareFirstResponder];

	ETSelectTool *tool = [ETSelectTool tool];

	[[mainItem layout] setAttachedTool: tool];

	[[mainItem firstResponderSharingArea] makeFirstResponder: tool];

	UKObjectsEqual(tool, [[mainItem firstResponderSharingArea] firstResponder]);
	UKObjectsEqual(mainItem, [[mainItem firstResponderSharingArea] focusedItem]);
}

- (void) testSelectToolAsActiveTool
{
	[self prepareFirstResponder];

	ETSelectTool *tool = [ETSelectTool tool];

	[[mainItem layout] setAttachedTool: tool];

	[ETTool setActiveTool: tool];

	UKObjectsEqual(tool, [ETTool activeTool]);
	// FIXME: UKObjectsEqual(tool, [[item firstResponderSharingArea] firstResponder]);
	// FIXME: UKObjectsEqual(mainItem, [[item firstResponderSharingArea] focusedItem]);
}

- (void) testLayoutItemValidityAsFirstResponder
{
	[windowItem makeFirstResponder: item];

	UKObjectsEqual(item, [windowItem firstResponder]);
	UKObjectsEqual(item, [windowItem focusedItem]);

	[[mainItem layout] setAttachedTool: [ETArrowTool tool]];
	[windowItem makeFirstResponder: mainItem];

	UKObjectsNotEqual(mainItem, [windowItem firstResponder]);
	UKObjectsNotEqual(mainItem, [windowItem focusedItem]);

	[[mainItem layout] setAttachedTool: [ETSelectTool tool]];
	[windowItem makeFirstResponder: mainItem];

	UKObjectsEqual([[mainItem layout] attachedTool], [windowItem firstResponder]);
	UKObjectsEqual(mainItem, [windowItem focusedItem]);
}

- (void) testControllerAsInvalidFirstResponder
{
	[windowItem makeFirstResponder: controller];

	UKObjectsNotEqual(controller, [windowItem firstResponder]);
}

- (void) testWindowItemAsInvalidFirstResponder
{
	[windowItem makeFirstResponder: windowItem];

	UKObjectsNotEqual(windowItem, [windowItem firstResponder]);
}

- (void) testScrollableAreaItemAsInvalidFirstResponder
{
	[windowItem makeFirstResponder: scrollableAreaItem];

	UKObjectsNotEqual(scrollableAreaItem, [windowItem firstResponder]);

}

- (void) testWindowItemActions
{

}

@end

@implementation ETTestResponderApplication

- (ETLayoutItem *) mainItem
{
	return objc_getAssociatedObject(self, "mainItem");
}

- (void) setMainItem: (ETLayoutItem *)anItem
{
	objc_setAssociatedObject(self, "mainItem", anItem, OBJC_ASSOCIATION_RETAIN);
}

- (ETLayoutItem *) keyItem;
{
	return objc_getAssociatedObject(self, "keyItem");
}

- (void) setKeyItem: (ETLayoutItem *)anItem
{
	objc_setAssociatedObject(self, "keyItem", anItem, OBJC_ASSOCIATION_RETAIN);
}

@end

@implementation ETFirstResponderActionHandler

- (BOOL) acceptsFirstResponder
{
	return YES;
}

@end

@implementation ETBipActionHandler

- (void) bip: (id)sender onItem: (ETLayoutItem *)anItem
{
	[anItem setSelected: [sender isKindOfClass: [TestResponder class]]];
}

@end


text:
#ifndef AVCODEC_MIPS_BLOCKDSP_MIPS_H
#define AVCODEC_MIPS_BLOCKDSP_MIPS_H

#include "../mpegvideo.h"

void ff_fill_block16_msa(uint8_t *src, uint8_t val, int stride, int height);
void ff_fill_block8_msa(uint8_t *src, uint8_t val, int stride, int height);
void ff_clear_block_msa(int16_t *block);
void ff_clear_blocks_msa(int16_t *block);

void ff_fill_block16_mmi(uint8_t *block, uint8_t value, int line_size, int h);
void ff_fill_block8_mmi(uint8_t *block, uint8_t value, int line_size, int h);
void ff_clear_block_mmi(int16_t *block);
void ff_clear_blocks_mmi(int16_t *block);

#endif  // #ifndef AVCODEC_MIPS_BLOCKDSP_MIPS_H


text:
<?php

namespace ZendGDataTest\Spreadsheets;

use ZendGData\Spreadsheets\Extension;

/**
 * @category   Zend
 * @package    ZendGData\Spreadsheets
 * @subpackage UnitTests
 * @group      ZendGData
 * @group      ZendGData\Spreadsheets
 */
class ColCountTest extends \PHPUnit_Framework_TestCase
{

    public function setUp()
    {
        $this->colCount = new Extension\ColCount();
    }

    public function testToAndFromString()
    {
        $this->colCount->setText('20');
        $this->assertTrue($this->colCount->getText() == '20');
        $newColCount = new Extension\ColCount();
        $doc = new \DOMDocument();
        $doc->loadXML($this->colCount->saveXML());
        $newColCount->transferFromDom($doc->documentElement);
        $this->assertTrue($this->colCount->getText() == $newColCount->getText());
    }

}


text:
<?php
/**
 * URL rewriting
 *
 * Rewrites do not happen for multisite installations or child themes
 *
 * Rewrite:
 *   /wp-content/themes/themename/css/ to /css/
 *   /wp-content/themes/themename/js/  to /js/
 *   /wp-content/themes/themename/img/ to /img/
 *   /wp-content/plugins/              to /plugins/
 *
 * If you aren't using Apache, alternate configuration settings can be found in the docs.
 *
 * @link https://github.com/retlehs/roots/blob/master/doc/rewrites.md
 */
function roots_add_rewrites($content) {
  global $wp_rewrite;
  $roots_new_non_wp_rules = array(
    'css/(.*)'      => THEME_PATH . '/css/$1',
    'js/(.*)'       => THEME_PATH . '/js/$1',
    'img/(.*)'      => THEME_PATH . '/img/$1',
    'plugins/(.*)'  => RELATIVE_PLUGIN_PATH . '/$1'
  );
  $wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $roots_new_non_wp_rules);
  return $content;
}

function roots_clean_urls($content) {
  if (strpos($content, RELATIVE_PLUGIN_PATH) > 0) {
    return str_replace('/' . RELATIVE_PLUGIN_PATH,  '/plugins', $content);
  } else {
    return str_replace('/' . THEME_PATH, '', $content);
  }
}

if (!is_multisite() && !is_child_theme()) {
  if (current_theme_supports('rewrites')) {
    add_action('generate_rewrite_rules', 'roots_add_rewrites');
  }

  if (!is_admin() && current_theme_supports('rewrites')) {
    $tags = array(
      'plugins_url',
      'bloginfo',
      'stylesheet_directory_uri',
      'template_directory_uri',
      'script_loader_src',
      'style_loader_src'
    );

    add_filters($tags, 'roots_clean_urls');
  }
}


text:
package generated.zcsclient.admin;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import generated.zcsclient.zm.testId;

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

 * <complexType name="deleteDataSourceRequest">
 *   <complexContent>
 *     <extension base="{urn:zimbraAdmin}adminAttrsImpl">
 *       <sequence>
 *         <element name="dataSource" type="{urn:zimbra}id"/>
 *       </sequence>
 *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "deleteDataSourceRequest", propOrder = {
    "dataSource"
})
public class testDeleteDataSourceRequest
    extends testAdminAttrsImpl
{

    @XmlElement(required = true)
    protected testId dataSource;
    @XmlAttribute(name = "id", required = true)
    protected String id;

    /**
     * Gets the value of the dataSource property.
     *
     * @return
     *     possible object is
     *     {@link testId }
     *
     */
    public testId getDataSource() {
        return dataSource;
    }

    /**
     * Sets the value of the dataSource property.
     *
     * @param value
     *     allowed object is
     *     {@link testId }
     *
     */
    public void setDataSource(testId value) {
        this.dataSource = value;
    }

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

}


text:
namespace System.Net
{
    public static class GlobalLog
    {
        public static void Assert(bool condition, string arg1, string arg2, object arg3)
        {
        }

        public static void Assert(string message)
        {
        }

        public static void Print(string message)
        {
        }

        internal static void SetThreadSource(ThreadKinds source)
        {
        }
    }

    [Flags]
    internal enum ThreadKinds
    {
        Unknown = 0x0000,

        // Mutually exclusive.
        User = 0x0001,     // Thread has entered via an API.
        System = 0x0002,     // Thread has entered via a system callback (e.g. completion port) or is our own thread.

        // Mutually exclusive.
        Sync = 0x0004,     // Thread should block.
        Async = 0x0008,     // Thread should not block.

        // Mutually exclusive, not always known for a user thread.  Never changes.
        Timer = 0x0010,     // Thread is the timer thread.  (Can't call user code.)
        CompletionPort = 0x0020,     // Thread is a ThreadPool completion-port thread.
        Worker = 0x0040,     // Thread is a ThreadPool worker thread.
        Finalization = 0x0080,     // Thread is the finalization thread.
        Other = 0x0100,     // Unknown source.

        OwnerMask = User | System,
        SyncMask = Sync | Async,
        SourceMask = Timer | CompletionPort | Worker | Finalization | Other,

        // Useful "macros"
        SafeSources = SourceMask & ~(Timer | Finalization),  // Methods that "unsafe" sources can call must be explicitly marked.
        ThreadPool = CompletionPort | Worker,               // Like Thread.CurrentThread.IsThreadPoolThread
    }
}


text:
<?php
namespace Athena\Stream;

interface OutputStreamInterface
{
    /**
     * @param string $contents
     * @return int
     */
    public function write($contents);

    /**
     * @return boolean
     */
    public function close();
}


text:
Writing CodeIgniter Documentation
#################################

CodeIgniter uses Sphinx to generate its documentation in a variety of formats,
using reStructuredText to handle the formatting.  If you are familiar with
Markdown or Textile, you will quickly grasp reStructuredText.  The focus is
on readability and user friendliness.
While they can be quite technical, we always write for humans!

A local table of contents should always be included, like the one below.
It is created automatically by inserting the following:

::

	.. contents::
		:local:

	.. raw:: html

.. contents::
  :local:

.. raw:: html

The
 that is inserted as raw HTML is a hook for the documentation's
JavaScript to dynamically add links to any function and method definitions
contained in the current page.

**************
Tools Required
**************

To see the rendered HTML, ePub, PDF, etc., you will need to install Sphinx
along with the PHP domain extension for Sphinx.  The underlying requirement
is to have Python installed.  Lastly, you will install the CI Lexer for
Pygments, so that code blocks can be properly highlighted.

.. code-block:: bash

	easy_install "sphinx==1.2.3"
	easy_install sphinxcontrib-phpdomain

Then follow the directions in the README file in the :samp:`cilexer` folder
inside the documentation repository to install the CI Lexer.

*****************************************
Page and Section Headings and Subheadings
*****************************************

Headings not only provide order and sections within a page, but they also
are used to automatically build both the page and document table of contents.
Headings are formed by using certain characters as underlines for a bit of
text.  Major headings, like page titles and section headings also use
overlines.  Other headings just use underlines, with the following hierarchy::

	# with overline for page titles
	* with overline for major sections
	= for subsections
	- for subsubsections
	^ for subsubsubsections
	" for subsubsubsubsections (!)

The :download:`TextMate ELDocs Bundle <./ELDocs.tmbundle.zip>` can help you
create these with the following tab triggers::

	title->

		##########
		Page Title
		##########

	sec->

		*************
		Major Section
		*************

	sub->

		Subsection
		==========

	sss->

		SubSubSection
		-------------

	ssss->

		SubSubSubSection
		^^^^^^^^^^^^^^^^

	sssss->

		SubSubSubSubSection (!)
		"""""""""""""""""""""""

********************
Method Documentation
********************

When documenting class methods for third party developers, Sphinx provides
directives to assist and keep things simple.
For example, consider the following ReST:

.. code-block:: rst

	.. php:class:: Some_class

		.. php:method:: some_method ( $foo [, $bar [, $bat]])

			This function will perform some action. The ``$bar`` array must contain
			a something and something else, and along with ``$bat`` is an optional
			parameter.

			:param int $foo: the foo id to do something in
			:param mixed $bar: A data array that must contain a something and something else
			:param bool $bat: whether or not to do something
			:returns: FALSE on failure, TRUE if successful
			:rtype: bool

			::

				$this->load->library( 'some_class');

				$bar = array(
					'something'		=> 'Here is this parameter!',
					'something_else'	=> 42
				);

				$bat = $this->some_class->should_do_something();

				if( $this->some_class->some_method(4, $bar, $bat) === FALSE )
				{
					show_error( 'An Error Occurred Doing Some Method');
				}

			.. note:: Here is something that you should be aware of when using some_method().
					For real.

			See also :meth:`Some_class::should_do_something`

		.. php:method:: should_do_something()

			:returns: Whether or not something should be done
			:rtype: bool

It creates the following display:

.. php:class:: Some_class

	.. php:method:: some_method ( $foo [, $bar [, $bat]])

		This function will perform some action. The ``$bar`` array must contain
		a something and something else, and along with ``$bat`` is an optional
		parameter.

		:param int $foo: the foo id to do something in
		:param mixed $bar: A data array that must contain a something and something else
		:param bool $bat: whether or not to do something
		:returns: FALSE on failure, TRUE if successful
		:rtype: bool

		::

			$this->load->library( 'some_class');

			$bar = array(
				'something'		=> 'Here is this parameter!',
				'something_else'	=> 42
			);

			$bat = $this->some_class->should_do_something();

			if( $this->some_class->some_method(4, $bar, $bat) === FALSE )
			{
				show_error( 'An Error Occurred Doing Some Method');
			}

		.. note:: Here is something that you should be aware of when using some_method().
				For real.

		See also :meth:`Some_class::should_do_something`

	.. php:method:: should_do_something()

		:returns: Whether or not something should be done
		:rtype: bool


text:
<?xml version="1.0" encoding="utf-8" ?>
<result>
	<row>
		Google
		<nb_uniq_visitors>638</nb_uniq_visitors>
		<nb_visits>654</nb_visits>
		<nb_actions>1131</nb_actions>
		<max_actions>102</max_actions>
		<sum_visit_length>71888</sum_visit_length>
		<bounce_count>502</bounce_count>
		<goals>
			<row idgoal='1'>
				<nb_conversions>8</nb_conversions>
				<nb_visits_converted>8</nb_visits_converted>
				<revenue>24</revenue>
			</row>
			<row idgoal='2'>
				<nb_conversions>10</nb_conversions>
				<nb_visits_converted>10</nb_visits_converted>
				<revenue>10</revenue>
			</row>
			<row idgoal='3'>
				<nb_conversions>3</nb_conversions>
				<nb_visits_converted>3</nb_visits_converted>
				<revenue>3</revenue>
			</row>
		</goals>
		<nb_conversions>21</nb_conversions>
		<revenue>37</revenue>
		<url>http://google.com</url>
		<logo>plugins/Referers/images/searchEngines/google.com.png</logo>
		<idsubdatatable>116</idsubdatatable>
	</row>
	<row>
		Conduit.com
		<nb_uniq_visitors>3</nb_uniq_visitors>
		<nb_visits>3</nb_visits>
		<nb_actions>5</nb_actions>
		<max_actions>3</max_actions>
		<sum_visit_length>111</sum_visit_length>
		<bounce_count>2</bounce_count>
		<nb_visits_converted>0</nb_visits_converted>
		<url>http://search.conduit.com</url>
		<logo>plugins/Referers/images/searchEngines/search.conduit.com.png</logo>
		<idsubdatatable>114</idsubdatatable>
	</row>
	<row>
		Google Images
		<nb_uniq_visitors>2</nb_uniq_visitors>
		<nb_visits>2</nb_visits>
		<nb_actions>2</nb_actions>
		<max_actions>1</max_actions>
		<sum_visit_length>0</sum_visit_length>
		<bounce_count>2</bounce_count>
		<nb_visits_converted>0</nb_visits_converted>
		<url>http://images.google.com</url>
		<logo>plugins/Referers/images/searchEngines/images.google.com.png</logo>
		<idsubdatatable>117</idsubdatatable>
	</row>
	<row>
		Yahoo!
		<nb_uniq_visitors>2</nb_uniq_visitors>
		<nb_visits>2</nb_visits>
		<nb_actions>3</nb_actions>
		<max_actions>2</max_actions>
		<sum_visit_length>355</sum_visit_length>
		<bounce_count>1</bounce_count>
		<nb_visits_converted>0</nb_visits_converted>
		<url>http://search.yahoo.com</url>
		<logo>plugins/Referers/images/searchEngines/search.yahoo.com.png</logo>
		<idsubdatatable>118</idsubdatatable>
	</row>
	<row>
		Yandex Images
		<nb_uniq_visitors>2</nb_uniq_visitors>
		<nb_visits>2</nb_visits>
		<nb_actions>3</nb_actions>
		<max_actions>2</max_actions>
		<sum_visit_length>7</sum_visit_length>
		<bounce_count>1</bounce_count>
		<nb_visits_converted>0</nb_visits_converted>
		<url>http://images.yandex.ru</url>
		<logo>plugins/Referers/images/searchEngines/images.yandex.ru.png</logo>
		<idsubdatatable>119</idsubdatatable>
	</row>
	<row>
		Bing
		<nb_uniq_visitors>1</nb_uniq_visitors>
		<nb_visits>1</nb_visits>
		<nb_actions>1</nb_actions>
		<max_actions>1</max_actions>
		<sum_visit_length>0</sum_visit_length>
		<bounce_count>1</bounce_count>
		<nb_visits_converted>0</nb_visits_converted>
		<url>http://bing.com</url>
		<logo>plugins/Referers/images/searchEngines/bing.com.png</logo>
		<idsubdatatable>113</idsubdatatable>
	</row>
	<row>
		Daum
		<nb_uniq_visitors>1</nb_uniq_visitors>
		<nb_visits>1</nb_visits>
		<nb_actions>1</nb_actions>
		<max_actions>1</max_actions>
		<sum_visit_length>0</sum_visit_length>
		<bounce_count>1</bounce_count>
		<nb_visits_converted>0</nb_visits_converted>
		<url>http://search.daum.net</url>
		<logo>plugins/Referers/images/searchEngines/search.daum.net.png</logo>
		<idsubdatatable>115</idsubdatatable>
	</row>
</result>


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>qmaze.View</title>
<meta name="date" content="2017-11-06">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

qmaze.View

Classes

Assets

TrainingConfig

ViewController


text:
<bill session="110" type="h" number="946" updated="2009-01-08T18:48:20-05:00">
	<status><introduced date="1170910800" datetime="2007-02-08"/></status>

	<introduced date="1170910800" datetime="2007-02-08"/>
	<titles>
		<title type="short" as="introduced">Consumer Overdraft Protection Fair Practices Act</title>
		<title type="official" as="introduced">To extend the protections of the Truth in Lending Act to overdraft protection programs and services provided by depository institutions, to require customer consent before a depository institution may initiate overdraft protection services and fees, to enhance the information made available to consumers relating to overdraft protection services and fees, to prohibit systematic manipulation in the posting of checks and other debits to a depository account for the purpose of generating overdraft protection fees, and for other purposes.</title>
	</titles>
	<sponsor id="400251"/>
	<cosponsors>
		<cosponsor id="400133" joined="2007-10-18"/>
		<cosponsor id="400280" joined="2007-09-25"/>
		<cosponsor id="400199" joined="2007-09-20"/>
		<cosponsor id="400407" joined="2007-09-25"/>
		<cosponsor id="400162" joined="2007-07-17"/>
		<cosponsor id="400246" joined="2007-10-18"/>
		<cosponsor id="400271" joined="2007-09-24"/>
		<cosponsor id="412215" joined="2007-07-18"/>
		<cosponsor id="400063" joined="2007-07-17"/>
		<cosponsor id="400262" joined="2008-02-14"/>
		<cosponsor id="400249" joined="2007-09-20"/>
		<cosponsor id="400007" joined="2008-09-10"/>
		<cosponsor id="400245" joined="2007-07-23"/>
		<cosponsor id="400352" joined="2007-09-25"/>
		<cosponsor id="400001" joined="2007-09-04"/>
		<cosponsor id="400237" joined="2007-06-20"/>
		<cosponsor id="400140" joined="2007-02-08"/>
		<cosponsor id="400422" joined="2007-09-26"/>
		<cosponsor id="412204" joined="2008-09-10"/>
		<cosponsor id="400111" joined="2007-07-18"/>
		<cosponsor id="400366" joined="2007-08-01"/>
		<cosponsor id="412200" joined="2007-08-01"/>
		<cosponsor id="412236" joined="2008-01-29"/>
		<cosponsor id="400093" joined="2007-07-17"/>
		<cosponsor id="400440" joined="2007-09-20"/>
		<cosponsor id="400185" joined="2007-09-20"/>
		<cosponsor id="400204" joined="2007-07-11"/>
		<cosponsor id="400163" joined="2007-09-20"/>
		<cosponsor id="400425" joined="2008-04-30"/>
		<cosponsor id="400639" joined="2007-09-24" withdrawn="2007-09-27"/>
		<cosponsor id="400067" joined="2007-02-08"/>
	</cosponsors>
	<actions>
		<action date="1170910800" datetime="2007-02-08"><text>Referred to the House Committee on Financial Services.</text></action>
		<action date="1170997200" datetime="2007-02-09"><text>Sponsor introductory remarks on measure. (CR 2/12/2007 E306)</text></action>
		<action date="1176350400" datetime="2007-04-12"><text>Referred to the Subcommittee on Financial Institutions and Consumer Credit.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>
	<summary>
	2/8/2007--Introduced.<br/>Consumer Overdraft Protection Fair Practices Act - Amends the Truth in Lending Act to set forth restrictions on: (1) overdraft protection programs or services for consumers; and (2) representations or statements with respect to such a program or service in any advertisement or promotion. Amends the Electronic Fund Transfer Act and the Expedited Funds Availability Act to set forth restrictions on overdraft protection programs or services for consumers.
	</summary>
</bill>


text:
package org.softuni.cardealer.domain.models.service;

public class SupplierServiceModel extends BaseServiceModel {

    private String id;
    private String name;
    private boolean isImporter;

    public SupplierServiceModel() {
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isImporter() {
        return isImporter;
    }

    public void setImporter(boolean importer) {
        isImporter = importer;
    }
}


text:
<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">

{{ site.description }}

    Home

    List.js
    Form.js
    Session.js
    Persist.js
    Message.js

    Styles
    Boilerplate

    Download
    GitHub project
    Currently v{{ site.version }}

      © {{ site.time | date: '%Y' }} The New York Times Company.


text:
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDeviceSensors_h
#define nsDeviceSensors_h

#include "nsIDeviceSensors.h"
#include "nsCOMArray.h"
#include "nsTArray.h"
#include "nsCOMPtr.h"
#include "nsITimer.h"
#include "mozilla/dom/DeviceMotionEvent.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/HalSensor.h"
#include "nsDataHashtable.h"

class nsIDOMWindow;

namespace mozilla {
namespace dom {
class EventTarget;
}
}

class nsDeviceSensors : public nsIDeviceSensors, public mozilla::hal::ISensorObserver
{
  typedef mozilla::dom::DeviceAccelerationInit DeviceAccelerationInit;
  typedef mozilla::dom::DeviceRotationRateInit DeviceRotationRateInit;
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDEVICESENSORS

  nsDeviceSensors();

  void Notify(const mozilla::hal::SensorData& aSensorData) override;

private:
  virtual ~nsDeviceSensors();

  // sensor -> window listener
  nsTArray<nsTArray<nsIDOMWindow*>* > mWindowListeners;

  void FireDOMLightEvent(mozilla::dom::EventTarget* aTarget,
                         double value);

  void FireDOMProximityEvent(mozilla::dom::EventTarget* aTarget,
                             double aValue,
                             double aMin,
                             double aMax);

  void FireDOMUserProximityEvent(mozilla::dom::EventTarget* aTarget,
                                 bool aNear);

  void FireDOMOrientationEvent(mozilla::dom::EventTarget* target,
                               double alpha,
                               double beta,
                               double gamma);

  void FireDOMMotionEvent(class nsIDOMDocument *domDoc,
                          mozilla::dom::EventTarget* target,
                          uint32_t type,
                          double x,
                          double y,
                          double z);

  bool mEnabled;

  inline bool IsSensorEnabled(uint32_t aType) {
    return mWindowListeners[aType]->Length() > 0;
  }

  mozilla::TimeStamp mLastDOMMotionEventTime;
  bool mIsUserProximityNear;
  mozilla::Maybe<DeviceAccelerationInit> mLastAcceleration;
  mozilla::Maybe<DeviceAccelerationInit> mLastAccelerationIncludingGravity;
  mozilla::Maybe<DeviceRotationRateInit> mLastRotationRate;
};

#endif


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

import io.airlift.configuration.Config;
import io.airlift.configuration.ConfigDescription;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

public class JdbcWriteConfig
{
    static final int MAX_ALLOWED_WRITE_BATCH_SIZE = 1_000_000;

    private int writeBatchSize = 1000;

    // Do not create temporary table during insert.
    // This means that the write operation can fail and leave the table in an inconsistent state.
    private boolean nonTransactionalInsert;

    @Min(1)
    @Max(MAX_ALLOWED_WRITE_BATCH_SIZE)
    public int getWriteBatchSize()
    {
        return writeBatchSize;
    }

    @Config("write.batch-size")
    @ConfigDescription("Maximum number of rows to write in a single batch")
    public JdbcWriteConfig setWriteBatchSize(int writeBatchSize)
    {
        this.writeBatchSize = writeBatchSize;
        return this;
    }

    public boolean isNonTransactionalInsert()
    {
        return nonTransactionalInsert;
    }

    @Config("insert.non-transactional-insert.enabled")
    @ConfigDescription("Do not create temporary table during insert. " +
            "This means that the write operation can fail and leave the table in an inconsistent state.")
    public JdbcWriteConfig setNonTransactionalInsert(boolean nonTransactionalInsert)
    {
        this.nonTransactionalInsert = nonTransactionalInsert;
        return this;
    }
}


text:
namespace three {
namespace impl {

inline bool checkIntersection(const Object3D &object,
                              const Material &material,
                              const Raycaster &raycaster,
                              const math::Ray &ray,
                              const math::Vector3 &pA, const math::Vector3 &pB, const math::Vector3 &pC,
                              Intersection &result)
{
  bool intersect;
  if (material.side == Side::Back) {
    intersect = ray.intersectTriangle(pC, pB, pA, true, result.point);
    if(intersect) result.front = false;
  }
  else {
    intersect = ray.intersectTriangle(pA, pB, pC, material.side != Side::Double, result.point);
    if(intersect) result.front = true;
    else {
      intersect = ray.intersectTriangle(pC, pB, pA, true, result.point);
      if(intersect) result.front = false;
    }
  }

  if (!intersect) return false;

  result.point.apply(object.matrixWorld());

  float distance = raycaster.origin().distanceTo(result.point);

  if (distance < raycaster.near() || distance > raycaster.far()) return false;

  result.distance = distance;
  result.object = &const_cast<Object3D &>(object);

  return true;
}

inline math::Vector2 uvIntersection(const math::Vector3 &point,
                                    const math::Vector3 &p1,
                                    const math::Vector3 &p2,
                                    const math::Vector3 &p3,
                                    const math::Vector2 &uv1,
                                    const math::Vector2 &uv2,
                                    const math::Vector2 &uv3)
{
  math::Vector3 barycoord = math::Triangle::barycoordFromPoint(point, p1, p2, p3);

  return (uv1 * barycoord.x()) + (uv2 * barycoord.y()) + (uv3 * barycoord.z());
}

inline bool checkBufferGeometryIntersection(const Object3D &object,
                                            const Material &material,
                                            const Raycaster &raycaster,
                                            const math::Ray &ray,
                                            const BufferAttributeT<float>::Ptr &position,
                                            const BufferAttributeT<float>::Ptr &uv,
                                            unsigned a, unsigned b, unsigned c,
                                            Intersection &intersection)
{
  const math::Vector3 &vA = position->item_at<math::Vector3>(a);
  const math::Vector3 &vB = position->item_at<math::Vector3>(b);
  const math::Vector3 &vC = position->item_at<math::Vector3>(c);

  if (checkIntersection(object, material, raycaster, ray, vA, vB, vC, intersection)) {

    if(uv) {
      const math::Vector2 &uvA = uv->item_at<math::Vector2>(a);
      const math::Vector2 &uvB = uv->item_at<math::Vector2>(b);
      const math::Vector2 &uvC = uv->item_at<math::Vector2>(c);

      intersection.uv = uvIntersection(intersection.point, vA, vB, vC, uvA, uvB, uvC);
    }

    intersection.face = Face3(a, b, c, math::Triangle::normal(vA, vB, vC));
    intersection.faceIndex = a;

    return true;
  }

  return false;
}

}
}
#endif //THREEPP_RAYCAST_H


text:
#include "Bser.h"
#include <folly/io/Cursor.h>
#include <folly/String.h>

using namespace folly;
using folly::io::Cursor;

namespace folly {
namespace bser {
static dynamic parseBser(Cursor& curs);

template <typename... ARGS>
[[noreturn]] static void throwDecodeError(Cursor& curs, ARGS&&... args) {
  throw BserDecodeError(folly::to<std::string>(std::forward<ARGS>(args)...,
                                               " with ",
                                               curs.length(),
                                               " bytes remaining in cursor"));
}

static int64_t decodeInt(Cursor& curs) {
  auto enc = (BserType)curs.read<int8_t>();
  switch (enc) {
    case BserType::Int8:
      return curs.read<int8_t>();
    case BserType::Int16:
      return curs.read<int16_t>();
    case BserType::Int32:
      return curs.read<int32_t>();
    case BserType::Int64:
      return curs.read<int64_t>();
    default:
      throwDecodeError(
          curs, "invalid integer encoding detected (", (int8_t)enc, ")");
  }
}

static std::string decodeString(Cursor& curs) {
  auto len = decodeInt(curs);
  std::string str;

  if (len < 0) {
    throw std::range_error("string length must not be negative");
  }
  str.reserve(size_t(len));

  size_t available = curs.length();
  while (available < (size_t)len) {
    if (available == 0) {
      // Saw this case when we decodeHeader was returning the incorrect length
      // and we were splitting off too few bytes from the IOBufQueue
      throwDecodeError(curs,
                       "no data available while decoding a string, header was "
                       "not decoded properly");
    }
    str.append(reinterpret_cast<const char*>(curs.data()), available);
    curs.skipAtMost(available);
    len -= available;
    available = curs.length();
  }

  str.append(reinterpret_cast<const char*>(curs.data()), size_t(len));
  curs.skipAtMost(size_t(len));
  return str;
}

static dynamic decodeArray(Cursor& curs) {
  dynamic arr = dynamic::array();
  auto size = decodeInt(curs);
  while (size-- > 0) {
    arr.push_back(parseBser(curs));
  }
  return arr;
}

static dynamic decodeObject(Cursor& curs) {
  dynamic obj = dynamic::object;
  auto size = decodeInt(curs);
  while (size-- > 0) {
    if ((BserType)curs.read<int8_t>() != BserType::String) {
      throwDecodeError(curs, "expected String");
    }
    auto key = decodeString(curs);
    obj[key] = parseBser(curs);
  }
  return obj;
}

static dynamic decodeTemplate(Cursor& curs) {
  dynamic arr = folly::dynamic::array;

  // List of property names
  if ((BserType)curs.read<int8_t>() != BserType::Array) {
    throw std::runtime_error("Expected array encoding for property names");
  }
  auto names = decodeArray(curs);

  auto size = decodeInt(curs);

  while (size-- > 0) {
    dynamic obj = dynamic::object;

    for (auto& name : names) {
      auto bytes = curs.peekBytes();
      if ((BserType)bytes.at(0) == BserType::Skip) {
        obj[name.getString()] = nullptr;
        curs.skipAtMost(1);
        continue;
      }

      obj[name.getString()] = parseBser(curs);
    }

    arr.push_back(std::move(obj));
  }

  return arr;
}

static dynamic parseBser(Cursor& curs) {
  switch ((BserType)curs.read<int8_t>()) {
    case BserType::Int8:
      return curs.read<int8_t>();
    case BserType::Int16:
      return curs.read<int16_t>();
    case BserType::Int32:
      return curs.read<int32_t>();
    case BserType::Int64:
      return curs.read<int64_t>();
    case BserType::Real: {
      double dval;
      curs.pull((void*)&dval, sizeof(dval));
      return dval;
    }
    case BserType::Null:
      return nullptr;
    case BserType::True:
      return (bool)true;
    case BserType::False:
      return (bool)false;
    case BserType::String:
      return decodeString(curs);
    case BserType::Array:
      return decodeArray(curs);
    case BserType::Object:
      return decodeObject(curs);
    case BserType::Template:
      return decodeTemplate(curs);
    case BserType::Skip:
      throw std::runtime_error(
          "Skip not valid at this location in the bser stream");
    default:
      throw std::runtime_error("invalid bser encoding");
  }
}

static size_t decodeHeader(Cursor& curs) {
  char header[sizeof(kMagic)];
  curs.pull(header, sizeof(header));
  if (memcmp(header, kMagic, sizeof(kMagic))) {
    throw std::runtime_error("invalid BSER magic header");
  }

  auto enc = (BserType)curs.peekBytes().at(0);
  size_t int_size;
  switch (enc) {
    case BserType::Int8:
      int_size = 1;
      break;
    case BserType::Int16:
      int_size = 2;
      break;
    case BserType::Int32:
      int_size = 4;
      break;
    case BserType::Int64:
      int_size = 8;
      break;
    default:
      int_size = 0;
  }

  return int_size + 3 /* magic + int type */ + decodeInt(curs);
}

size_t decodePduLength(const folly::IOBuf* buf) {
  Cursor curs(buf);
  return decodeHeader(curs);
}

folly::dynamic parseBser(const IOBuf* buf) {
  Cursor curs(buf);

  decodeHeader(curs);
  return parseBser(curs);
}

folly::dynamic parseBser(ByteRange str) {
  auto buf = IOBuf::wrapBuffer(str.data(), str.size());
  return parseBser(&*buf);
}

folly::dynamic parseBser(StringPiece str) {
  return parseBser(ByteRange((uint8_t*)str.data(), str.size()));
}
}
}

/* vim:ts=2:sw=2:et:
 */