text:
package com.thinkgem.jeesite.modules.jfx.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.jfx.entity.Discardlog;
import com.thinkgem.jeesite.modules.jfx.dao.DiscardlogDao;

/**
 * 报废记录Service
 * @author Dean
 * @version 2016-02-24
 */
@Service
@Transactional(readOnly = true)
public class DiscardlogService extends CrudService<DiscardlogDao, Discardlog> {

	public Discardlog get(String id) {
		return super.get(id);
	}

	public List<Discardlog> findList(Discardlog discardlog) {
		return super.findList(discardlog);
	}

	public Page<Discardlog> findPage(Page<Discardlog> page, Discardlog discardlog) {
		return super.findPage(page, discardlog);
	}

	@Transactional(readOnly = false)
	public void save(Discardlog discardlog) {
		super.save(discardlog);
	}

	@Transactional(readOnly = false)
	public void delete(Discardlog discardlog) {
		super.delete(discardlog);
	}

}


text:
{-# LANGUAGE TemplateHaskell #-}
module Kiosk.Backend.TableSpec ( main
                               , spec
                               , getDate
                               , getFormId
                               , getUUID
                               , getTicketId) where

import           Control.Lens
import           Kiosk.Backend.Data

import           Control.Applicative
import           Data.List           (unfoldr)
import           Data.Maybe
import           Data.Time
import qualified Data.UUID           as UUID
import           Generators          (GeneratorType (..),
                                      generateDataTemplateEntry)
import           Plow.Extras.Time
import           Test.Hspec
import           Test.QuickCheck
import           Test.Serial         ()

makeLenses ''DataTemplateEntryKey

main :: IO ()
main = hspec spec

spec :: Spec
spec = do
     describe "Fakey Fae" $
      it "fka fka" $ do
       dtes <- timeCorrectedTemplateEntries
       dtes `shouldBe` dtes

-- | Table Imports

timeCorrectedTemplateEntries :: IO [DataTemplateEntry]
timeCorrectedTemplateEntries = do
                             ct <- getCurrentTime
                             entries <- generateEntries
                             return $ fixDate <$> (zip (generateTimes (startTime ct) 10000) entries)
  where
    generateEntries = generate $ take 50 <$>
                      generateDataTemplateEntry Static
    fixDate :: (Int,DataTemplateEntry)  -> DataTemplateEntry
    fixDate entries = fixFormId.fixUUID . snd $ over (_2.dataTemplateEntryKey.getDate) (const $ fst entries) entries
    fixUUID :: DataTemplateEntry -> DataTemplateEntry
    fixUUID entries = over (dataTemplateEntryKey. getUUID)
                           (const . fromJust .  UUID.fromString $ "a2e3609e-154d-4e60-80e0-c77189098617") entries
    fixFormId entries = over (dataTemplateEntryKey.getFormId) (const 0) entries

generateTimes :: Integral a => UTCTime -> a -> [a]
generateTimes seedTime delta = take 50 $
                               unfoldr
                               (\t -> Just (t, t + delta)) (utcTimeToInt seedTime)

-- Time to start tests at 100ks (1.157 days) ago
startTime :: UTCTime -> UTCTime
startTime ct = addUTCTime (fromIntegral (-1*1000*100)) ct

redpajama_set_name: RedPajamaGithub


text:
sap.ui.define([
	"jquery.sap.global", "sap/ui/thirdparty/URI", "sap/ui/fl/Utils"
], function(jQuery, uri, FlexUtils) {
	"use strict";

	/**
	 * Provides the connectivity to the ABAP based LRep REST-service
	 *
	 * @param {object} [mParameters] - map of parameters, see below
	 * @param {String} [mParameters.XsrfToken] - XSRF token which can be reused for back-end connectivity. If no XSRF token is passed, a new one
	 *        will be fetched from back end.
	 * @constructor
	 * @alias sap.ui.fl.LrepConnector
	 * @private
	 * @sap-restricted
	 * @author SAP SE
	 * @version 1.50.8
	 */
	var Connector = function(mParameters) {
		this._initClientParam();
		this._initLanguageParam();
		if (mParameters) {
			this._sXsrfToken = mParameters.XsrfToken;
		}

	};

	Connector.createConnector = function(mParameters) {
		return new Connector(mParameters);
	};

	Connector.prototype.DEFAULT_CONTENT_TYPE = "application/json; charset=utf-8";
	Connector.prototype._sClient = undefined;
	Connector.prototype._sLanguage = undefined;
	Connector.prototype._aSentRequestListeners = [];
	Connector.prototype._sRequestUrlPrefix = "";

	/**
	 * Registers a callback for a sent request to the back end. The callback is only called once for each change. Each call is done with an object
	 * similar to the resolve of the promises containing a status of the response from the back end i.e. success, a
	 * response containing the change processed in this request
	 *
	 * @param {function} fCallback function called after all related promises are resolved
	 * @public
	 */
	Connector.attachSentRequest = function(fCallback) {
		if (typeof fCallback === "function" && Connector.prototype._aSentRequestListeners.indexOf(fCallback) === -1) {
			Connector.prototype._aSentRequestListeners.push(fCallback);
		}
	};

	/**
	 * Deregisters a callback for a sent request to the back end if the callback was registered
	 *
	 * @param {function} fCallback function called after all related promises are resolved
	 * @public
	 */
	Connector.detachSentRequest = function(fCallback) {
		var iIndex = Connector.prototype._aSentRequestListeners.indexOf(fCallback);
		if (iIndex !== -1) {
			Connector.prototype._aSentRequestListeners.splice(iIndex, 1);
		}
	};

	/**
	 * Extract client from current running instance
	 *
	 * @private
	 */
	Connector.prototype._initClientParam = function() {
		var client = FlexUtils.getClient();
		if (client) {
			this._sClient = client;
		}
	};

	/**
	 * Extract the sap-language URL parameter from current URL
	 *
	 * @private
	 */
	Connector.prototype._initLanguageParam = function() {
		var sLanguage;
		sLanguage = FlexUtils.getUrlParameter("sap-language") || FlexUtils.getUrlParameter("sap-ui-language");
		if (sLanguage) {
			this._sLanguage = sLanguage;
		}
	};

	/**
	 * Prefix for request URL can be set in exceptional cases when consumer needs to add a prefix to the URL
	 *
	 * @param {String} sRequestUrlPrefix - request URL prefix which must start with a (/) and must not end with a (/)
	 * @private
	 * @sap-restricted
	 */
	Connector.prototype.setRequestUrlPrefix = function(sRequestUrlPrefix) {
		this._sRequestUrlPrefix = sRequestUrlPrefix;
	};

	/**
	 * Resolves the complete URL of a request using the back-end URL and the relative URL from the request
	 *
	 * @param {String} sRelativeUrl - relative URL of the current request
	 * @returns {sap.ui.core.URI} returns the complete uri for this request
	 * @private
	 */
	Connector.prototype._resolveUrl = function(sRelativeUrl) {
		if (!jQuery.sap.startsWith(sRelativeUrl, "/")) {
			sRelativeUrl = "/" + sRelativeUrl;
		}
		sRelativeUrl = this._sRequestUrlPrefix + sRelativeUrl;
		var oUri = uri(sRelativeUrl).absoluteTo("");
		return oUri.toString();
	};

	/**
	 * Get the default header for a request
	 *
	 * @returns {Object} Returns an object containing all headers for each request
	 * @private
	 */
	Connector.prototype._getDefaultHeader = function() {
		var mHeaders = {
			headers: {
				"X-CSRF-Token": this._sXsrfToken || "fetch"
			}
		};
		return mHeaders;
	};

	/**
	 * Get the default options, required for the jQuery.ajax request
	 *
	 * @param {String} sMethod - HTTP-method (PUT, POST, GET (default)...) used for this request
	 * @param {String} sContentType - Set the content-type manually and overwrite the default (application/json)
	 * @param {Object} oData - Payload of the request
	 * @returns {Object} Returns an object containing the options and the default header for a jQuery.ajax request
	 * @private
	 */
	Connector.prototype._getDefaultOptions = function(sMethod, sContentType, oData) {
		var mOptions;
		if (!sContentType) {
			sContentType = this.DEFAULT_CONTENT_TYPE;
		} else if (sContentType.indexOf("charset") === -1) {
			sContentType += "; charset=utf-8";
		}

		mOptions = jQuery.extend(true, this._getDefaultHeader(), {
			type: sMethod,
			async: true,
			contentType: sContentType,
			processData: false,
			//xhrFields: {
			//	withCredentials: true
			//},
			headers: {
				"Content-Type": sContentType
			}
		});

		if (oData && mOptions.contentType.indexOf("application/json") === 0) {
			mOptions.dataType = "json";
			if (typeof oData === "object") {
				mOptions.data = JSON.stringify(oData);
			} else {
				mOptions.data = oData;
			}
		} else if (oData) {
			mOptions.data = oData;
		}

		if (sMethod === "DELETE") {
			delete mOptions.data;
			delete mOptions.contentType;
		}

		return mOptions;
	};

	/**
	 * Send a request to the back end
	 *
	 * @param {String} sUri Relative URL for this request
	 * @param {String} sMethod HTTP-method to be used by this request (default GET)
	 * @param {Object} oData Payload of the request
	 * @param {Object} mOptions Additional options which should be used in the request
	 * @returns {Promise} Returns a promise to the result of the request
	 * @public
	 */
	Connector.prototype.send = function(sUri, sMethod, oData, mOptions) {
		sMethod = sMethod || "GET";
		sMethod = sMethod.toUpperCase();
		mOptions = mOptions || {};
		sUri = this._resolveUrl(sUri);

		if (mOptions.success || mOptions.error) {
			var sErrorMessage = "Success and error handler are not allowed in mOptions";
			throw new Error(sErrorMessage);
		}

		var sContentType = mOptions.contentType || this.DEFAULT_CONTENT_TYPE;

		mOptions = jQuery.extend(true, this._getDefaultOptions(sMethod, sContentType, oData), mOptions);

		return this._sendAjaxRequest(sUri, mOptions);
	};

	/**
	 * Extracts the messages from the back-end response
	 *
	 * @param {Object} oXHR - ajax request object
	 * @returns {Array} Array of messages, for example [ { "severity": "Error", "text": "content id must be non-initial" } ]
	 * @private
	 */
	Connector.prototype._getMessagesFromXHR = function(oXHR) {
		var errorResponse, aMessages, length, i;
		aMessages = [];
		try {
			errorResponse = JSON.parse(oXHR.responseText);
			if (errorResponse && errorResponse.messages && errorResponse.messages.length > 0) {
				length = errorResponse.messages.length;
				for (i = 0; i < length; i++) {
					aMessages.push({
						severity: errorResponse.messages[i].severity,
						text: errorResponse.messages[i].text
					});
				}
			}
		} catch (e) {
			// ignore
		}

		return aMessages;
	};

	/**
	 * @param {String} sUri - Complete request URL
	 * @param {Object} mOptions - Options to be used by the request
	 * @returns {Promise} Returns a Promise with the status and response and messages
	 * @private
	 */
	Connector.prototype._sendAjaxRequest = function(sUri, mOptions) {
		var that = this;
		var sFetchXsrfTokenUrl = "/sap/bc/lrep/actions/getcsrftoken/";
		var mFetchXsrfTokenOptions = {
			headers: {
				"X-CSRF-Token": "fetch"
			},
			type: "HEAD"
		};

		if (this._sClient) {
			mFetchXsrfTokenOptions.headers["sap-client"] = this._sClient;
		}

		return new Promise(function(resolve, reject) {
			function handleValidRequest(oResponse, sStatus, oXhr) {

				var sNewCsrfToken = oXhr.getResponseHeader("X-CSRF-Token");
				that._sXsrfToken = sNewCsrfToken || that._sXsrfToken;
				var sEtag = oXhr.getResponseHeader("etag");

				var oResult = {
					status: sStatus,
					etag: sEtag,
					response: oResponse
				};

				resolve(oResult);

				jQuery.each(that._aSentRequestListeners, function(iIndex, fCallback) {
					fCallback(oResult);
				});
			}

			function fetchTokenAndHandleRequest(oResponse, sStatus, oXhr) {
				that._sXsrfToken = oXhr.getResponseHeader("X-CSRF-Token");
				mOptions.headers = mOptions.headers || {};
				mOptions.headers["X-CSRF-Token"] = that._sXsrfToken;

				// Re-send request after fetching token
				jQuery.ajax(sUri, mOptions).done(handleValidRequest).fail(function(oXhr, sStatus, sErrorThrown) {
					var oError = new Error(sErrorThrown);
					oError.status = "error";
					oError.code = oXhr.statusCode().status;
					oError.messages = that._getMessagesFromXHR(oXhr);
					reject(oError);
				});
			}

			function refetchTokenAndRequestAgainOrHandleInvalidRequest(oXhr, sStatus, sErrorThrown) {
				if (oXhr.status === 403) {
					// Token seems to be invalid, refetch and then resend
					jQuery.ajax(sFetchXsrfTokenUrl, mFetchXsrfTokenOptions).done(fetchTokenAndHandleRequest).fail(function(oXhr, sStatus, sErrorThrown) {
						// Fetching XSRF Token failed
						reject({
							status: "error"
						});
					});
				} else {
					if (mOptions && mOptions.type === "DELETE" && oXhr.status === 404) {
						// Do not reject, if a file was not found during deletion
						// (can be the case if another user already triggered a restore meanwhile)
						resolve();
					} else {
						var result;
						result = {
							status: "error"
						};
						result.code = oXhr.statusCode().status;
						result.messages = that._getMessagesFromXHR(oXhr);
						reject(result);
					}
				}
			}

			//Check, whether CSRF token has to be requested
			var bRequestCSRFToken = true;
			if (mOptions && mOptions.type) {
				if (mOptions.type === "GET" || mOptions.type === "HEAD") {
					bRequestCSRFToken = false;
				}
			} else {
				if (that._sXsrfToken && that._sXsrfToken !== "fetch") {
					bRequestCSRFToken = false;
				}
			}

			if (bRequestCSRFToken) {
				// Fetch XSRF Token
				jQuery.ajax(sFetchXsrfTokenUrl, mFetchXsrfTokenOptions).done(fetchTokenAndHandleRequest).fail(function(oXhr, sStatus, sErrorThrown) {
					// Fetching XSRF Token failed
					reject({
						status: "error"
					});
				});
			} else {
				// Send normal request
				jQuery.ajax(sUri, mOptions).done(handleValidRequest).fail(refetchTokenAndRequestAgainOrHandleInvalidRequest);
			}
		});
	};

	/**
	 * Loads the changes for the given component class name.
	 *
	 * @see sap.ui.core.Component
	 * @param {object} oComponent - Contains component data needed for reading changes
	 * @param {string} oComponent.name - Name of component
	 * @param {string} [oComponent.appVersion] - Current running version of application
	 * @param {map} [mPropertyBag] - Contains additional data needed for reading changes
	 * @param {object} [mPropertyBag.appDescriptor] - Manifest that belongs to actual component
	 * @param {string} [mPropertyBag.siteId] - sideId that belongs to actual component
	 * @param {string} [mPropertyBag.layer] - Layer up to which changes shall be read (excluding the specified layer)
	 * @param {string} [mPropertyBag.appVersion] - Version of application whose changes shall be read
	 * @param {string} [mPropertyBag.url] - address to which the request for change should be sent in case the data is not cached
	 *
	 * @returns {Promise} Returns a Promise with the changes (changes, contexts, optional messagebundle), componentClassName and etag value
	 * @public
	 */
	Connector.prototype.loadChanges = function(oComponent, mPropertyBag) {
		var that = this;
		var mOptions = {};
		var sComponentName = oComponent.name;
		var sUrl = "/sap/bc/lrep/flex/data/";
		mPropertyBag = mPropertyBag || {};

		if (!sComponentName) {
			return Promise.reject(new Error("Component name not specified"));
		}

		if (mPropertyBag.url) {
			sUrl = mPropertyBag.url;
		} else {
			if (mPropertyBag.cacheKey) {
				mOptions.cache = true;
				sUrl += "~" + mPropertyBag.cacheKey + "~/";
			}

			sUrl += sComponentName;
		}

		if (mPropertyBag.siteId) {
			if (!mOptions.headers) {
				mOptions.headers = {};
			}

			mOptions.headers = {
				"X-LRep-Site-Id": mPropertyBag.siteId
			};
		}

		if (mPropertyBag.layer) {
			sUrl += "&upToLayerType=" + mPropertyBag.layer;
		}

		if (mPropertyBag.appDescriptor) {
			if (mPropertyBag.appDescriptor["sap.app"]) {
				if (!mOptions.headers) {
					mOptions.headers = {};
				}

				mOptions.headers = {
					"X-LRep-AppDescriptor-Id": mPropertyBag.appDescriptor["sap.app"].id
				};
			}
		}

		if (this._sClient) {
			sUrl += "&sap-client=" + this._sClient;
		}

		if (oComponent.appVersion && (oComponent.appVersion !== FlexUtils.DEFAULT_APP_VERSION)) {
			sUrl += "&appVersion=" + oComponent.appVersion;
		}

		// Replace first & with ?
		sUrl = sUrl.replace("&", "?");

		return this.send(sUrl, undefined, undefined, mOptions)
			.then(function(oResponse) {
				return {
					changes: oResponse.response,
					componentClassName: sComponentName,
					etag: oResponse.etag
				};
			}, function(oError) {
				if (oError.code === 404 || oError.code === 405) {
					// load changes based old route, because new route is not implemented
					return that._loadChangesBasedOnOldRoute(sComponentName);
				} else {
					throw (oError);
				}
			});
	};

	/**
	 * Loads flexibility settings.
	 *
	 * @returns {Promise} Returns a Promise with the flexibility settings content
	 * @public
	 */
	Connector.prototype.loadSettings = function() {
		var sUri = "/sap/bc/lrep/flex/settings";

		if (this._sClient) {
			sUri += "?sap-client=" + this._sClient;
		}

		return this.send(sUri, undefined, undefined, {})
			.then(function(oResponse) {
				return oResponse.response;
			});
	};

	Connector.prototype._loadChangesBasedOnOldRoute = function(sComponentClassName) {
		var resourceName, params;

		try {
			resourceName = jQuery.sap.getResourceName(sComponentClassName, "-changes.json");
		} catch (e) {
			return Promise.reject(e);
		}

		params = {
			async: true,
			dataType: "json",
			failOnError: true,
			headers: {
				"X-UI5-Component": sComponentClassName
			}
		};

		if (this._sClient) {
			params.headers["sap-client"] = this._sClient;
		}

		return jQuery.sap.loadResource(resourceName, params).then(function(oResponse) {
			return {
				changes: oResponse,
				componentClassName: sComponentClassName
			};
		});
	};

	/**
	 * @param {Array} aParams Array of parameter objects in format {name:<name>, value:<value>}
	 * @returns {String} Returns a String with all parameters concatenated
	 * @private
	 */
	Connector.prototype._buildParams = function(aParams) {
		if (!aParams) {
			aParams = [];
		}
		if (this._sClient) {
			// Add mandatory "sap-client" parameter
			aParams.push({
				name: "sap-client",
				value: this._sClient
			});
		}

		if (this._sLanguage) {
			// Add mandatory "sap-language" URL parameter.
			// Only use sap-language if there is an sap-language parameter in the original URL.
			// If sap-language is not added, the browser language might be used as back-end login language instead of sap-language.
			aParams.push({
				name: "sap-language",
				value: this._sLanguage
			});
		}

		var result = "";
		var len = aParams.length;
		for (var i = 0; i < len; i++) {
			if (i === 0) {
				result += "?";
			} else if (i > 0 && i < len) {
				result += "&";
			}
			result += aParams[i].name + "=" + aParams[i].value;
		}
		return result;
	};

	/**
	 * The URL prefix of the REST API for example /sap/bc/lrep/changes/.
	 *
	 * @param {Boolean} bIsVariant Flag whether the change is of type variant
	 * @returns {String} URL prefix
	 * @private
	 */
	Connector.prototype._getUrlPrefix = function(bIsVariant) {
		if (bIsVariant) {
			return "/sap/bc/lrep/variants/";
		}
		return "/sap/bc/lrep/changes/";
	};

	/**
	 * Creates a change or variant via REST call.
	 *
	 * @param {Object} oPayload The content which is send to the server
	 * @param {String} [sChangelist] The transport ID.
	 * @param {Boolean} bIsVariant - is variant?
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.create = function(oPayload, sChangelist, bIsVariant) {
		var sRequestPath = this._getUrlPrefix(bIsVariant);

		var aParams = [];
		if (sChangelist) {
			aParams.push({
				name: "changelist",
				value: sChangelist
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "POST", oPayload, null);
	};

	/**
	 * Update a change or variant via REST call.
	 *
	 * @param {Object} oPayload The content which is send to the server
	 * @param {String} sChangeName Name of the change
	 * @param {String} sChangelist (optional) The transport ID.
	 * @param {Boolean} bIsVariant - is variant?
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.update = function(oPayload, sChangeName, sChangelist, bIsVariant) {
		var sRequestPath = this._getUrlPrefix(bIsVariant);
		sRequestPath += sChangeName;

		var aParams = [];
		if (sChangelist) {
			aParams.push({
				name: "changelist",
				value: sChangelist
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "PUT", oPayload, null);
	};

	/**
	 * Delete a change or variant via REST call.
	 *
	 * @param {String} mParameters property bag
	 * @param {String} mParameters.sChangeName - name of the change
	 * @param {String} [mParameters.sLayer="USER"] - other possible layers: VENDOR,PARTNER,CUSTOMER_BASE,CUSTOMER
	 * @param {String} mParameters.sNamespace - the namespace of the change file
	 * @param {String} mParameters.sChangelist - The transport ID.
	 * @param {Boolean} bIsVariant - is it a variant?
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.deleteChange = function(mParameters, bIsVariant) {
		// REVISE rename to deleteFile
		var sRequestPath = this._getUrlPrefix(bIsVariant);
		sRequestPath += mParameters.sChangeName;

		var aParams = [];
		if (mParameters.sLayer) {
			aParams.push({
				name: "layer",
				value: mParameters.sLayer
			});
		}
		if (mParameters.sNamespace) {
			aParams.push({
				name: "namespace",
				value: mParameters.sNamespace
			});
		}
		if (mParameters.sChangelist) {
			aParams.push({
				name: "changelist",
				value: mParameters.sChangelist
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "DELETE", {}, null);
	};

	/**
	 * Authenticated access to a resource in the Lrep
	 *
	 * @param {String} sNamespace The abap package goes here. It is needed to identify the change. Default LREP namespace is "localchange".
	 * @param {String} sName Name of the change
	 * @param {String} sType File type extension
	 * @param {Boolean} bIsRuntime The stored file content is handed over to the lrep provider that can dynamically adjust the content to the runtime
	 *        context (e.g. do text replacement to the users' logon language) before
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.getStaticResource = function(sNamespace, sName, sType, bIsRuntime) {
		var sApiPath = "/sap/bc/lrep/content/";
		var sRequestPath = sApiPath;
		sRequestPath += sNamespace + "/" + sName + "." + sType;

		var aParams = [];
		if (!bIsRuntime) {
			aParams.push({
				name: "dt",
				value: "true"
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "GET", null, null);
	};

	/**
	 * Retrieves the file attributes for a given resource in the LREP.
	 *
	 * @param {String} sNamespace The abap package goes here. It is needed to identify the change. Default LREP namespace is "localchange".
	 * @param {String} sName Name of the change
	 * @param {String} sType File type extension
	 * @param {String} sLayer File layer
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.getFileAttributes = function(sNamespace, sName, sType, sLayer) {
		var sApiPath = "/sap/bc/lrep/content/";
		var sRequestPath = sApiPath;
		sRequestPath += sNamespace + "/" + sName + "." + sType;

		var aParams = [];
		aParams.push({
			name: "metadata",
			value: "true"
		});

		if (sLayer) {
			aParams.push({
				name: "layer",
				value: sLayer
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "GET", null, null);
	};

	/**
	 * Upserts a given change or variant via REST call.
	 *
	 * @param {String} sNamespace The abap package goes here. It is needed to identify the change.
	 * @param {String} sName Name of the change
	 * @param {String} sType File type extension
	 * @param {String} sLayer File layer
	 * @param {String} sContent File content to be saved as string
	 * @param {String} sContentType Content type (e.g. application/json, text/plain, ...), default: application/json
	 * @param {String} sChangelist The transport ID, optional
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.upsert = function(sNamespace, sName, sType, sLayer, sContent, sContentType, sChangelist) {
		var that = this;
		return Promise.resolve(that._fileAction("PUT", sNamespace, sName, sType, sLayer, sContent, sContentType, sChangelist));
	};

	/**
	 * Delete a file via REST call.
	 *
	 * @param {String} sNamespace The abap package goes here. It is needed to identify the change.
	 * @param {String} sName Name of the change
	 * @param {String} sType File type extension
	 * @param {String} sLayer File layer
	 * @param {String} sChangelist The transport ID, optional
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.deleteFile = function(sNamespace, sName, sType, sLayer, sChangelist) {
		return this._fileAction("DELETE", sNamespace, sName, sType, sLayer, null, null, sChangelist);
	};

	Connector.prototype._fileAction = function(sMethod, sNamespace, sName, sType, sLayer, sContent, sContentType, sChangelist) {
		var sApiPath = "/sap/bc/lrep/content/";
		var sRequestPath = sApiPath;
		sRequestPath += sNamespace + "/" + sName + "." + sType;

		var aParams = [];
		aParams.push({
			name: "layer",
			value: sLayer
		});

		if (sChangelist) {
			aParams.push({
				name: "changelist",
				value: sChangelist
			});
		}

		sRequestPath += this._buildParams(aParams);

		var mOptions = {
			contentType: sContentType || this.DEFAULT_CONTENT_TYPE
		};

		return this.send(sRequestPath, sMethod.toUpperCase(), sContent, mOptions);
	};

	/**
	 * @param {String} sOriginNamespace The abap package goes here. It is needed to identify the change. Default LREP namespace is "localchange".
	 * @param {String} sName Name of the change
	 * @param {String} sType File type extension
	 * @param {String} sOriginLayer File layer
	 * @param {String} sTargetLayer File where the new Target-Layer
	 * @param {String} sTargetNamespace target namespace
	 * @param {String} sChangelist The changelist where the file will be written to
	 * @returns {Object} Returns the result from the request
	 * @private Private for now, as is not in use.
	 */
	Connector.prototype.publish = function(sOriginNamespace, sName, sType, sOriginLayer, sTargetLayer, sTargetNamespace, sChangelist) {
		var sApiPath = "/sap/bc/lrep/actions/publish/";
		var sRequestPath = sApiPath;
		sRequestPath += sOriginNamespace + "/" + sName + "." + sType;

		var aParams = [];
		if (sOriginLayer) {
			aParams.push({
				name: "layer",
				value: sOriginLayer
			});
		}
		if (sTargetLayer) {
			aParams.push({
				name: "target-layer",
				value: sTargetLayer
			});
		}
		if (sTargetNamespace) {
			aParams.push({
				name: "target-namespace",
				value: sTargetNamespace
			});
		}
		if (sChangelist) {
			aParams.push({
				name: "changelist",
				value: sChangelist
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "POST", {}, null);
	};

	/**
	 * Retrieves the content for a given namespace and layer via REST call.
	 *
	 * @param {String} sNamespace - The file namespace goes here. It is needed to identify the change.
	 * @param {String} sLayer - File layer
	 * @returns {Object} Returns the result from the request
	 * @public
	 */
	Connector.prototype.listContent = function(sNamespace, sLayer) {
		var sRequestPath = "/sap/bc/lrep/content/";
		sRequestPath += sNamespace;

		var aParams = [];
		if (sLayer) {
			aParams.push({
				name: "layer",
				value: sLayer
			});
		}

		sRequestPath += this._buildParams(aParams);

		return this.send(sRequestPath, "GET", null, null);
	};

	return Connector;
}, true);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using OpenIdConnectServer.Models;

namespace OpenIdConnectServer.Services
{
    public interface IPasswordVerifier<TUser> where TUser : class, IUser
    {
        Task<PasswordVerificationResult> VerifyPasswordAsync(
            IUserStore<TUser> store,
            TUser user,
            string password,
            Func<Task<PasswordVerificationResult>> next);
    }

    public class DefaultPasswordVerifier<TUser> : IPasswordVerifier<TUser> where TUser : class, IUser
    {
        public Task<PasswordVerificationResult> VerifyPasswordAsync(IUserStore<TUser> store, TUser user, string password, Func<Task<PasswordVerificationResult>> next)
        {
            return next();
        }
    }
}


text:
'use strict';

/**
 * @ngdoc service
 * @name webApp.dataFactory
 * @description
 * # dataFactory
 * Factory in the webApp.
 */
angular.module('webApp')
  .factory('dataFactory', function ($http) {
     var dataset = {
      incidents:null,
      subjects:null,
      totalSubjects: 0,
      filteredSubjectsCount: 0,
      totalIncidents: 0,
      filteredIncidentsCount : 0,
      filteredIncidents : [],
      currIncident :null
    };
     var agencies = null;
     var filterRanges ={};
     var dataService = {};
     var dataReady = false;
     var currFilters ={};
     var currIncidentId = null;

     $http.get("data/incidents.json").success(function (data, status, headers, config) {
        dataset.incidents = data;
        dataset.totalIncidents = data.length;
        // get subjects
        $http.get("data/subjects.json").success(function (data, status, headers, config) {
          dataset.subjects = data;
          dataset.totalSubjects = data.length;

          // get agencies
          $http.get("data/agencies.json").success(function (data, status, headers, config) {
            agencies = _.groupBy(data,'incidentId');

            // merge all datasets
            _.each(dataset.incidents, function(incident, index){
              var subs = _.where(dataset.subjects,{'incidentId':incident.id});
              var agncs = _.chain(agencies[incident.id]).pluck("agency").uniq().value();

              for(var i=0; i<subs.length;i++){
                subs[i]['agencies']=_.clone(agncs);
              }
              incident['subjects'] = _.clone(subs);
              incident['agencies'] = _.clone(agncs);
            });

            setFilterRanges();
            dataReady = true;
            filterData();
          });
        });
      });

     function setFilterRanges(){
      for (var prop in dataset.subjects[0]) {
          if(dataset.subjects[0].hasOwnProperty(prop)){
            filterRanges[prop] = _.chain(dataset.subjects)
                    .pluck(prop)
                    .uniq()
                    .without("")
                    .union(["-All-"])
                    .value()
                    .sort();
          }

          // change range for year of incident
          filterRanges['year'] = _.chain(dataset.subjects)
                    .pluck('date')
                    .map(function (date, index){ return new Date(date).getFullYear();})
                    .uniq()
                    .without("")
                    .union(["-All-"])
                    .value()
                    .sort();

          // agencies
          filterRanges['agencies'] = _.chain(dataset.subjects)
                    .pluck('agencies')
                    .flatten()
                    .uniq()
                    .without("")
                    .union(["-All-"])
                    .value()
                    .sort();

          // weapons
          filterRanges['weapons'] = _.chain(dataset.subjects)
                    .pluck('weapons')
                    .flatten()
                    .uniq()
                    .without("")
                    .union(["-All-"])
                    .value()
                    .sort();

        }
     }

     function resetFilters(){
      for(var i=0;i< dataset.subjects.length;i++){
          dataset.subjects[i].filterPass=true;
        }
        dataset.subjects = _.sortBy(dataset.subjects,function(d){ return d.sortOrder;});
     }

     function filterData(){
      if(!dataReady){
        return;
      }
      resetFilters();
      filterSubjects();
      filterIncidents();
      setCurrIncident();
    }

    function filterSubjects(){
      var defaultRangeVal ='-All-';
      // rewrite this
      for(var i=0;i<dataset.subjects.length;i++){
        var pass = true;
        var d = dataset.subjects[i];
        if(currFilters.gender && currFilters.gender!=defaultRangeVal && d.gender!=currFilters.gender){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.ethnicity && currFilters.ethnicity!=defaultRangeVal && d.ethnicity!=currFilters.ethnicity){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.injuryLevel && currFilters.injuryLevel!=defaultRangeVal && d.injuryLevel!=currFilters.injuryLevel){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.shotAtPolice && currFilters.shotAtPolice!=defaultRangeVal && d.shotAtPolice!=currFilters.shotAtPolice){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.incidentCity && currFilters.incidentCity!=defaultRangeVal && d.incidentCity!=currFilters.incidentCity){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.year && currFilters.year!=defaultRangeVal && new Date(d.date).getFullYear()!=currFilters.year){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.agencies && currFilters.agencies!=defaultRangeVal && !_.contains(d.agencies,currFilters.agencies)){
          dataset.subjects[i].filterPass = false;
          continue;
        }
        if(currFilters.weapons && currFilters.weapons!=defaultRangeVal && !_.contains(d.weapons,currFilters.weapons)){
          dataset.subjects[i].filterPass = false;
          continue;
        }
      }
      dataset.filteredSubjectsCount = _.where(dataset.subjects,{filterPass:true}).length;
    }

    function filterIncidents(){
      //dataset.filteredIncidents = [];
      var incidentIds = _.chain(dataset.subjects).where({'filterPass':true}).pluck("incidentId").value();
      dataset.filteredIncidents = _.filter(dataset.incidents, function(incident){
        return _.contains(incidentIds,incident.id)
      });
      dataset.filteredIncidentsCount = incidentIds.length;

    }

    function setCurrIncident(){
       var incident = _.where(dataset.incidents, {'id':currIncidentId});
       dataset.currIncident = null;
       if(incident){
        dataset.currIncident = incident[0];
       }

    }

     // Public members
     dataService.getDataset = function(){
      return dataset;
     }

     dataService.setFilters = function(criteria){
        currFilters = criteria;
        filterData();
      }

     dataService.getFilterRanges = function (){
       return filterRanges;
     }

     dataService.getIncident = function(id){
      currIncidentId = id.toUpperCase();
      setCurrIncident();
      return dataset;
     }

     dataService.getNextIncident = function(){
      if(!dataReady || !currIncidentId){
        return;
      }
      return _.find(dataset.filteredIncidents, function(incident, index){
        if(dataset.filteredIncidents[index-1]){
        return dataset.filteredIncidents[index-1].id == currIncidentId;
        }
      return false;
      });
     }

     dataService.getPrevIncident = function(){
      if(!dataReady || !currIncidentId){
        return;
      }
      return _.find(dataset.filteredIncidents, function(incident, index){
        if(dataset.filteredIncidents[index+1]){
        return dataset.filteredIncidents[index+1].id == currIncidentId;
        }
      return false;
      });
     }

     return dataService;
  });


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>Unit Tests for math.js</title>
  <link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>

Unit Tests for math.js


text:
package recognition;

import edu.cmu.sphinx.frontend.util.Microphone;
import edu.cmu.sphinx.recognizer.Recognizer;
import edu.cmu.sphinx.result.Result;
import edu.cmu.sphinx.util.props.ConfigurationManager;
import java.io.IOException;
import sync.Constants;
import sync.Display;

/**
 *
 * @author Nami
 * TODO: SPHINX5 PREALPHA CONFIGURATION
 */
public class SyncListener {
    private static ConfigurationManager cm;
    private static Recognizer recognizer;
    private static Microphone microphone;
    private boolean isListening = true;

    private static SyncListener _instance = null;

    private synchronized static void createInstance () {
        if (_instance == null) _instance = new SyncListener();
    }
    public static SyncListener getInstance(){
        if(_instance == null)
            createInstance();
        return _instance;
    }

    public void setListening(boolean l){
        isListening = l;
    }

    private SyncListener(){
        cm = new ConfigurationManager(SyncListener.class.getResource("config.xml"));
        recognizer = (Recognizer) cm.lookup("recognizer");
        microphone = (Microphone) cm.lookup("microphone");
        recognizer.allocate();
    }

    public boolean isListening(){
        return isListening;
    }

    public String Listen() throws IOException {
        try{
            microphone.clear();
            if (!microphone.startRecording()) {
                //this.microphone = (Microphone) cm.lookup("microphone");
                microphone.initialize();
            }
            Result result = recognizer.recognize(); //!Important DO NOT REMOVE!
            String command = "";
            while(command.equalsIgnoreCase("")){
                //if(isListening){
                    microphone.clear();
                    result = recognizer.recognize();
                    command = result.getBestFinalResultNoFiller();
                    if(command.equalsIgnoreCase(""))
                        Display.getInstance().setInfo(Constants.emptyCommandMessage);
                //} else {
                    //command = "go to sleep";
                //}
            }
            microphone.stopRecording();
            microphone.clear();
            //if(command.contains("sleep") || command.contains("shut up") || command.contains("shht")){
                //isListening = false;
            //}
            if((!isListening && command.contains(Constants.wakeUpCommand)) || isListening && Display.getInstance().isCommandEmpty()){
                isListening = true;
                return command;
            }

        } catch (IllegalStateException ex){
            System.out.println(ex);
        }
        return null;
    }
}


text:
package xyz.wiedenhoeft.scalacrypt

import scala.util.{ Try, Success, Failure }

/**
 * Describes a block cipher mode of operation like ECB or CBC.
 *
 * Each of the methods below gets a state and returns a state. The
 * state is propagated like this: pre* ⇒ post* ⇒ pre*. On the first
 * block pre* receives the None object as the state.
 */
trait BlockCipherMode {

  /** Parameters used to construct this cipher. */
  def params: Parameters

  /** Process the block before it is encrypted. */
  def preEncryptBlock(block: Seq[Byte], state: Option[Any]): (Seq[Byte], Option[Any])

  /** Process the block after it was encrypted. */
  def postEncryptBlock(block: Seq[Byte], state: Option[Any]): (Seq[Byte], Option[Any])

  /** Process the block before it is decrypted. */
  def preDecryptBlock(block: Seq[Byte], state: Option[Any]): (Seq[Byte], Option[Any])

  /** Process the block after it was decrypted. */
  def postDecryptBlock(block: Seq[Byte], state: Option[Any]): (Seq[Byte], Option[Any])
}

abstract class CanBuildBlockCipherMode[A <: BlockCipherMode] {

  def build(params: Parameters): Try[A]
}

object BlockCipherMode {

  def apply[A <: BlockCipherMode: CanBuildBlockCipherMode](params: Parameters)(implicit builder: CanBuildBlockCipherMode[A]) =
    builder.build(params)
}


text:
#import <Foundation/Foundation.h>

@interface AuthHandle : NSObject{

}

- (void)authenticate:(NSString *) userName  password:(NSString *)password;

- (void)authenticateUsingKeyChain;

-(void) populateUserSession:(NSString *)name;

- (void) logout;

@end


text:
package com.example.propertyanimation.circleimageview;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.graphics.Xfermode;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
import java.lang.ref.WeakReference;

/**
 * 创建者     李文东
 * 创建时间   2017/5/23 11:43
 * 描述	      显示圆形图片的imageview
 * 更新者     $Author$
 * 更新时间   $Date$
 * 更新描述   ${TODO}
 */
public class GradientImageView extends ImageView {
	// 白色边缘大小
	private int mGradientBorder = 7;
	// 设置白色边缘与渐变间距
	private int mGradientGap = 5;
	// 画笔
	private Paint mPaint;
	// 使用缓存机制来保存处理好的bitmap,便于GC
	private WeakReference<Bitmap> mWeakBitmap;
	// 设置Xfermode的模式为DST_IN
	private Xfermode xfermode = new PorterDuffXfermode(Mode.DST_IN);
	// 蒙板图层
	private Bitmap mMaskBitmap;

	public GradientImageView(Context context) {
		this(context, null);
	}

	public GradientImageView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public GradientImageView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		// 初始化画笔
		mPaint = new Paint();
		mPaint.setAntiAlias(true);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		// 强制宽高一致,以最小的值为准
		int mWidth = Math.min(getMeasuredWidth(), getMeasuredHeight());
		setMeasuredDimension(mWidth, mWidth);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		// 从缓存中取出图片
		Bitmap bitmap = mWeakBitmap == null ? null : mWeakBitmap.get();
		// 如果没有缓存或者被回收了,则重新绘制
		if (bitmap == null || bitmap.isRecycled()) {
			// 获取背景drawable
			Drawable drawable = getDrawable();
			// 如果有背景图则绘制
			if (drawable != null) {
				// 拿到drawable的长度和宽度
				int dWidth = drawable.getIntrinsicWidth();
				int dHeight = drawable.getIntrinsicHeight();
				bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Config.ARGB_8888);
				// 创建画布
				Canvas canvas1 = new Canvas(bitmap);
				// 设置图片缩放比率
				float scale = 1.0f;
				scale = Math.max(getWidth() * 1.0f / dWidth, getHeight() * 1.0f / dHeight);
				// 缩放图片
				drawable.setBounds(0, 0, (int) (scale * dWidth), (int) (scale * dHeight));
				// 绘制DST图片
				drawable.draw(canvas1);
				// 绘制SRC图片
				if (mMaskBitmap == null || mMaskBitmap.isRecycled()) {
					mMaskBitmap = drawType();
				}
				// 重置画笔
				mPaint.reset();
				// 不采用滤波
				mPaint.setFilterBitmap(false);
				mPaint.setXfermode(xfermode);
				canvas1.drawBitmap(mMaskBitmap, 0, 0, mPaint);
				Paint paint1 = new Paint(Paint.ANTI_ALIAS_FLAG);
				paint1.setColor(0xffffffff);
				paint1.setStrokeWidth(mGradientBorder);
				paint1.setStyle(Paint.Style.STROKE);
				paint1.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
				canvas1.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 2 - mGradientGap, paint1);
				// drawable.draw(canvas);
				// 绘制处理好的图形
				mPaint.setXfermode(null);
				canvas.drawBitmap(bitmap, 0, 0, mPaint);
				// 缓存图片
				mWeakBitmap = new WeakReference<Bitmap>(bitmap);
			}
		}
		if (bitmap != null) {
			mPaint.setXfermode(null);
			canvas.drawBitmap(bitmap, 0.0f, 0.0f, mPaint);
		}
	}

	/**
	 * 绘制形状,作为src
	 *
	 * @return
	 */
	private Bitmap drawType() {
		Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Config.ARGB_8888);
		Canvas canvas = new Canvas(bitmap);
		// 创建画笔
		Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
		paint.setDither(true);
		RadialGradient
        gradient = new RadialGradient(getWidth() / 2, getHeight() / 2, getWidth() / 2, new int[] { 0xff5d5d5d, 0xff5d5d5d, 0x00ffffff }, new float[] { 0.f, 0.9f, 1.0f }, Shader.TileMode.CLAMP);
		paint.setShader(gradient);
		canvas.drawCircle(getWidth() / 2, getWidth() / 2, getWidth() / 2, paint);
		return bitmap;
	}

	// 在重绘中进行mask和dst的内存回收
	@Override
	public void invalidate() {
		mWeakBitmap = null;
		if (mMaskBitmap != null) {
			mMaskBitmap.recycle();
			mMaskBitmap = null;
		}
		super.invalidate();
	}

	// 对外公布白色边缘宽度
	public void setGradientBorder(int gradientBorder) {
		this.mGradientBorder = gradientBorder;
	}

	// 对外公布白色边缘与渐变间距
	public void setGradientGap(int gradientGap) {
		this.mGradientGap = gradientGap;
	}
}


text:
package org.apache.tomcat.util.net;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.security.KeyStore;
import java.security.UnrecoverableKeyException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.TrustManagerFactory;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.compat.JreCompat;
import org.apache.tomcat.util.net.openssl.ciphers.Cipher;
import org.apache.tomcat.util.net.openssl.ciphers.OpenSSLCipherConfigurationParser;
import org.apache.tomcat.util.res.StringManager;

/**
 * Represents the TLS configuration for a virtual host.
 */
public class SSLHostConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    private static final Log log = LogFactory.getLog(SSLHostConfig.class);
    private static final StringManager sm = StringManager.getManager(SSLHostConfig.class);

    private static final String DEFAULT_CIPHERS = "HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!kRSA";

    protected static final String DEFAULT_SSL_HOST_NAME = "_default_";
    protected static final Set<String> SSL_PROTO_ALL_SET = new HashSet<>();

    static {
        /* Default used if protocols is not configured, also used if
         * protocols="All"
         */
        SSL_PROTO_ALL_SET.add(Constants.SSL_PROTO_SSLv2Hello);
        SSL_PROTO_ALL_SET.add(Constants.SSL_PROTO_TLSv1);
        SSL_PROTO_ALL_SET.add(Constants.SSL_PROTO_TLSv1_1);
        SSL_PROTO_ALL_SET.add(Constants.SSL_PROTO_TLSv1_2);
    }

    private Type configType = null;
    private Type currentConfigType = null;
    private Map<Type,Set<String>> configuredProperties = new HashMap<>();

    private String hostName = DEFAULT_SSL_HOST_NAME;

    // OpenSSL can handle multiple certs in a single config so the reference to
    // the context is here at the virtual host level. JSSE can't so the
    // reference is held on the certificate.
    private transient Long openSslContext;

    // Configuration properties

    // Internal
    private String[] enabledCiphers;
    private String[] enabledProtocols;
    // Nested
    private SSLHostConfigCertificate defaultCertificate = null;
    private Set<SSLHostConfigCertificate> certificates = new HashSet<>(4);
    // Common
    private String certificateRevocationListFile;
    private CertificateVerification certificateVerification = CertificateVerification.NONE;
    private int certificateVerificationDepth = 10;
    // Used to track if certificateVerificationDepth has been explicitly set
    private boolean certificateVerificationDepthConfigured = false;
    private String ciphers;
    private LinkedHashSet<Cipher> cipherList = null;
    private List<String> jsseCipherNames = null;
    private String honorCipherOrder = null;
    private Set<String> protocols = new HashSet<>();
    // JSSE
    private String keyManagerAlgorithm = KeyManagerFactory.getDefaultAlgorithm();
    private boolean revocationEnabled = false;
    private int sessionCacheSize = 0;
    private int sessionTimeout = 86400;
    private String sslProtocol = Constants.SSL_PROTO_TLS;
    private String trustManagerClassName;
    private String truststoreAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
    private String truststoreFile = System.getProperty("javax.net.ssl.trustStore");
    private String truststorePassword = System.getProperty("javax.net.ssl.trustStorePassword");
    private String truststoreProvider = System.getProperty("javax.net.ssl.trustStoreProvider");
    private String truststoreType = System.getProperty("javax.net.ssl.trustStoreType");
    private transient KeyStore truststore = null;
    // OpenSSL
    private String certificateRevocationListPath;
    private String caCertificateFile;
    private String caCertificatePath;
    private boolean disableCompression = true;
    private boolean disableSessionTickets = false;
    private boolean insecureRenegotiation = false;

    public SSLHostConfig() {
        // Set defaults that can't be (easily) set when defining the fields.
        setProtocols(Constants.SSL_PROTO_ALL);
    }

    public Long getOpenSslContext() {
        return openSslContext;
    }

    public void setOpenSslContext(Long openSslContext) {
        this.openSslContext = openSslContext;
    }

    // Expose in String form for JMX
    public String getConfigType() {
        return configType.name();
    }
    public void setConfigType(Type configType) {
        this.configType = configType;
        if (configType == Type.EITHER) {
            if (configuredProperties.remove(Type.JSSE) == null) {
                configuredProperties.remove(Type.OPENSSL);
            }
        } else {
            configuredProperties.remove(configType);
        }
        for (Map.Entry<Type,Set<String>> entry : configuredProperties.entrySet()) {
            for (String property : entry.getValue()) {
                log.warn(sm.getString("sslHostConfig.mismatch",
                        property, getHostName(), entry.getKey(), configType));
            }
        }
    }

    void setProperty(String name, Type configType) {
        if (this.configType == null) {
            Set<String> properties = configuredProperties.get(configType);
            if (properties == null) {
                properties = new HashSet<>();
                configuredProperties.put(configType, properties);
            }
            properties.add(name);
        } else if (this.configType == Type.EITHER) {
            if (currentConfigType == null) {
                currentConfigType = configType;
            } else if (currentConfigType != configType) {
                log.warn(sm.getString("sslHostConfig.mismatch",
                        name, getHostName(), configType, currentConfigType));
            }
        } else {
            if (configType != this.configType) {
                log.warn(sm.getString("sslHostConfig.mismatch",
                        name, getHostName(), configType, this.configType));
            }
        }
    }

    // ----------------------------------------------------- Internal properties

    /**
     * @see SSLUtil#getEnabledProtocols()
     *
     * @return The protocols enabled for this TLS virtual host
     */
    public String[] getEnabledProtocols() {
        return enabledProtocols;
    }

    void setEnabledProtocols(String[] enabledProtocols) {
        this.enabledProtocols = enabledProtocols;
    }

    /**
     * @see SSLUtil#getEnabledCiphers()
     *
     * @return The ciphers enabled for this TLS virtual host
     */
    public String[] getEnabledCiphers() {
        return enabledCiphers;
    }

    void setEnabledCiphers(String[] enabledCiphers) {
        this.enabledCiphers = enabledCiphers;
    }

    // ------------------------------------------- Nested configuration elements

    private void registerDefaultCertificate() {
        if (defaultCertificate == null) {
            defaultCertificate = new SSLHostConfigCertificate(
                    this, SSLHostConfigCertificate.Type.UNDEFINED);
            certificates.add(defaultCertificate);
        }
    }

    public void addCertificate(SSLHostConfigCertificate certificate) {
        // Need to make sure that if there is more than one certificate, none of
        // them have a type of undefined.
        if (certificates.size() == 0) {
            certificates.add(certificate);
            return;
        }

        if (certificates.size() == 1 &&
                certificates.iterator().next().getType() == SSLHostConfigCertificate.Type.UNDEFINED ||
                        certificate.getType() == SSLHostConfigCertificate.Type.UNDEFINED) {
            // Invalid config
            throw new IllegalArgumentException(sm.getString("sslHostConfig.certificate.notype"));
        }

        certificates.add(certificate);
    }

    public Set<SSLHostConfigCertificate> getCertificates() {
        return getCertificates(false);
    }

    public Set<SSLHostConfigCertificate> getCertificates(boolean createDefaultIfEmpty) {
        if (certificates.size() == 0 && createDefaultIfEmpty) {
            registerDefaultCertificate();
        }
        return certificates;
    }

    // ----------------------------------------- Common configuration properties

    // TODO: This certificate setter can be removed once it is no longer
    // necessary to support the old configuration attributes (Tomcat 10?).

    public String getCertificateKeyPassword() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeyPassword();
    }
    public void setCertificateKeyPassword(String certificateKeyPassword) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeyPassword(certificateKeyPassword);
    }

    public void setCertificateRevocationListFile(String certificateRevocationListFile) {
        this.certificateRevocationListFile = certificateRevocationListFile;
    }

    public String getCertificateRevocationListFile() {
        return certificateRevocationListFile;
    }

    public void setCertificateVerification(String certificateVerification) {
        this.certificateVerification = CertificateVerification.fromString(certificateVerification);
    }

    public CertificateVerification getCertificateVerification() {
        return certificateVerification;
    }

    public void setCertificateVerificationDepth(int certificateVerificationDepth) {
        this.certificateVerificationDepth = certificateVerificationDepth;
        certificateVerificationDepthConfigured = true;
    }

    public int getCertificateVerificationDepth() {
        return certificateVerificationDepth;
    }

    public boolean isCertificateVerificationDepthConfigured() {
        return certificateVerificationDepthConfigured;
    }

    /**
     * Set the new cipher configuration. Note: Regardless of the format used to
     * set the configuration, it is always stored in OpenSSL format.
     *
     * @param ciphersList The new cipher configuration in OpenSSL or JSSE format
     */
    public void setCiphers(String ciphersList) {
        // Ciphers is stored in OpenSSL format. Convert the provided value if
        // necessary.
        if (ciphersList != null && !ciphersList.contains(":")) {
            StringBuilder sb = new StringBuilder();
            // Not obviously in OpenSSL format. May be a single OpenSSL or JSSE
            // cipher name. May be a comma separated list of cipher names
            String ciphers[] = ciphersList.split(",");
            for (String cipher : ciphers) {
                String trimmed = cipher.trim();
                if (trimmed.length() > 0) {
                    String openSSLName = OpenSSLCipherConfigurationParser.jsseToOpenSSL(trimmed);
                    if (openSSLName == null) {
                        // Not a JSSE name. Maybe an OpenSSL name or alias
                        openSSLName = trimmed;
                    }
                    if (sb.length() > 0) {
                        sb.append(':');
                    }
                    sb.append(openSSLName);
                }
            }
            this.ciphers = sb.toString();
        } else {
            this.ciphers = ciphersList;
        }
        this.cipherList = null;
        this.jsseCipherNames = null;
    }

    /**
     * @return An OpenSSL cipher string for the current configuration.
     */
    public String getCiphers() {
        if (ciphers == null) {
            if (!JreCompat.isJre8Available() && Type.JSSE.equals(configType)) {
                ciphers = DEFAULT_CIPHERS + ":!DHE";
            } else {
                ciphers = DEFAULT_CIPHERS;
            }

        }
        return ciphers;
    }

    public LinkedHashSet<Cipher> getCipherList() {
        if (cipherList == null) {
            cipherList = OpenSSLCipherConfigurationParser.parse(getCiphers());
        }
        return cipherList;
    }

    /**
     * Obtain the list of JSSE cipher names for the current configuration.
     * Ciphers included in the configuration but not supported by JSSE will be
     * excluded from this list.
     *
     * @return A list of the JSSE cipher names
     */
    public List<String> getJsseCipherNames() {
        if (jsseCipherNames == null) {
            jsseCipherNames = OpenSSLCipherConfigurationParser.convertForJSSE(getCipherList());
        }
        return jsseCipherNames;
    }

    public void setHonorCipherOrder(String honorCipherOrder) {
        this.honorCipherOrder = honorCipherOrder;
    }

    public String getHonorCipherOrder() {
        return honorCipherOrder;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public String getHostName() {
        return hostName;
    }

    public void setProtocols(String input) {
        protocols.clear();

        // List of protocol names, separated by ",", "+" or "-".
        // Semantics is adding ("+") or removing ("-") from left
        // to right, starting with an empty protocol set.
        // Tokens are individual protocol names or "all" for a
        // default set of supported protocols.
        // Separator "," is only kept for compatibility and has the
        // same semantics as "+", except that it warns about a potentially
        // missing "+" or "-".

        // Split using a positive lookahead to keep the separator in
        // the capture so we can check which case it is.
        for (String value: input.split("(?=[-+,])")) {
            String trimmed = value.trim();
            // Ignore token which only consists of prefix character
            if (trimmed.length() > 1) {
                if (trimmed.charAt(0) == '+') {
                    trimmed = trimmed.substring(1).trim();
                    if (trimmed.equalsIgnoreCase(Constants.SSL_PROTO_ALL)) {
                        protocols.addAll(SSL_PROTO_ALL_SET);
                    } else {
                        protocols.add(trimmed);
                    }
                } else if (trimmed.charAt(0) == '-') {
                    trimmed = trimmed.substring(1).trim();
                    if (trimmed.equalsIgnoreCase(Constants.SSL_PROTO_ALL)) {
                        protocols.removeAll(SSL_PROTO_ALL_SET);
                    } else {
                        protocols.remove(trimmed);
                    }
                } else {
                    if (trimmed.charAt(0) == ',') {
                        trimmed = trimmed.substring(1).trim();
                    }
                    if (!protocols.isEmpty()) {
                        log.warn(sm.getString("sslHostConfig.prefix_missing",
                                 trimmed, getHostName()));
                    }
                    if (trimmed.equalsIgnoreCase(Constants.SSL_PROTO_ALL)) {
                        protocols.addAll(SSL_PROTO_ALL_SET);
                    } else {
                        protocols.add(trimmed);
                    }
                }
            }
        }
    }

    public Set<String> getProtocols() {
        return protocols;
    }

    // ---------------------------------- JSSE specific configuration properties

    // TODO: These certificate setters can be removed once it is no longer
    // necessary to support the old configuration attributes (Tomcat 10?).

    public String getCertificateKeyAlias() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeyAlias();
    }
    public void setCertificateKeyAlias(String certificateKeyAlias) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeyAlias(certificateKeyAlias);
    }

    public String getCertificateKeystoreFile() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeystoreFile();
    }
    public void setCertificateKeystoreFile(String certificateKeystoreFile) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeystoreFile(certificateKeystoreFile);
    }

    public String getCertificateKeystorePassword() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeystorePassword();
    }
    public void setCertificateKeystorePassword(String certificateKeystorePassword) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeystorePassword(certificateKeystorePassword);
    }

    public String getCertificateKeystoreProvider() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeystoreProvider();
    }
    public void setCertificateKeystoreProvider(String certificateKeystoreProvider) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeystoreProvider(certificateKeystoreProvider);
    }

    public String getCertificateKeystoreType() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeystoreType();
    }
    public void setCertificateKeystoreType(String certificateKeystoreType) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeystoreType(certificateKeystoreType);
    }

    public void setKeyManagerAlgorithm(String keyManagerAlgorithm) {
        setProperty("keyManagerAlgorithm", Type.JSSE);
        this.keyManagerAlgorithm = keyManagerAlgorithm;
    }

    public String getKeyManagerAlgorithm() {
        return keyManagerAlgorithm;
    }

    public void setRevocationEnabled(boolean revocationEnabled) {
        setProperty("revocationEnabled", Type.JSSE);
        this.revocationEnabled = revocationEnabled;
    }

    public boolean getRevocationEnabled() {
        return revocationEnabled;
    }

    public void setSessionCacheSize(int sessionCacheSize) {
        setProperty("sessionCacheSize", Type.JSSE);
        this.sessionCacheSize = sessionCacheSize;
    }

    public int getSessionCacheSize() {
        return sessionCacheSize;
    }

    public void setSessionTimeout(int sessionTimeout) {
        setProperty("sessionTimeout", Type.JSSE);
        this.sessionTimeout = sessionTimeout;
    }

    public int getSessionTimeout() {
        return sessionTimeout;
    }

    public void setSslProtocol(String sslProtocol) {
        setProperty("sslProtocol", Type.JSSE);
        this.sslProtocol = sslProtocol;
    }

    public String getSslProtocol() {
        return sslProtocol;
    }

    public void setTrustManagerClassName(String trustManagerClassName) {
        setProperty("trustManagerClassName", Type.JSSE);
        this.trustManagerClassName = trustManagerClassName;
    }

    public String getTrustManagerClassName() {
        return trustManagerClassName;
    }

    public void setTruststoreAlgorithm(String truststoreAlgorithm) {
        setProperty("truststoreAlgorithm", Type.JSSE);
        this.truststoreAlgorithm = truststoreAlgorithm;
    }

    public String getTruststoreAlgorithm() {
        return truststoreAlgorithm;
    }

    public void setTruststoreFile(String truststoreFile) {
        setProperty("truststoreFile", Type.JSSE);
        this.truststoreFile = truststoreFile;
    }

    public String getTruststoreFile() {
        return truststoreFile;
    }

    public void setTruststorePassword(String truststorePassword) {
        setProperty("truststorePassword", Type.JSSE);
        this.truststorePassword = truststorePassword;
    }

    public String getTruststorePassword() {
        return truststorePassword;
    }

    public void setTruststoreProvider(String truststoreProvider) {
        setProperty("truststoreProvider", Type.JSSE);
        this.truststoreProvider = truststoreProvider;
    }

    public String getTruststoreProvider() {
        if (truststoreProvider == null) {
            Set<SSLHostConfigCertificate> certificates = getCertificates();
            if (certificates.size() == 1) {
                return certificates.iterator().next().getCertificateKeystoreProvider();
            }
            return SSLHostConfigCertificate.DEFAULT_KEYSTORE_PROVIDER;
        } else {
            return truststoreProvider;
        }
    }

    public void setTruststoreType(String truststoreType) {
        setProperty("truststoreType", Type.JSSE);
        this.truststoreType = truststoreType;
    }

    public String getTruststoreType() {
        if (truststoreType == null) {
            Set<SSLHostConfigCertificate> certificates = getCertificates();
            if (certificates.size() == 1) {
                String keystoreType = certificates.iterator().next().getCertificateKeystoreType();
                // Don't use keystore type as the default if we know it is not
                // going to be used as a trust store type
                if (!"PKCS12".equalsIgnoreCase(keystoreType)) {
                    return keystoreType;
                }
            }
            return SSLHostConfigCertificate.DEFAULT_KEYSTORE_TYPE;
        } else {
            return truststoreType;
        }
    }

    public void setTrustStore(KeyStore truststore) {
        this.truststore = truststore;
    }

    public KeyStore getTruststore() throws IOException {
        KeyStore result = truststore;
        if (result == null) {
            if (truststoreFile != null){
                try {
                    result = SSLUtilBase.getStore(getTruststoreType(), getTruststoreProvider(),
                            getTruststoreFile(), getTruststorePassword());
                } catch (IOException ioe) {
                    Throwable cause = ioe.getCause();
                    if (cause instanceof UnrecoverableKeyException) {
                        // Log a warning we had a password issue
                        log.warn(sm.getString("jsse.invalid_truststore_password"),
                                cause);
                        // Re-try
                        result = SSLUtilBase.getStore(getTruststoreType(), getTruststoreProvider(),
                                getTruststoreFile(), null);
                    } else {
                        // Something else went wrong - re-throw
                        throw ioe;
                    }
                }
            }
        }
        return result;
    }

    // ------------------------------- OpenSSL specific configuration properties

    // TODO: These certificate setters can be removed once it is no longer
    // necessary to support the old configuration attributes (Tomcat 10?).

    public String getCertificateChainFile() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateChainFile();
    }
    public void setCertificateChainFile(String certificateChainFile) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateChainFile(certificateChainFile);
    }

    public String getCertificateFile() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateFile();
    }
    public void setCertificateFile(String certificateFile) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateFile(certificateFile);
    }

    public String getCertificateKeyFile() {
        registerDefaultCertificate();
        return defaultCertificate.getCertificateKeyFile();
    }
    public void setCertificateKeyFile(String certificateKeyFile) {
        registerDefaultCertificate();
        defaultCertificate.setCertificateKeyFile(certificateKeyFile);
    }

    public void setCertificateRevocationListPath(String certificateRevocationListPath) {
        setProperty("certificateRevocationListPath", Type.OPENSSL);
        this.certificateRevocationListPath = certificateRevocationListPath;
    }

    public String getCertificateRevocationListPath() {
        return certificateRevocationListPath;
    }

    public void setCaCertificateFile(String caCertificateFile) {
        setProperty("caCertificateFile", Type.OPENSSL);
        this.caCertificateFile = caCertificateFile;
    }

    public String getCaCertificateFile() {
        return caCertificateFile;
    }

    public void setCaCertificatePath(String caCertificatePath) {
        setProperty("caCertificatePath", Type.OPENSSL);
        this.caCertificatePath = caCertificatePath;
    }

    public String getCaCertificatePath() {
        return caCertificatePath;
    }

    public void setDisableCompression(boolean disableCompression) {
        setProperty("disableCompression", Type.OPENSSL);
        this.disableCompression = disableCompression;
    }

    public boolean getDisableCompression() {
        return disableCompression;
    }

    public void setDisableSessionTickets(boolean disableSessionTickets) {
        setProperty("disableSessionTickets", Type.OPENSSL);
        this.disableSessionTickets = disableSessionTickets;
    }

    public boolean getDisableSessionTickets() {
        return disableSessionTickets;
    }

    public void setInsecureRenegotiation(boolean insecureRenegotiation) {
        setProperty("insecureRenegotiation", Type.OPENSSL);
        this.insecureRenegotiation = insecureRenegotiation;
    }

    public boolean getInsecureRenegotiation() {
        return insecureRenegotiation;
    }

    // --------------------------------------------------------- Support methods

    public static String adjustRelativePath(String path) {
        // Empty or null path can't point to anything useful. The assumption is
        // that the value is deliberately empty / null so leave it that way.
        if (path == null || path.length() == 0) {
            return path;
        }
        String newPath = path;
        File f = new File(newPath);
        if ( !f.isAbsolute()) {
            newPath = System.getProperty(Constants.CATALINA_BASE_PROP) + File.separator + newPath;
            f = new File(newPath);
        }
        if (!f.exists()) {
            // TODO i18n, sm
            log.warn("configured file:["+newPath+"] does not exist.");
        }
        return newPath;
    }

    // ----------------------------------------------------------- Inner classes

    public static enum Type {
        JSSE,
        OPENSSL,
        EITHER
    }

    public static enum CertificateVerification {
        NONE,
        OPTIONAL_NO_CA,
        OPTIONAL,
        REQUIRED;

        public static CertificateVerification fromString(String value) {
            if ("true".equalsIgnoreCase(value) ||
                    "yes".equalsIgnoreCase(value) ||
                    "require".equalsIgnoreCase(value) ||
                    "required".equalsIgnoreCase(value)) {
                return REQUIRED;
            } else if ("optional".equalsIgnoreCase(value) ||
                    "want".equalsIgnoreCase(value)) {
                return OPTIONAL;
            } else if ("optionalNoCA".equalsIgnoreCase(value) ||
                    "optional_no_ca".equalsIgnoreCase(value)) {
                return OPTIONAL_NO_CA;
            } else if ("false".equalsIgnoreCase(value) ||
                    "no".equalsIgnoreCase(value) ||
                    "none".equalsIgnoreCase(value)) {
                return NONE;
            } else {
                // Could be a typo. Don't default to NONE since that is not
                // secure. Force user to fix config. Could default to REQUIRED
                // instead.
                throw new IllegalArgumentException(
                        sm.getString("sslHostConfig.certificateVerificationInvalid", value));
            }
        }
    }
}


text:
package edu.umd.cs.psl.model.argument;

/**
 * A {@link Term} that is ground, i.e., not a {@link Variable}.
 */
public interface GroundTerm extends Term, Comparable<GroundTerm> {

	/**
	 * Inherited from {@link Comparable#compareTo(Object)}.
	 *

	 * Implementations should compare to GroundTerms without a parent implementation
	 * in common using
	 *

	 * this.getClass().getSimpleName().compareTo(o.getClass().getSimpleName());
	 */
	@Override
	public int compareTo(GroundTerm o);
}


text:
using PrintumCommerce.ClassHelper;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace PrintumCommerce
{
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            //config.EnableCors();
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<Models.Access.Model1, Migrations.Model1.ConfigurationB>());
          //Database.SetInitializer(new MigrateDatabaseToLatestVersion<Models.DBPrintumContext, Migrations.DBPrintumContext.ConfigurationB>());
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<Models.DBPrintumContext, Migrations.DBPrintumContext.Configuration>());
            CheckRolesAndSuperUsers();
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }

        private void CheckRolesAndSuperUsers()
        {
            UsersHelper.CheckRole("AdminSystem");
            UsersHelper.CheckRole("User");
            UsersHelper.CheckSuperUser();
        }
    }
}


text:
typedef void (^CKIntBlock)(NSInteger integer);

@interface CKAlertManager : NSObject
singleton_interface(CKAlertManager)

+ (CKAlertViewController *)alertWithTitle:(NSString *)title
                                  message:(NSString *)message
                                     btns:(NSArray *)btns
                                    click:(CKIntBlock)click;

@end


text:
"""Common code to help in faking the models."""

from novaclient import exceptions as nova_exceptions
from trove.common import cfg
from trove.openstack.common import log as logging

CONF = cfg.CONF
LOG = logging.getLogger(__name__)

def authorize(context):
    if not context.is_admin:
        raise nova_exceptions.Forbidden(403, "Forbidden")


text:
package me.benjozork.onyx.game.entity.ai;

/**
 * Describes an AI shooting behavior.

 *
 * Most of the values here are defined using a minimum and a maximum; Those values will be

 * generated randomly each time the {@code resetTime} is passed.
 *
 * @author Benjozork
 */
public class AIShootingConfiguration {

    /**
     * The minimum time between two shooting streaks, in seconds
     */
    public float minStreakDelay;

    /**
     * The maximum time between two shooting streaks, in seconds
     */
    public float maxStreakDelay;

    /**
     * The minimum duration of a shooting streak, in seconds
     */
    public float minStreakTime;

    /**
     * The maximum duration of a shooting streak, in seconds
     */
    public float maxStreakTime;

    /**
     * The interval at which a projectile is fired, in seconds
     */
    public float shootInterval;

    /**
     * The interval for new shooting config values to be generated, in seconds
     */
    public float resetTime;

    /**
     * The minimum imprecision with which the projectiles are fired, in pixels
     */
    public float minImprecision;

    /**
     * The maximum imprecision with which the projectiles are fired, in pixels
     */
    public float maxImprecision;

    /**
     * Whether the shooting imprecision should be dynamically recalculated for a more dynamic effect.

     * WARNING: This increases the imprecision and CPU load.
     */
    public boolean recalculateImprecisionRandomly;

    /**
     * The minimum movement made at each frame to track a target.

     * Basically, the higher the final value, the quicker the AI can track a target.
     */
    public float minTargetTrackingDelta;

    /**
     * The maximum movement made at each frame to track a target.

     * Basically, the higher the final value, the quicker the AI can track a target.
     */
    public float maxTargetTrackingDelta;

}


text:
<?php
defined('EUA_VERSION') or die('Access denied');
/**
 * This is the View for the app "Search".
 *
 * @package apps/search
 * @author Hugo Michard <hugomichard@isep.fr>
 * @version 1.1.0-dd-mm-yyyy
 */

// This file is not needed
class SearchView extends View {
  function __construct() {
    // Here assign CSSs/JSs for all the app
    $this->assign('css',Config::get('config.base').'/apps/search/styles/style.css');
    $this->assign('js',Config::get('config.base').'/apps/search/scripts/style.js');
  }

  // Method for the module
  public function basicsearch() {
    // Here assign CSSs/JSs for that method
    $this->assign('css',Config::get('config.base').'/apps/search/styles/search.css');

    // The assign the view for the module
    $this->setTemplate('/apps/search/views/search.php');
  }

  public function advancedsearch() {
    //Here is assign CSSs and JSs for this method
    $this->assign('css',Config::get('config.base').'/apps/search/styles/search.css');

    //Here is assign the view for the module
    $this->setTemplate('/apps/search/views/search.php');

  }

}

?>


text:
#ifndef _SWAY_INPUT_H
#define _SWAY_INPUT_H

#include <libinput.h>
#include "config.h"
#include "list.h"

struct input_config *new_input_config(const char* identifier);

char* libinput_dev_unique_id(struct libinput_device *dev);

/**
 * Global input device list.
 */
extern list_t *input_devices;

/**
 * Pointer used when reading input blocked.
 * Shared so that it can be cleared from commands.c when closing the block
 */
extern struct input_config *current_input_config;

#endif


text:
SACalendar
==========

Introducing **SACalendar** - Easy to use and customizable iOS 7 Calendar

Only need 3 lines of code to set up. Every view customizable to fit your need.

This project uses the customized version of DMLazyScrollView (https://github.com/malcommac/DMLazyScrollView)

Added functionality in this fork:

- Localization

- Display of weekday names

- Switchable events highlighting with different background images or colors

Installation
==========

- Add the **SACalendar** folder into your project.
Make sure the "copy items into destination group's folder" box is checked

- Done

Basic Usage
==========
Import the class header
```objective-c
#import "SACalendar.h"
```

Initialize your calendar with the appropriate frame. The calendar will scale to fit your frame automatically.
```objective-c
- (void)viewDidLoad
{
    [super viewDidLoad];

    SACalendar *calendar = [[SACalendar alloc]initWithFrame:CGRectMake(0, 20, 320, 400)];

    calendar.delegate = self;

    [self.view addSubview:calendar];
}
```

Delegate (optional)
==========
SACalendar provides two delegate methods. didSelectDate gets called when a user click on a specific date. didDisplayCalendarForMonth gets called when the user swipe the calendar to a different month. To use it, implement the delegate in your view controller.
```objective-c
@interface ViewController () <SACalendarDelegate>
```
Then implement the optional delegate functions
```objective-c
// Called when a month was scrolled into view
- (void)calendar:(SACalendar *)calendar didDisplayCalendarForMonth:(int)month year:(int)year;

// Called when a date was selected
- (void)calendar:(SACalendar *)calendar didSelectDate:(int)day month:(int)month year:(int)year;
```

Event Highlighting
==================
Define event types by modifying the enum
```objective-c
SACalendarEventType
```
in the class
```objective-c
SACalendarConstants.h
```
Set/add events to a date with the following functions
```objective-c
- (void)setEvent:(SACalendarEventType)eventType forDate:(NSDateComponents *)dateComponents;

- (void)addEvent:(SACalendarEventType)eventType forDate:(NSDateComponents *)dateComponents;
```
Reset all stored events via
```objective-c
- (void)resetEvents;
```
Define how events/event combinations are being highlighted with the following functions
```objective-c
- (void)highlightEventType:(SACalendarEventType)eventType withBackgroundImage:(UIImage *)backgroundImage withTextColor:(UIColor *)textColor;

- (void)highlightEventType:(SACalendarEventType)eventType withBackgroundColor:(UIColor *)backgroundColor withTextColor:(UIColor *)textColor;
```
The images provided will be stretched and clipped to fill the background circle.

Enable/disable the event highlighting for certain events via
```objective-c
- (void)highlightForEventType:(SACalendarEventType)eventType setEnabled:(BOOL)enabled;
```

Customize
==========
- To customize the view properties such as cell size, font, colors, please see the class

```objective-c
SACalendarConstants.h
```
All ratio and UI constants are defined in this class. Change them to support your need.

- To customize the logic behind what's being displayed in the cells (i.e. blank circle at selected date), see this function in SACalendar.m

```objective-c
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
```

- To customize the components (subviews) of the cell or to add some views to the cell, please see this function in SACalendarCell.m

```objective-c
- (id)initWithFrame:(CGRect)frame
```