text
stringlengths
2
100k
meta
dict
body { font-family: sans-serif; } :focus { outline: 4px #3582ff solid; } .container, #container{ width: 720px; margin: 10px; border: black solid 1px; } .select { width: 720px; height: 120px; padding: 10px; margin-top: 10px; color: white; border-radius: 10px 10px 0 0; background: gray; line-height : 20px; } .options { display: inline; } #initial_focus { background: #F08080; } #get_result { font-weight: bold; } .btn { border: 2px solid purple; border-radius: 10px; background-color: white; color: purple; margin: 5px 250px; padding: 10px 15px; font-size: 14px; cursor: pointer; } .btn:hover, .btn:focus { background: purple; color: white; }
{ "pile_set_name": "Github" }
SequenceFeature.key_primaryidentifier=primaryIdentifier Organism.key_taxonid=taxonId
{ "pile_set_name": "Github" }
/* globals $: false */ "use strict";
{ "pile_set_name": "Github" }
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // </auto-generated> namespace Microsoft.Azure.Management.Network.Fluent.Models { using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// <summary> /// Geographic and time constraints for Azure reachability report. /// </summary> public partial class AzureReachabilityReportParameters { /// <summary> /// Initializes a new instance of the AzureReachabilityReportParameters /// class. /// </summary> public AzureReachabilityReportParameters() { CustomInit(); } /// <summary> /// Initializes a new instance of the AzureReachabilityReportParameters /// class. /// </summary> /// <param name="providerLocation">Parameters that define a geographic /// location.</param> /// <param name="startTime">The start time for the Azure reachability /// report.</param> /// <param name="endTime">The end time for the Azure reachability /// report.</param> /// <param name="providers">List of Internet service providers.</param> /// <param name="azureLocations">Optional Azure regions to scope the /// query to.</param> public AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, System.DateTime startTime, System.DateTime endTime, IList<string> providers = default(IList<string>), IList<string> azureLocations = default(IList<string>)) { ProviderLocation = providerLocation; Providers = providers; AzureLocations = azureLocations; StartTime = startTime; EndTime = endTime; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets parameters that define a geographic location. /// </summary> [JsonProperty(PropertyName = "providerLocation")] public AzureReachabilityReportLocation ProviderLocation { get; set; } /// <summary> /// Gets or sets list of Internet service providers. /// </summary> [JsonProperty(PropertyName = "providers")] public IList<string> Providers { get; set; } /// <summary> /// Gets or sets optional Azure regions to scope the query to. /// </summary> [JsonProperty(PropertyName = "azureLocations")] public IList<string> AzureLocations { get; set; } /// <summary> /// Gets or sets the start time for the Azure reachability report. /// </summary> [JsonProperty(PropertyName = "startTime")] public System.DateTime StartTime { get; set; } /// <summary> /// Gets or sets the end time for the Azure reachability report. /// </summary> [JsonProperty(PropertyName = "endTime")] public System.DateTime EndTime { get; set; } /// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (ProviderLocation == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ProviderLocation"); } if (ProviderLocation != null) { ProviderLocation.Validate(); } } } }
{ "pile_set_name": "Github" }
class Regexp def step_name self.source.gsub '\\$', '$$' end def arg_regexp ::Spec::Story::Step::PARAM_OR_GROUP_PATTERN end end
{ "pile_set_name": "Github" }
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames // Copyright (C) 2015 Faust Logic, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// #include "afx/arcaneFX.h" #include "afx/ce/afxVolumeLight.h" IMPLEMENT_CO_DATABLOCK_V1(afxVolumeLightData); ConsoleDocClass( afxVolumeLightData, "@brief afxVolumeLightData is a legacy datablock which is not supported for T3D.\n\n" "@ingroup afxEffects\n" "@ingroup AFX\n" "@ingroup Datablocks\n" ); //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
{ "pile_set_name": "Github" }
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Amazon SageMaker Debugger - Reacting to Cloudwatch Events from Rules\n", "[Amazon SageMaker](https://aws.amazon.com/sagemaker/) is managed platform to build, train and host maching learning models. Amazon SageMaker Debugger is a new feature which offers the capability to debug machine learning models during training by identifying and detecting problems with the models in near real time. \n", "\n", "In this notebook, we'll show you how you can react off rule triggers and take some action, e.g. stop the training job through CloudWatch Events.\n", "\n", "## How does Amazon SageMaker Debugger work?\n", "\n", "Amazon SageMaker Debugger lets you go beyond just looking at scalars like losses and accuracies during training and gives you full visibility into all tensors 'flowing through the graph' during training. Furthermore, it helps you monitor your training in near real time using rules and provides you alerts, once it has detected inconsistency in training flow.\n", "\n", "### Concepts\n", "* **Tensors**: These represent the state of the training network at intermediate points during its execution\n", "* **Debug Hook**: Hook is the construct with which Amazon SageMaker Debugger looks into the training process and captures the tensors requested at the desired step intervals\n", "* **Rule**: A logical construct, implemented as Python code, which helps analyze the tensors captured by the hook and report anomalies, if at all\n", "\n", "With these concepts in mind, let's understand the overall flow of things that Amazon SageMaker Debugger uses to orchestrate debugging.\n", "\n", "### Saving tensors during training\n", "\n", "The tensors captured by the debug hook are stored in the S3 location specified by you. There are two ways you can configure Amazon SageMaker Debugger to save tensors:\n", "\n", "#### With no changes to your training script\n", "If you use one of the SageMaker provided [Deep Learning Containers](https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html) for 1.15, then you don't need to make any changes to your training script for the tensors to be stored. SageMaker Debugger will use the configuration you provide through the SageMaker SDK's Tensorflow `Estimator` when creating your job to save the tensors in the fashion you specify. You can review the script we are going to use at [src/mnist_zerocodechange.py](src/mnist_zerocodechange.py). You will note that this is an untouched TensorFlow script which uses the Estimator interface. Please note that SageMaker Debugger only supports `tf.keras`, `tf.Estimator` and `tf.MonitoredSession` interfaces. Full description of support is available at [SageMaker Debugger with TensorFlow ](https://github.com/awslabs/sagemaker-debugger/tree/master/docs/tensorflow.md)\n", "\n", "#### Orchestrating your script to store tensors\n", "For other containers, you need to make couple of lines of changes to your training script. SageMaker Debugger exposes a library `smdebug` which allows you to capture these tensors and save them for analysis. It's highly customizable and allows to save the specific tensors you want at different frequencies and possibly with other configurations. Refer [DeveloperGuide](https://github.com/awslabs/sagemaker-debugger/tree/master/docs) for details on how to use SageMaker Debugger library with your choice of framework in your training script. Here we have an example script orchestrated at [src/mnist_byoc](src/mnist_byoc.py). You also need to ensure that your container has the `smdebug` library installed.\n", "\n", "### Analysis of tensors\n", "\n", "Once the tensors are saved, Amazon SageMaker Debugger can be configured to run debugging ***Rules*** on them. At a very broad level, a rule is Python code used to detect certain conditions during training. Some of the conditions that a data scientist training an algorithm may care about are monitoring for gradients getting too large or too small, detecting overfitting, and so on. Sagemaker Debugger comes pre-packaged with certain built-in rules. Users can write their own rules using the Sagemaker Debugger APIs. You can also analyze raw tensor data outside of the Rules construct in say, a Sagemaker notebook, using Amazon Sagemaker Debugger's full set of APIs. Please refer [Analysis Developer Guide](https://github.com/awslabs/sagemaker-debugger/blob/master/docs/api.md) for more on these APIs.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Cloudwatch Events for Rules\n", "Rule status changes in a training job trigger CloudWatch Events. These events can be acted upon by configuring a CloudWatch Rule (different from Amazon SageMaker Debugger Rule) to trigger each time a Debugger Rule changes status. In this notebook we'll go through how you can create a CloudWatch Rule to direct Training Job State change events to a lambda function that stops the training job in case a rule triggers and has status `\"IssuesFound\"`\n", "\n", "#### Lambda Function\n", "\n", "* In your AWS console, go to Lambda Management Console,\n", "* Create a new function by hitting Create Function,\n", "* Choose the language as Python 3.7 and put in the following sample code for stopping the training job if one of the Rule statuses is `\"IssuesFound\"`:\n", "\n", "```python\n", "import json\n", "import boto3\n", "import logging\n", "\n", "def lambda_handler(event, context):\n", " training_job_name = event.get(\"detail\").get(\"TrainingJobName\")\n", " eval_statuses = event.get(\"detail\").get(\"DebugRuleEvaluationStatuses\", None)\n", "\n", " if eval_statuses is None or len(eval_statuses) == 0:\n", " logging.info(\"Couldn't find any debug rule statuses, skipping...\")\n", " return {\n", " 'statusCode': 200,\n", " 'body': json.dumps('Nothing to do')\n", " }\n", "\n", " client = boto3.client('sagemaker')\n", "\n", " for status in eval_statuses:\n", " if status.get(\"RuleEvaluationStatus\") == \"IssuesFound\":\n", " logging.info(\n", " 'Evaluation of rule configuration {} resulted in \"IssuesFound\". '\n", " 'Attempting to stop training job {}'.format(\n", " status.get(\"RuleConfigurationName\"), training_job_name\n", " )\n", " )\n", " try:\n", " client.stop_training_job(\n", " TrainingJobName=training_job_name\n", " )\n", " except Exception as e:\n", " logging.error(\n", " \"Encountered error while trying to \"\n", " \"stop training job {}: {}\".format(\n", " training_job_name, str(e)\n", " )\n", " )\n", " raise e\n", " return None\n", "```\n", "* Create a new execution role for the Lambda, and\n", "* In your IAM console, search for the role and attach \"AmazonSageMakerFullAccess\" policy to the role. This is needed for the code in your Lambda function to stop the training job.\n", "\n", "#### Create a CloudWatch Rule\n", "\n", "* In your AWS Console, go to CloudWatch and select Rule from the left column,\n", "* Hit Create Rule. The console will redirect you to the Rule creation page,\n", " * For the Service Name, select \"SageMaker\".\n", " * For the Event Type, select \"SageMaker Training Job State Change\".\n", "* In the Targets select the Lambda function you created above, and\n", "* For this example notebook, we'll leave everything as is." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import boto3\n", "import os\n", "import sagemaker\n", "from sagemaker.tensorflow import TensorFlow" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from sagemaker.debugger import Rule, rule_configs" ] }, { "cell_type": "code", "execution_count": 151, "metadata": {}, "outputs": [], "source": [ "# define the entrypoint script\n", "entrypoint_script='src/mnist_zerocodechange.py'\n", "\n", "# these hyperparameters ensure that vanishing gradient will trigger for our tensorflow mnist script\n", "hyperparameters = {\n", " \"num_epochs\": \"10\",\n", " \"lr\": \"10.00\"\n", "}" ] }, { "cell_type": "code", "execution_count": 154, "metadata": {}, "outputs": [], "source": [ "rules=[\n", " Rule.sagemaker(rule_configs.vanishing_gradient()), \n", " Rule.sagemaker(rule_configs.loss_not_decreasing())\n", "]\n", "\n", "estimator = TensorFlow(\n", " role=sagemaker.get_execution_role(),\n", " base_job_name='smdebugger-demo-mnist-tensorflow',\n", " train_instance_count=1,\n", " train_instance_type='ml.m4.xlarge',\n", " entry_point=entrypoint_script,\n", " framework_version='1.15',\n", " train_volume_size=400,\n", " py_version='py3',\n", " train_max_run=3600,\n", " script_mode=True,\n", " hyperparameters=hyperparameters,\n", " ## New parameter\n", " rules = rules\n", ")" ] }, { "cell_type": "code", "execution_count": 155, "metadata": {}, "outputs": [], "source": [ "# After calling fit, SageMaker will spin off 1 training job and 1 rule job for you\n", "# The rule evaluation status(es) will be visible in the training logs\n", "# at regular intervals\n", "# wait=False makes this a fire and forget function. To stream the logs in the notebook leave this out\n", "\n", "estimator.fit(wait=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Monitoring\n", "\n", "SageMaker kicked off rule evaluation jobs, one for each of the SageMaker rules - `VanishingGradient` and `LossNotDecreasing` as specified in the estimator. \n", "Given that we've tweaked the hyperparameters of our training script such that `VanishingGradient` is bound to fire, we should expect to see the `TrainingJobStatus` as\n", "`Stopped` once the `RuleEvaluationStatus` for `VanishingGradient` changes to `IssuesFound`" ] }, { "cell_type": "code", "execution_count": 191, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'RuleConfigurationName': 'VanishingGradient',\n", " 'RuleEvaluationJobArn': 'arn:aws:sagemaker:us-east-2:072677473360:processing-job/smdebugger-demo-mnist-tens-vanishinggradient-e23301a8',\n", " 'RuleEvaluationStatus': 'IssuesFound',\n", " 'StatusDetails': 'RuleEvaluationConditionMet: Evaluation of the rule VanishingGradient at step 500 resulted in the condition being met\\n',\n", " 'LastModifiedTime': datetime.datetime(2019, 12, 1, 7, 20, 55, 495000, tzinfo=tzlocal())},\n", " {'RuleConfigurationName': 'LossNotDecreasing',\n", " 'RuleEvaluationJobArn': 'arn:aws:sagemaker:us-east-2:072677473360:processing-job/smdebugger-demo-mnist-tens-lossnotdecreasing-27ee2da1',\n", " 'RuleEvaluationStatus': 'InProgress',\n", " 'LastModifiedTime': datetime.datetime(2019, 12, 1, 7, 20, 55, 495000, tzinfo=tzlocal())}]" ] }, "execution_count": 191, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# rule job summary gives you the summary of the rule evaluations. You might have to run it over \n", "# a few times before you start to see all values populated/changing\n", "estimator.latest_training_job.rule_job_summary()" ] }, { "cell_type": "code", "execution_count": 194, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'VanishingGradient': 'https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logStream:group=/aws/sagemaker/ProcessingJobs;prefix=smdebugger-demo-mnist-tens-VanishingGradient-e23301a8;streamFilter=typeLogStreamPrefix',\n", " 'LossNotDecreasing': 'https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logStream:group=/aws/sagemaker/ProcessingJobs;prefix=smdebugger-demo-mnist-tens-LossNotDecreasing-27ee2da1;streamFilter=typeLogStreamPrefix'}" ] }, "execution_count": 194, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# This utility gives the link to monitor the CW event\n", "def _get_rule_job_name(training_job_name, rule_configuration_name, rule_job_arn):\n", " \"\"\"Helper function to get the rule job name\"\"\"\n", " return \"{}-{}-{}\".format(\n", " training_job_name[:26], rule_configuration_name[:26], rule_job_arn[-8:]\n", " )\n", " \n", "def _get_cw_url_for_rule_job(rule_job_name, region):\n", " return \"https://{}.console.aws.amazon.com/cloudwatch/home?region={}#logStream:group=/aws/sagemaker/ProcessingJobs;prefix={};streamFilter=typeLogStreamPrefix\".format(region, region, rule_job_name)\n", "\n", "\n", "def get_rule_jobs_cw_urls(estimator):\n", " region = boto3.Session().region_name\n", " training_job = estimator.latest_training_job\n", " training_job_name = training_job.describe()[\"TrainingJobName\"]\n", " rule_eval_statuses = training_job.describe()[\"DebugRuleEvaluationStatuses\"]\n", " \n", " result={}\n", " for status in rule_eval_statuses:\n", " if status.get(\"RuleEvaluationJobArn\", None) is not None:\n", " rule_job_name = _get_rule_job_name(training_job_name, status[\"RuleConfigurationName\"], status[\"RuleEvaluationJobArn\"])\n", " result[status[\"RuleConfigurationName\"]] = _get_cw_url_for_rule_job(rule_job_name, region)\n", " return result\n", "\n", "get_rule_jobs_cw_urls(estimator)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After running the last two cells over and until `VanishingGradient` reports `IssuesFound`, we'll attempt to describe the `TrainingJobStatus` for our training job." ] }, { "cell_type": "code", "execution_count": 193, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Stopped'" ] }, "execution_count": 193, "metadata": {}, "output_type": "execute_result" } ], "source": [ "estimator.latest_training_job.describe()[\"TrainingJobStatus\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Result\n", "\n", "This notebook attempted to show a very simple setup of how you can use CloudWatch events for your training job to take action on rule evaluation status changes. Learn more about Amazon SageMaker Debugger in the [GitHub Documentation](https://github.com/awslabs/sagemaker-debugger)." ] } ], "metadata": { "kernelspec": { "display_name": "conda_tensorflow_p36", "language": "python", "name": "conda_tensorflow_p36" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 4 }
{ "pile_set_name": "Github" }
package com.tencent.mm.modelstat; import com.tencent.mm.model.ah; import com.tencent.mm.network.m.a; import com.tencent.mm.sdk.platformtools.ad; import com.tencent.mm.sdk.platformtools.v; final class l$1 extends m.a { l$1(l paraml) {} public final void bc(int paramInt) { if ((paramInt != 5) && (paramInt != 1)) { return; } ah.tw().d(new Runnable() { public final void run() { if (!ah.rg()) { return; } l.DK().DB(); } public final String toString() { return super.toString() + "|onNetworkChange"; } }, 3000L); v.d("MicroMsg.SubCoreStat", "NetTypeReporter st:%d", new Object[] { Integer.valueOf(paramInt) }); j.eF(2); } } /* Location: * Qualified Name: com.tencent.mm.modelstat.l.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
{ "pile_set_name": "Github" }
CodeMirror.defineMode("sparql", function(config) { var indentUnit = config.indentUnit; var curPunc; function wordRegexp(words) { return new RegExp("^(?:" + words.join("|") + ")$", "i"); } var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", "isblank", "isliteral", "union", "a"]); var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", "graph", "by", "asc", "desc"]); var operatorChars = /[*+\-<>=&|]/; function tokenBase(stream, state) { var ch = stream.next(); curPunc = null; if (ch == "$" || ch == "?") { stream.match(/^[\w\d]*/); return "variable-2"; } else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { stream.match(/^[^\s\u00a0>]*>?/); return "atom"; } else if (ch == "\"" || ch == "'") { state.tokenize = tokenLiteral(ch); return state.tokenize(stream, state); } else if (/[{}\(\),\.;\[\]]/.test(ch)) { curPunc = ch; return null; } else if (ch == "#") { stream.skipToEnd(); return "comment"; } else if (operatorChars.test(ch)) { stream.eatWhile(operatorChars); return null; } else if (ch == ":") { stream.eatWhile(/[\w\d\._\-]/); return "atom"; } else { stream.eatWhile(/[_\w\d]/); if (stream.eat(":")) { stream.eatWhile(/[\w\d_\-]/); return "atom"; } var word = stream.current(); if (ops.test(word)) return null; else if (keywords.test(word)) return "keyword"; else return "variable"; } } function tokenLiteral(quote) { return function(stream, state) { var escaped = false, ch; while ((ch = stream.next()) != null) { if (ch == quote && !escaped) { state.tokenize = tokenBase; break; } escaped = !escaped && ch == "\\"; } return "string"; }; } function pushContext(state, type, col) { state.context = {prev: state.context, indent: state.indent, col: col, type: type}; } function popContext(state) { state.indent = state.context.indent; state.context = state.context.prev; } return { startState: function() { return {tokenize: tokenBase, context: null, indent: 0, col: 0}; }, token: function(stream, state) { if (stream.sol()) { if (state.context && state.context.align == null) state.context.align = false; state.indent = stream.indentation(); } if (stream.eatSpace()) return null; var style = state.tokenize(stream, state); if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { state.context.align = true; } if (curPunc == "(") pushContext(state, ")", stream.column()); else if (curPunc == "[") pushContext(state, "]", stream.column()); else if (curPunc == "{") pushContext(state, "}", stream.column()); else if (/[\]\}\)]/.test(curPunc)) { while (state.context && state.context.type == "pattern") popContext(state); if (state.context && curPunc == state.context.type) popContext(state); } else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); else if (/atom|string|variable/.test(style) && state.context) { if (/[\}\]]/.test(state.context.type)) pushContext(state, "pattern", stream.column()); else if (state.context.type == "pattern" && !state.context.align) { state.context.align = true; state.context.col = stream.column(); } } return style; }, indent: function(state, textAfter) { var firstChar = textAfter && textAfter.charAt(0); var context = state.context; if (/[\]\}]/.test(firstChar)) while (context && context.type == "pattern") context = context.prev; var closing = context && firstChar == context.type; if (!context) return 0; else if (context.type == "pattern") return context.col; else if (context.align) return context.col + (closing ? 0 : 1); else return context.indent + (closing ? 0 : indentUnit); } }; }); CodeMirror.defineMIME("application/x-sparql-query", "sparql");
{ "pile_set_name": "Github" }
{ "word": "Gradual", "definitions": [ "Taking place or progressing slowly or by degrees.", "(of a slope) not steep or abrupt." ], "parts-of-speech": "Adjective" }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-04-18 20:32 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('voucher', '0001_initial'), ] operations = [ migrations.AlterField( model_name='voucher', name='date_created', field=models.DateTimeField(auto_now_add=True), ), migrations.AlterField( model_name='voucherapplication', name='date_created', field=models.DateTimeField(auto_now_add=True), ), ]
{ "pile_set_name": "Github" }
/*|----------------------------------------------------------------------------- *| This source code is provided under the Apache 2.0 license -- *| and is provided AS IS with no warranty or guarantee of fit for purpose. -- *| See the project's LICENSE.md for details. -- *| Copyright (C) 2019 Refinitiv. All rights reserved. -- *|----------------------------------------------------------------------------- */ #ifndef __thomsonreuters_ema_access_OmmDoubleDecoder_h #define __thomsonreuters_ema_access_OmmDoubleDecoder_h #include "Decoder.h" #include "EmaBufferInt.h" namespace thomsonreuters { namespace ema { namespace access { class OmmDoubleDecoder : public Decoder { public : OmmDoubleDecoder(); virtual ~OmmDoubleDecoder(); bool setRsslData( UInt8 , UInt8 , RsslMsg* , const RsslDataDictionary* ); bool setRsslData( UInt8 , UInt8 , RsslBuffer* , const RsslDataDictionary* , void* ); bool setRsslData( RsslDecodeIterator* , RsslBuffer* ); Data::DataCode getCode() const; const EmaString& toString(); double getDouble() const; const EmaBuffer& getHexBuffer(); const RsslBuffer& getRsslBuffer() const; OmmError::ErrorCode getErrorCode() const; private : RsslBuffer* _pRsslBuffer; RsslDouble _rsslDouble; EmaString _toString; EmaBufferInt _hexBuffer; Data::DataCode _dataCode; OmmError::ErrorCode _errorCode; }; } } } #endif //__thomsonreuters_ema_access_OmmDoubleDecoder_h
{ "pile_set_name": "Github" }
/* * Wazuh app - Module for XML beautify * Copyright (C) 2015-2020 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ export default xml => { const reg = /(>)\s*(<)(\/*)/g; // updated Mar 30, 2015 const wsexp = / *(.*) +\n/g; const contexp = /(<.+>)(.+\n)/g; xml = xml .replace(reg, '$1\n$2$3') .replace(wsexp, '$1\n') .replace(contexp, '$1\n$2'); let formatted = ''; const lines = xml.split('\n'); let indent = 0; let lastType = 'other'; // 4 types of tags - single, closing, opening, other (text, doctype, comment) - 4*4 = 16 transitions const transitions = { 'single->single': 0, 'single->closing': -1, 'single->opening': 0, 'single->other': 0, 'closing->single': 0, 'closing->closing': -1, 'closing->opening': 0, 'closing->other': 0, 'opening->single': 1, 'opening->closing': 0, 'opening->opening': 1, 'opening->other': 1, 'other->single': 0, 'other->closing': -1, 'other->opening': 0, 'other->other': 0 }; for (const ln of lines) { // Luca Viggiani 2017-07-03: handle optional <?xml ... ?> declaration if (ln.match(/\s*<\?xml/)) { formatted += ln + '\n'; continue; } // --- const single = Boolean(ln.match(/<.+\/>/)); // is this line a single tag? ex. <br /> const closing = Boolean(ln.match(/<\/.+>/)); // is this a closing tag? ex. </a> const opening = Boolean(ln.match(/<[^!].*>/)); // is this even a tag (that's not <!something>) const type = single ? 'single' : closing ? 'closing' : opening ? 'opening' : 'other'; const fromTo = lastType + '->' + type; lastType = type; let padding = ''; indent += transitions[fromTo]; for (let j = 0; j < indent; j++) { padding += '\t'; } if (fromTo == 'opening->closing') formatted = formatted.substr(0, formatted.length - 1) + ln + '\n'; // substr removes line break (\n) from prev loop else formatted += padding + ln + '\n'; } return formatted; };
{ "pile_set_name": "Github" }
{ "rules": { "align": [ true, "parameters", "statements" ], "jsdoc-require": [ false ], "ban": false, "class-name": true, "comment-format": [ true, "check-space" ], "curly": false, "eofline": true, "forin": false, "indent": [ true, "spaces" ], "interface-name": [false], "jsdoc-format": true, "label-position": true, "max-line-length": [ true, 180 ], "callable-types": true, "import-blacklist": [true, "rxjs"], "interface-over-type-literal": true, "no-empty-interface": true, "no-string-throw": true, "prefer-const": true, "typeof-compare": true, "unified-signatures": false, "no-inferrable-types": [true, "ignore-params"], "member-access": true, "member-ordering": [false], "no-any": false, "no-arg": true, "no-bitwise": true, "no-conditional-assignment": true, "no-consecutive-blank-lines": [ true ], "no-console": [false], "no-construct": false, "no-debugger": true, "no-duplicate-variable": true, "no-empty": true, "no-eval": true, "no-internal-module": true, "no-require-imports": false, "no-shadowed-variable": true, "no-string-literal": false, "no-switch-case-fall-through": true, "no-trailing-whitespace": true, "no-unused-expression": true, "no-use-before-declare": true, "no-var-keyword": true, "no-var-requires": false, "object-literal-sort-keys": false, "one-line": [ true, "check-open-brace", "check-whitespace" ], "quotemark": [ true, "single", "avoid-escape" ], "radix": false, "semicolon": [ false ], "switch-default": false, "trailing-comma": [ true, { "multiline": "always", "singleline": "never" } ], "triple-equals": [true], "typedef": [false], "typedef-whitespace": [ true, { "call-signature": "nospace", "index-signature": "nospace", "parameter": "nospace", "property-declaration": "nospace", "variable-declaration": "nospace" } ], "variable-name": [ true, "check-format", "allow-leading-underscore", "ban-keywords" ], "whitespace": [ true, "check-branch", "check-decl", "check-operator", "check-separator", "check-type" ] } }
{ "pile_set_name": "Github" }
Item { //! [states] states: [ State { name: "State1" PropertyChanges { target: icon x: middleRightRect.x y: middleRightRect.y } }, State { name: "State2" PropertyChanges { target: icon x: bottomLeftRect.x y: bottomLeftRect.y } } ] //! [states] }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:name="io.github.mthli.Bitocle.Main.MainFragment" android:id="@+id/main_fragment" android:layout_width="match_parent" android:layout_height="match_parent"> </fragment> </LinearLayout>
{ "pile_set_name": "Github" }
.mblRadioButton { background-image: url(compat/button-bg.png); } .mblRadioButtonChecked, .mblRadioButton:checked { background-image: url(compat/button-chk-bg.png); } .mblRadioButtonChecked.mblRadioButtonSelected, .mblRadioButton:checked.mblRadioButtonSelected { background-image: url(compat/blue-button-sel-bg.png); } .dj_gecko .mblRadioButton { background-image: -moz-linear-gradient(top, #fdfdfd 0%, #f8f8f8 50%, #eeeeee 50%, #cecece 100%); -moz-appearance: none; } .dj_gecko .mblRadioButtonChecked, .dj_gecko .mblRadioButton:checked { background-image: -moz-linear-gradient(top, #00a200 0%, #00ba00 20%, #00ba00 20%, #00d300 100%); } .dj_gecko .mblRadioButtonChecked::after, .dj_gecko .mblRadioButton:checked::after { -moz-transform: rotate(45deg); -moz-transform-origin: 50% 50%; } .dj_gecko .mblRadioButtonChecked.mblRadioButtonSelected, .dj_gecko .mblRadioButton:checked.mblRadioButtonSelected { background-image: -moz-linear-gradient(top, #306ea1 0%, #4090d3 6%, #306ea1 50%, #266093 100%); } .dj_ff3 .mblRadioButton { -moz-border-radius: 0.5em; }
{ "pile_set_name": "Github" }
[ { "countryCode": "BG", "fipsCode": "41", "isoCode": "07", "name": "Gabrovo Province", "wikiDataId": "Q1007272" }, { "countryCode": "BG", "fipsCode": "57", "isoCode": "21", "name": "Smolyan Province", "wikiDataId": "Q2012430" }, { "countryCode": "BG", "fipsCode": "49", "isoCode": "14", "name": "Pernik Province", "wikiDataId": "Q2012234" }, { "countryCode": "BG", "fipsCode": "47", "isoCode": "12", "name": "Montana Province", "wikiDataId": "Q2012057" }, { "countryCode": "BG", "fipsCode": "63", "isoCode": "05", "name": "Vidin Province", "wikiDataId": "Q2012772" }, { "countryCode": "BG", "fipsCode": "52", "isoCode": "17", "name": "Razgrad Province", "wikiDataId": "Q2790675" }, { "countryCode": "BG", "fipsCode": "38", "isoCode": "01", "name": "Blagoevgrad Province", "wikiDataId": "Q804311" }, { "countryCode": "BG", "fipsCode": "56", "isoCode": "20", "name": "Sliven Province", "wikiDataId": "Q113120" }, { "countryCode": "BG", "fipsCode": "51", "isoCode": "16", "name": "Plovdiv Province", "wikiDataId": "Q187874" }, { "countryCode": "BG", "fipsCode": "44", "isoCode": "09", "name": "Kardzhali Province", "wikiDataId": "Q1104675" }, { "countryCode": "BG", "fipsCode": "45", "isoCode": "10", "name": "Kyustendil Province", "wikiDataId": "Q1112985" }, { "countryCode": "BG", "fipsCode": "43", "isoCode": "26", "name": "Haskovo Province", "wikiDataId": "Q182809" }, { "countryCode": "BG", "fipsCode": "42", "isoCode": "22", "name": "Sofia City Province", "wikiDataId": "Q1585725" }, { "countryCode": "BG", "fipsCode": "50", "isoCode": "15", "name": "Pleven Province", "wikiDataId": "Q2012242" }, { "countryCode": "BG", "fipsCode": "59", "isoCode": "24", "name": "Stara Zagora Province", "wikiDataId": "Q2012583" }, { "countryCode": "BG", "fipsCode": "55", "isoCode": "19", "name": "Silistra Province", "wikiDataId": "Q2012423" }, { "countryCode": "BG", "fipsCode": "62", "isoCode": "04", "name": "Veliko Tarnovo Province", "wikiDataId": "Q2012621" }, { "countryCode": "BG", "fipsCode": "46", "isoCode": "11", "name": "Lovech Province", "wikiDataId": "Q6587068" }, { "countryCode": "BG", "fipsCode": "64", "isoCode": "06", "name": "Vratsa Province", "wikiDataId": "Q2012785" }, { "countryCode": "BG", "fipsCode": "48", "isoCode": "13", "name": "Pazardzhik Province", "wikiDataId": "Q2012227" }, { "countryCode": "BG", "fipsCode": "53", "isoCode": "18", "name": "Ruse Province", "wikiDataId": "Q1251933" }, { "countryCode": "BG", "fipsCode": "60", "isoCode": "25", "name": "Targovishte Province", "wikiDataId": "Q2012589" }, { "countryCode": "BG", "fipsCode": "39", "isoCode": "02", "name": "Burgas Province", "wikiDataId": "Q369220" }, { "countryCode": "BG", "fipsCode": "65", "isoCode": "28", "name": "Yambol Province", "wikiDataId": "Q220736" }, { "countryCode": "BG", "fipsCode": "61", "isoCode": "03", "name": "Varna Province", "wikiDataId": "Q183487" }, { "countryCode": "BG", "fipsCode": "40", "isoCode": "08", "name": "Dobrich Province", "wikiDataId": "Q907395" }, { "countryCode": "BG", "fipsCode": "58", "isoCode": "23", "name": "Sofia Province", "wikiDataId": "Q202904" }, { "countryCode": "BG", "fipsCode": "41", "isoCode": "07", "name": "Gabrovo Province", "wikiDataId": "Q1007272" }, { "countryCode": "BG", "fipsCode": "57", "isoCode": "21", "name": "Smolyan Province", "wikiDataId": "Q2012430" }, { "countryCode": "BG", "fipsCode": "49", "isoCode": "14", "name": "Pernik Province", "wikiDataId": "Q2012234" }, { "countryCode": "BG", "fipsCode": "47", "isoCode": "12", "name": "Montana Province", "wikiDataId": "Q2012057" }, { "countryCode": "BG", "fipsCode": "63", "isoCode": "05", "name": "Vidin Province", "wikiDataId": "Q2012772" }, { "countryCode": "BG", "fipsCode": "52", "isoCode": "17", "name": "Razgrad Province", "wikiDataId": "Q2790675" }, { "countryCode": "BG", "fipsCode": "38", "isoCode": "01", "name": "Blagoevgrad Province", "wikiDataId": "Q804311" }, { "countryCode": "BG", "fipsCode": "56", "isoCode": "20", "name": "Sliven Province", "wikiDataId": "Q113120" }, { "countryCode": "BG", "fipsCode": "51", "isoCode": "16", "name": "Plovdiv Province", "wikiDataId": "Q187874" }, { "countryCode": "BG", "fipsCode": "44", "isoCode": "09", "name": "Kardzhali Province", "wikiDataId": "Q1104675" }, { "countryCode": "BG", "fipsCode": "45", "isoCode": "10", "name": "Kyustendil Province", "wikiDataId": "Q1112985" }, { "countryCode": "BG", "fipsCode": "43", "isoCode": "26", "name": "Haskovo Province", "wikiDataId": "Q182809" }, { "countryCode": "BG", "fipsCode": "42", "isoCode": "22", "name": "Sofia City Province", "wikiDataId": "Q1585725" }, { "countryCode": "BG", "fipsCode": "50", "isoCode": "15", "name": "Pleven Province", "wikiDataId": "Q2012242" }, { "countryCode": "BG", "fipsCode": "59", "isoCode": "24", "name": "Stara Zagora Province", "wikiDataId": "Q2012583" }, { "countryCode": "BG", "fipsCode": "55", "isoCode": "19", "name": "Silistra Province", "wikiDataId": "Q2012423" }, { "countryCode": "BG", "fipsCode": "62", "isoCode": "04", "name": "Veliko Tarnovo Province", "wikiDataId": "Q2012621" }, { "countryCode": "BG", "fipsCode": "46", "isoCode": "11", "name": "Lovech Province", "wikiDataId": "Q6587068" }, { "countryCode": "BG", "fipsCode": "64", "isoCode": "06", "name": "Vratsa Province", "wikiDataId": "Q2012785" }, { "countryCode": "BG", "fipsCode": "48", "isoCode": "13", "name": "Pazardzhik Province", "wikiDataId": "Q2012227" }, { "countryCode": "BG", "fipsCode": "53", "isoCode": "18", "name": "Ruse Province", "wikiDataId": "Q1251933" }, { "countryCode": "BG", "fipsCode": "60", "isoCode": "25", "name": "Targovishte Province", "wikiDataId": "Q2012589" }, { "countryCode": "BG", "fipsCode": "39", "isoCode": "02", "name": "Burgas Province", "wikiDataId": "Q369220" }, { "countryCode": "BG", "fipsCode": "65", "isoCode": "28", "name": "Yambol Province", "wikiDataId": "Q220736" }, { "countryCode": "BG", "fipsCode": "61", "isoCode": "03", "name": "Varna Province", "wikiDataId": "Q183487" }, { "countryCode": "BG", "fipsCode": "40", "isoCode": "08", "name": "Dobrich Province", "wikiDataId": "Q907395" }, { "countryCode": "BG", "fipsCode": "58", "isoCode": "23", "name": "Sofia Province", "wikiDataId": "Q202904" }, { "countryCode": "BG", "fipsCode": "48", "isoCode": "13", "name": "Pazardzhik Province", "wikiDataId": "Q2012227" }, { "countryCode": "BG", "fipsCode": "53", "isoCode": "18", "name": "Ruse Province", "wikiDataId": "Q1251933" }, { "countryCode": "BG", "fipsCode": "60", "isoCode": "25", "name": "Targovishte Province", "wikiDataId": "Q2012589" }, { "countryCode": "BG", "fipsCode": "39", "isoCode": "02", "name": "Burgas Province", "wikiDataId": "Q369220" }, { "countryCode": "BG", "fipsCode": "65", "isoCode": "28", "name": "Yambol Province", "wikiDataId": "Q220736" }, { "countryCode": "BG", "fipsCode": "61", "isoCode": "03", "name": "Varna Province", "wikiDataId": "Q183487" }, { "countryCode": "BG", "fipsCode": "40", "isoCode": "08", "name": "Dobrich Province", "wikiDataId": "Q907395" }, { "countryCode": "BG", "fipsCode": "58", "isoCode": "23", "name": "Sofia Province", "wikiDataId": "Q202904" }, { "countryCode": "BG", "fipsCode": "41", "isoCode": "07", "name": "Gabrovo Province", "wikiDataId": "Q1007272" }, { "countryCode": "BG", "fipsCode": "57", "isoCode": "21", "name": "Smolyan Province", "wikiDataId": "Q2012430" }, { "countryCode": "BG", "fipsCode": "49", "isoCode": "14", "name": "Pernik Province", "wikiDataId": "Q2012234" }, { "countryCode": "BG", "fipsCode": "47", "isoCode": "12", "name": "Montana Province", "wikiDataId": "Q2012057" }, { "countryCode": "BG", "fipsCode": "63", "isoCode": "05", "name": "Vidin Province", "wikiDataId": "Q2012772" }, { "countryCode": "BG", "fipsCode": "52", "isoCode": "17", "name": "Razgrad Province", "wikiDataId": "Q2790675" }, { "countryCode": "BG", "fipsCode": "38", "isoCode": "01", "name": "Blagoevgrad Province", "wikiDataId": "Q804311" }, { "countryCode": "BG", "fipsCode": "56", "isoCode": "20", "name": "Sliven Province", "wikiDataId": "Q113120" }, { "countryCode": "BG", "fipsCode": "51", "isoCode": "16", "name": "Plovdiv Province", "wikiDataId": "Q187874" }, { "countryCode": "BG", "fipsCode": "44", "isoCode": "09", "name": "Kardzhali Province", "wikiDataId": "Q1104675" }, { "countryCode": "BG", "fipsCode": "45", "isoCode": "10", "name": "Kyustendil Province", "wikiDataId": "Q1112985" }, { "countryCode": "BG", "fipsCode": "43", "isoCode": "26", "name": "Haskovo Province", "wikiDataId": "Q182809" }, { "countryCode": "BG", "fipsCode": "42", "isoCode": "22", "name": "Sofia City Province", "wikiDataId": "Q1585725" }, { "countryCode": "BG", "fipsCode": "50", "isoCode": "15", "name": "Pleven Province", "wikiDataId": "Q2012242" }, { "countryCode": "BG", "fipsCode": "59", "isoCode": "24", "name": "Stara Zagora Province", "wikiDataId": "Q2012583" }, { "countryCode": "BG", "fipsCode": "55", "isoCode": "19", "name": "Silistra Province", "wikiDataId": "Q2012423" }, { "countryCode": "BG", "fipsCode": "62", "isoCode": "04", "name": "Veliko Tarnovo Province", "wikiDataId": "Q2012621" }, { "countryCode": "BG", "fipsCode": "46", "isoCode": "11", "name": "Lovech Province", "wikiDataId": "Q6587068" }, { "countryCode": "BG", "fipsCode": "64", "isoCode": "06", "name": "Vratsa Province", "wikiDataId": "Q2012785" }, { "countryCode": "BG", "fipsCode": "48", "isoCode": "13", "name": "Pazardzhik Province", "wikiDataId": "Q2012227" }, { "countryCode": "BG", "fipsCode": "53", "isoCode": "18", "name": "Ruse Province", "wikiDataId": "Q1251933" }, { "countryCode": "BG", "fipsCode": "60", "isoCode": "25", "name": "Targovishte Province", "wikiDataId": "Q2012589" }, { "countryCode": "BG", "fipsCode": "39", "isoCode": "02", "name": "Burgas Province", "wikiDataId": "Q369220" }, { "countryCode": "BG", "fipsCode": "65", "isoCode": "28", "name": "Yambol Province", "wikiDataId": "Q220736" }, { "countryCode": "BG", "fipsCode": "61", "isoCode": "03", "name": "Varna Province", "wikiDataId": "Q183487" }, { "countryCode": "BG", "fipsCode": "40", "isoCode": "08", "name": "Dobrich Province", "wikiDataId": "Q907395" }, { "countryCode": "BG", "fipsCode": "58", "isoCode": "23", "name": "Sofia Province", "wikiDataId": "Q202904" } ]
{ "pile_set_name": "Github" }
/* * Copyright (C) 2008 Red Hat, Inc., Eric Paris <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/dcache.h> #include <linux/fs.h> #include <linux/gfp.h> #include <linux/init.h> #include <linux/module.h> #include <linux/mount.h> #include <linux/srcu.h> #include <linux/fsnotify_backend.h> #include "fsnotify.h" #include "../mount.h" /* * Clear all of the marks on an inode when it is being evicted from core */ void __fsnotify_inode_delete(struct inode *inode) { fsnotify_clear_marks_by_inode(inode); } EXPORT_SYMBOL_GPL(__fsnotify_inode_delete); void __fsnotify_vfsmount_delete(struct vfsmount *mnt) { fsnotify_clear_marks_by_mount(mnt); } /* * Given an inode, first check if we care what happens to our children. Inotify * and dnotify both tell their parents about events. If we care about any event * on a child we run all of our children and set a dentry flag saying that the * parent cares. Thus when an event happens on a child it can quickly tell if * if there is a need to find a parent and send the event to the parent. */ void __fsnotify_update_child_dentry_flags(struct inode *inode) { struct dentry *alias; int watched; if (!S_ISDIR(inode->i_mode)) return; /* determine if the children should tell inode about their events */ watched = fsnotify_inode_watches_children(inode); spin_lock(&inode->i_lock); /* run all of the dentries associated with this inode. Since this is a * directory, there damn well better only be one item on this list */ list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { struct dentry *child; /* run all of the children of the original inode and fix their * d_flags to indicate parental interest (their parent is the * original inode) */ spin_lock(&alias->d_lock); list_for_each_entry(child, &alias->d_subdirs, d_child) { if (!child->d_inode) continue; spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED); if (watched) child->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; else child->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED; spin_unlock(&child->d_lock); } spin_unlock(&alias->d_lock); } spin_unlock(&inode->i_lock); } /* Notify this dentry's parent about a child's events. */ int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) { struct dentry *parent; struct inode *p_inode; int ret = 0; if (!dentry) dentry = path->dentry; if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) return 0; parent = dget_parent(dentry); p_inode = parent->d_inode; if (unlikely(!fsnotify_inode_watches_children(p_inode))) __fsnotify_update_child_dentry_flags(p_inode); else if (p_inode->i_fsnotify_mask & mask) { struct name_snapshot name; /* we are notifying a parent so come up with the new mask which * specifies these are events which came from a child. */ mask |= FS_EVENT_ON_CHILD; take_dentry_name_snapshot(&name, dentry); if (path) ret = fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH, name.name, 0); else ret = fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, name.name, 0); release_dentry_name_snapshot(&name); } dput(parent); return ret; } EXPORT_SYMBOL_GPL(__fsnotify_parent); static int send_to_group(struct inode *to_tell, struct vfsmount *mnt, struct fsnotify_mark *inode_mark, struct fsnotify_mark *vfsmount_mark, __u32 mask, void *data, int data_is, u32 cookie, const unsigned char *file_name, struct fsnotify_event **event) { struct fsnotify_group *group = NULL; __u32 inode_test_mask = 0; __u32 vfsmount_test_mask = 0; if (unlikely(!inode_mark && !vfsmount_mark)) { BUG(); return 0; } /* clear ignored on inode modification */ if (mask & FS_MODIFY) { if (inode_mark && !(inode_mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY)) inode_mark->ignored_mask = 0; if (vfsmount_mark && !(vfsmount_mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY)) vfsmount_mark->ignored_mask = 0; } /* does the inode mark tell us to do something? */ if (inode_mark) { group = inode_mark->group; inode_test_mask = (mask & ~FS_EVENT_ON_CHILD); inode_test_mask &= inode_mark->mask; inode_test_mask &= ~inode_mark->ignored_mask; } /* does the vfsmount_mark tell us to do something? */ if (vfsmount_mark) { vfsmount_test_mask = (mask & ~FS_EVENT_ON_CHILD); group = vfsmount_mark->group; vfsmount_test_mask &= vfsmount_mark->mask; vfsmount_test_mask &= ~vfsmount_mark->ignored_mask; if (inode_mark) vfsmount_test_mask &= ~inode_mark->ignored_mask; } pr_debug("%s: group=%p to_tell=%p mnt=%p mask=%x inode_mark=%p" " inode_test_mask=%x vfsmount_mark=%p vfsmount_test_mask=%x" " data=%p data_is=%d cookie=%d event=%p\n", __func__, group, to_tell, mnt, mask, inode_mark, inode_test_mask, vfsmount_mark, vfsmount_test_mask, data, data_is, cookie, *event); if (!inode_test_mask && !vfsmount_test_mask) return 0; if (group->ops->should_send_event(group, to_tell, inode_mark, vfsmount_mark, mask, data, data_is) == false) return 0; if (!*event) { *event = fsnotify_create_event(to_tell, mask, data, data_is, file_name, cookie, GFP_KERNEL); if (!*event) return -ENOMEM; } return group->ops->handle_event(group, inode_mark, vfsmount_mark, *event); } /* * This is the main call to fsnotify. The VFS calls into hook specific functions * in linux/fsnotify.h. Those functions then in turn call here. Here will call * out to all of the registered fsnotify_group. Those groups can then use the * notification event in whatever means they feel necessary. */ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const unsigned char *file_name, u32 cookie) { struct hlist_node *inode_node = NULL, *vfsmount_node = NULL; struct fsnotify_mark *inode_mark = NULL, *vfsmount_mark = NULL; struct fsnotify_group *inode_group, *vfsmount_group; struct fsnotify_event *event = NULL; struct mount *mnt; int idx, ret = 0; /* global tests shouldn't care about events on child only the specific event */ __u32 test_mask = (mask & ~FS_EVENT_ON_CHILD); if (data_is == FSNOTIFY_EVENT_PATH) mnt = real_mount(((struct path *)data)->mnt); else mnt = NULL; /* * if this is a modify event we may need to clear the ignored masks * otherwise return if neither the inode nor the vfsmount care about * this type of event. */ if (!(mask & FS_MODIFY) && !(test_mask & to_tell->i_fsnotify_mask) && !(mnt && test_mask & mnt->mnt_fsnotify_mask)) return 0; idx = srcu_read_lock(&fsnotify_mark_srcu); if ((mask & FS_MODIFY) || (test_mask & to_tell->i_fsnotify_mask)) inode_node = srcu_dereference(to_tell->i_fsnotify_marks.first, &fsnotify_mark_srcu); if (mnt && ((mask & FS_MODIFY) || (test_mask & mnt->mnt_fsnotify_mask))) { vfsmount_node = srcu_dereference(mnt->mnt_fsnotify_marks.first, &fsnotify_mark_srcu); inode_node = srcu_dereference(to_tell->i_fsnotify_marks.first, &fsnotify_mark_srcu); } while (inode_node || vfsmount_node) { inode_group = vfsmount_group = NULL; if (inode_node) { inode_mark = hlist_entry(srcu_dereference(inode_node, &fsnotify_mark_srcu), struct fsnotify_mark, i.i_list); inode_group = inode_mark->group; } if (vfsmount_node) { vfsmount_mark = hlist_entry(srcu_dereference(vfsmount_node, &fsnotify_mark_srcu), struct fsnotify_mark, m.m_list); vfsmount_group = vfsmount_mark->group; } if (inode_group > vfsmount_group) { /* handle inode */ ret = send_to_group(to_tell, NULL, inode_mark, NULL, mask, data, data_is, cookie, file_name, &event); /* we didn't use the vfsmount_mark */ vfsmount_group = NULL; } else if (vfsmount_group > inode_group) { ret = send_to_group(to_tell, &mnt->mnt, NULL, vfsmount_mark, mask, data, data_is, cookie, file_name, &event); inode_group = NULL; } else { ret = send_to_group(to_tell, &mnt->mnt, inode_mark, vfsmount_mark, mask, data, data_is, cookie, file_name, &event); } if (ret && (mask & ALL_FSNOTIFY_PERM_EVENTS)) goto out; if (inode_group) inode_node = srcu_dereference(inode_node->next, &fsnotify_mark_srcu); if (vfsmount_group) vfsmount_node = srcu_dereference(vfsmount_node->next, &fsnotify_mark_srcu); } ret = 0; out: srcu_read_unlock(&fsnotify_mark_srcu, idx); /* * fsnotify_create_event() took a reference so the event can't be cleaned * up while we are still trying to add it to lists, drop that one. */ if (event) fsnotify_put_event(event); return ret; } EXPORT_SYMBOL_GPL(fsnotify); static __init int fsnotify_init(void) { int ret; BUG_ON(hweight32(ALL_FSNOTIFY_EVENTS) != 23); ret = init_srcu_struct(&fsnotify_mark_srcu); if (ret) panic("initializing fsnotify_mark_srcu"); return 0; } core_initcall(fsnotify_init);
{ "pile_set_name": "Github" }
'From Cuis 5.0 [latest update: #4286] on 23 July 2020 at 3:34:20 pm'! !PasteUpMorph methodsFor: 'submorphs-add/remove' stamp: 'jmv 7/23/2020 14:47:46'! addMorph: aMorph centeredNear: aPoint "Add the given morph to this world, attempting to keep its center as close to the given point possible while also keeping the it entirely within the bounds of this world." | trialRect delta | trialRect _ Rectangle center: aPoint extent: aMorph morphExtent. delta _ trialRect amountToTranslateWithin: self displayBounds. self addMorph: aMorph. aMorph morphPositionInWorld: trialRect origin + delta.! ! !MenuMorph methodsFor: 'control' stamp: 'jmv 7/23/2020 15:25:53'! popUpAdjacentTo: rightOrLeftPointInWorld from: sourceItem "Present this menu at the given point under control of the given hand. Used mostly for submenus." | trialRect e | popUpOwner _ sourceItem. sourceItem world addMorphFront: self position: rightOrLeftPointInWorld first. e _ self morphExtent. trialRect _ rightOrLeftPointInWorld first extent: e. trialRect right > sourceItem world morphWidth ifTrue: [ self morphPosition: rightOrLeftPointInWorld second - (e x@0)]. self fitInWorld.! ! !MenuMorph methodsFor: 'private' stamp: 'jmv 7/23/2020 15:01:17'! fitInWorld | delta trialRect | trialRect _ Rectangle origin: self morphPosition extent: self morphExtent. delta _ trialRect amountToTranslateWithin: owner displayBounds. self morphPosition: trialRect origin + delta.! ! !PasteUpMorph reorganize! ('accessing' activeHand color: handlesKeyboard) ('alarms-scheduler' addAlarm:withArguments:for:at: removeAlarm:for:) ('caching' releaseCachedState) ('change reporting' addedMorph: invalidateDisplayRect:from: redrawNeeded removedMorph:) ('classification' isWorldMorph) ('drawing' drawOn:) ('dropping/grabbing' allowsFilesDrop allowsMorphDrop allowsSubmorphDrag dropFiles:) ('errors on draw' addKnownFailing: isKnownFailing: removeAllKnownFailing removeKnownFailing:) ('events' click:localPosition: keyStroke: mouseButton1Down:localPosition: windowEvent:) ('event handling testing' handlesMouseDown:) ('event handling' mouseButton2Activity wantsWindowEvent: windowEventHandler) ('geometry' displayBounds externalizeDisplayBounds: externalizeToWorld: fontPreferenceChanged internalizeFromWorld: morphPositionInWorld privateExtent:) ('initialization' clearCanvas clearWaitDelay defaultBorderColor defaultBorderWidth defaultColor) ('interaction loop' doOneCycleNow mainLoop runProcess) ('menu & halo' addCustomMenuItems:hand: addWorldHaloMenuItemsTo:hand: deleteBalloonTarget:) ('misc' backgroundImage backgroundImageData: buildMagnifiedBackgroundImage) ('printing' printOn:) ('project state' canvas firstHand hands handsDo: handsReverseDo: setCanvas: viewBox) ('stepping' startStepping:at:selector:stepTime: stopStepping:selector: stopSteppingMorph:) ('stepping and presenter' wantsSteps) ('structure' world) ('submorphs-accessing' allMorphsDo:) ('submorphs-add/remove' addMorph:centeredNear:) ('testing' is: isReallyVisible stepTime) ('world menu' bringWindowsFullOnscreen closeUnchangedWindows collapseAll collapseNonWindows deleteNonWindows findAChangeSorter: findAFileList: findAMessageNamesWindow: findATranscript: findAWindowSatisfying:orMakeOneUsing: findDirtyBrowsers: findDirtyWindows: findWindow: invokeWorldMenu restoreAll) ('world state' allNonWindowRelatedSubmorphs deleteAllHalos displayWorld displayWorldSafely doOneCycle doOneMinimalCycleNow fillRects: fullRepaintNeeded haloMorphs privateOuterDisplayWorld restoreDisplay whenUIinSafeState: worldState:) ('halos and balloon help' wantsHaloHandleWithSelector:inHalo:) ('object serialization' objectForDataStream:) ('windows' findATranscript) ('taskbar' hideTaskbar showTaskbar taskbar taskbarDeleted) ('defaul desktop' recreateDefaultDesktop tearDownDesktop) ('ui services' request:initialAnswer:orCancel: request:initialAnswer:verifying:do:orCancel:) !
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import datetime import operator from vilya.libs.store import store, mc, cache, mc_gets, bdb from vilya.models.tag import Tag, TagName from vilya.models.issue_vote import Upvote from vilya.models.issue_participant import IssueParticipant from vilya.models.issue_comment import IssueComment MC_KEY_ISSUE = 'issue:v3:%s' MC_KEY_ISSUES_DATA_BY_TARGET = 'issues_data:v3:type:%s:target_id:%s' MC_KEY_ISSUES_IDS_BY_CREATOR_ID = 'issue_ids_by_creator_id:v3:%s' MC_KEY_ISSUES_IDS_BY_ASSIGNEE_ID = 'issues_ids_by_assignee_id:v3:%s' MC_KEY_USER_ISSUE_IDS_BY_CREATOR_ID = 'user_issue:v3:%s' BDB_ISSUE_DESCRIPTION_KEY = 'issue_description:%s' ISSUE_DATA_FIELDS = dict(issue_id=0, closer_id=1, updated_at=2, rank_score=3) def filter_issue_ids_by_score(ids, order): if order == 'hot': index = ISSUE_DATA_FIELDS['rank_score'] ids = [info for info in sorted(ids, key=operator.itemgetter(index), reverse=True)] else: index = ISSUE_DATA_FIELDS['updated_at'] ids = [info for info in sorted(ids, key=operator.itemgetter(index), reverse=True)] return ids def filter_issue_ids_by_state(ids, state): index = ISSUE_DATA_FIELDS['closer_id'] if state: if state == 'open': ids = [info for info in ids if not info[index]] elif state == 'closed': ids = [info for info in ids if info[index]] return ids class Issue(object): target_type = 'default' tag_type = 0 # not exists type provided_features = [] # Interface def __init__(self, id, title, creator, assignee=None, closer=None, created_at=None, updated_at=None, closed_at=None, type='default', target_id=0): self.id = id self.issue_id = id self.title = title bdb_description = bdb.get(BDB_ISSUE_DESCRIPTION_KEY % id) self.description = bdb_description self.creator_id = creator self.assignee_id = assignee self.closer_id = closer self.created_at = created_at self.updated_at = updated_at self.closed_at = closed_at self.type = type self.number = 0 self.target_id = target_id def __repr__(self): return '<%s(%s)>' % (self.__class__.__name__, self.id) @property def url(self): raise NotImplementedError('Subclasses should implement this!') @property def target(self): raise NotImplementedError('Subclasses should implement this!') def provide(self, name): '''检查是否提供某功能,即是否提供某接口''' return name in self.provided_features @property def state(self): if self.closer_id: return 'closed' return 'open' @property def is_closed(self): return self.state == 'closed' @property def creator(self): if self.creator_id: from vilya.models.user import User return User(self.creator_id) return None @property def closer(self): if self.closer_id: from vilya.models.user import User return User(self.closer_id) return None @property def assignee(self): if self.assignee_id: from vilya.models.user import User return User(self.assignee_id) return None def clear_cache(self): mc.delete(MC_KEY_ISSUE % self.issue_id) def update(self, title, description): store.execute("update issues " "set title=%s, updated_at=null " "where id=%s", (title, self.issue_id)) store.commit() bdb.set(BDB_ISSUE_DESCRIPTION_KEY % self.issue_id, description) self.clear_cache() mc.delete(MC_KEY_ISSUES_DATA_BY_TARGET % (self.type, self.target_id)) def close(self, user_id): store.execute("update issues " "set closer_id=%s, closed_at=null " "where id=%s", (user_id, self.issue_id)) store.commit() self.clear_cache() mc.delete(MC_KEY_ISSUES_IDS_BY_CREATOR_ID % self.creator_id) mc.delete(MC_KEY_ISSUES_DATA_BY_TARGET % (self.type, self.target_id)) self.closer_id = user_id def open(self): store.execute("update issues " "set closer_id=null, closed_at=null " "where id=%s", (self.issue_id,)) store.commit() self.clear_cache() mc.delete(MC_KEY_ISSUES_IDS_BY_CREATOR_ID % self.creator_id) mc.delete(MC_KEY_ISSUES_DATA_BY_TARGET % (self.type, self.target_id)) self.closer_id = None def add_tag(self, tag, type, target_id, author=None): author_id = author if author else self.creator_id # create tag if not exists tag_name = TagName.get_by_name_and_target_id(tag, type, target_id) if not tag_name: tag_name = TagName.add(tag, author_id, type, target_id) if not tag_name: return # add tag to issue if not already be added issue_tag = Tag.get_by_type_id_and_tag_id( type, self.issue_id, tag_name.id) if issue_tag: return Tag.add_to_issue( tag_name.id, type, self.issue_id, author_id, target_id) def add_tags(self, tags, target_id, author=None): for tag in tags: self.add_tag(tag, self.tag_type, target_id, author) def remove_tag(self, tag, type, target_id): # check if tag exists tag_name = TagName.get_by_name_and_target_id(tag, type, target_id) if not tag_name: return # delete tag relationship if exists issue_tag = Tag.get_by_type_id_and_tag_id( type, self.issue_id, tag_name.id) if issue_tag: issue_tag.delete() def remove_tags(self, tags, target_id): for tag in tags: self.remove_tag(tag, self.tag_type, target_id) def upvote_by_user(self, user_id): if user_id and (user_id != self.creator_id) and not self.is_closed: vote = Upvote.add(self.issue_id, user_id) if vote: self.update_rank_score() return self.vote_count def cancel_upvote_by_user(self, user_id): ok = Upvote.delete(self.issue_id, user_id) if ok: self.update_rank_score() return self.vote_count def has_user_voted(self, user_id): if user_id: vote = Upvote.get_by_issue_id_and_user_id(self.issue_id, user_id) return True if vote else False return False @property def vote_count(self): return Upvote.count_by_issue_id(self.issue_id) @property def comments(self): return IssueComment.gets_by_issue_id(self.issue_id) @property def comment_count(self): return IssueComment.count_by_issue_id(self.issue_id) def add_comment(self, content, user): res = IssueComment.add(self.issue_id, content, user) self.update_rank_score() return res def update_rank_score(self): vote_count = self.vote_count comment_count = self.comment_count time_delta = (datetime.now() - datetime(2011, 1, 1)).total_seconds() divider = (datetime(2013, 7, 8) - datetime(2011, 1, 1)).total_seconds() time_factor = time_delta / divider * 5 score = (vote_count * 0.5 + comment_count) * time_factor store.execute( "update issues " "set rank_score=%s , updated_at=updated_at " # 防止字段更新 "where id=%s ", (score, self.issue_id)) store.commit() mc.delete(MC_KEY_ISSUES_DATA_BY_TARGET % (self.type, self.target_id)) return score def add_participants(self, user_ids): for user_id in user_ids: self.add_participant(user_id) def add_participant(self, user_id): p = IssueParticipant.get_by_issue_id_and_user_id(self.issue_id, user_id) if not p: IssueParticipant.add(self.issue_id, user_id) def delete_participant(self, user_id): p = IssueParticipant.get_by_issue_id_and_user_id(self.issue_id, user_id) if p: p.delete() def has_participated(self, user_id): return bool(IssueParticipant.get_by_issue_id_and_user_id( self.issue_id, user_id)) @property def participants(self): return IssueParticipant.gets_by_issue_id(self.issue_id) def assign(self, user_id): old_id = self.assignee_id store.execute("update issues " "set assignee_id=%s " "where id=%s", (user_id, self.issue_id)) store.commit() self.clear_cache() mc.delete(MC_KEY_ISSUES_IDS_BY_ASSIGNEE_ID % old_id) mc.delete(MC_KEY_ISSUES_IDS_BY_ASSIGNEE_ID % user_id) @classmethod def add(cls, title, description, creator, assignee=None, closer=None, created_at=None, updated_at=None, closed_at=None, type='default', target_id=0): time = datetime.now() issue_id = store.execute( 'insert into issues (title, creator_id, ' 'assignee_id, closer_id, created_at, updated_at, type, target_id) ' 'values (%s, %s, %s, %s, NULL, NULL, %s, %s)', (title, creator, assignee, closer, type, target_id)) store.commit() mc.delete(MC_KEY_ISSUE % issue_id) mc.delete(MC_KEY_ISSUES_IDS_BY_CREATOR_ID % creator) mc.delete(MC_KEY_ISSUES_IDS_BY_ASSIGNEE_ID % assignee) mc.delete(MC_KEY_ISSUES_DATA_BY_TARGET % (type, target_id)) bdb.set(BDB_ISSUE_DESCRIPTION_KEY % issue_id, description) issue = cls(issue_id, title, creator, assignee, closer, time, time) issue.add_participant(creator) return issue def delete(self): store.execute('delete from issues where id=%s', (self.id,)) store.commit() mc.delete(MC_KEY_ISSUE % self.id) mc.delete(MC_KEY_ISSUES_IDS_BY_CREATOR_ID % self.creator_id) mc.delete(MC_KEY_ISSUES_IDS_BY_ASSIGNEE_ID % self.assignee_id) mc.delete(MC_KEY_ISSUES_DATA_BY_TARGET % (type, self.target_id)) bdb.set(BDB_ISSUE_DESCRIPTION_KEY % self.id, '') @classmethod def get(cls, id): rs = store.execute( "select id, title, creator_id, assignee_id, closer_id, " "created_at, updated_at, closed_at, type, target_id " "from issues where id=%s", (id,)) return rs and cls(*rs[0]) or None @classmethod def get_by_issue_id(cls, id, state=None): issue = Issue.get(id) if not issue: return None if state and issue.state != state: return None return issue @classmethod @cache(MC_KEY_ISSUES_DATA_BY_TARGET % ('{cls.target_type}', '{target_id}')) def get_data_by_target(cls, target_id): rs = store.execute('select id, closer_id, updated_at, rank_score ' 'from issues where type=%s and target_id=%s', (cls.target_type, target_id)) return rs @classmethod def gets_by_target(cls, target_id, state=None, order='', limit=0, start=0): data = cls.get_data_by_target(target_id) data = filter_issue_ids_by_state(data, state) data = filter_issue_ids_by_score(data, order) ids = [issue_id for (issue_id, _, _, _) in data] if limit: ids = ids[start:start + limit] return Issue.get_cached_issues(ids) @classmethod def gets_by_creator_id(cls, id, state='open'): # FIXME 子类中的这个方法,参数非常不一致。需要尽快解决 result = cls.get_ids_by_creator_id(id) if state == 'open': ids = [i for (i, closer_id) in result if not closer_id] return Issue.get_cached_issues(ids) else: ids = [i for (i, closer_id) in result if closer_id] return Issue.get_cached_issues(ids) @classmethod @cache(MC_KEY_ISSUES_IDS_BY_CREATOR_ID % '{id}') def get_ids_by_creator_id(cls, id): rs = store.execute("select id, closer_id " "from issues " "where creator_id = %s", (id,)) return rs @classmethod def gets_by_assignee_id(cls, id, state='open'): # FIXME 子类中的这个方法,参数非常不一致。需要尽快解决 result = cls.get_ids_by_assignee_id(id) if state == 'open': ids = [i for (i, closer_id) in result if not closer_id] return Issue.get_cached_issues(ids) else: ids = [i for (i, closer_id) in result if closer_id] return Issue.get_cached_issues(ids) @classmethod def gets_by_participated_user(cls, user_id, state='open'): ps = IssueParticipant.gets_by_user_id(user_id) issue_ids = [p.issue_id for p in ps] issues = Issue.get_cached_issues(issue_ids) issues_with_state = [issue for issue in issues if (state == 'open') is (not issue.closer_id)] return issues_with_state @classmethod @cache(MC_KEY_ISSUES_IDS_BY_ASSIGNEE_ID % '{id}') def get_ids_by_assignee_id(cls, id): rs = store.execute("select id, closer_id " "from issues " "where assignee_id = %s", (id,)) return rs @classmethod def gets_by_closer_id(cls, id): rs = store.execute("select id, title, " "creator_id, assignee_id, closer_id, " "created_at, updated_at, closed_at, type " "from issues " "where closer_id = %s ", (id, )) return [cls(*r) for r in rs] @property def tags(self): return Tag.gets_by_issue_id(self.issue_id, self.tag_type) @staticmethod @cache(MC_KEY_ISSUE) def get_cached_issue(id): from vilya.models.issue_utils import ISSUE_TYPE_CLASS issue = Issue.get(id) if issue: subcls = ISSUE_TYPE_CLASS[issue.type] return subcls.get_by_issue_id(id) @staticmethod def get_cached_issues(ids): issues = mc_gets(MC_KEY_ISSUE, Issue.get_cached_issue, ids) return [i for i in issues if i] def get_project_issues(issues): project_issues = [] for issue in issues: project_issue = get_issue_by_id_and_state(issue.issue_id) if project_issue: project_issues.append(project_issue) return project_issues # return project_issue or team_issue def get_issue_by_id_and_state(id, state=None): issue = Issue.get_cached_issue(id) if not issue: return None if state and issue.state != state: return None return issue
{ "pile_set_name": "Github" }
# body-parser [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] [![Gratipay][gratipay-image]][gratipay-url] Node.js body parsing middleware. Parse incoming request bodies in a middleware before your handlers, available under the `req.body` property. [Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). _This does not handle multipart bodies_, due to their complex and typically large nature. For multipart bodies, you may be interested in the following modules: * [busboy](https://www.npmjs.org/package/busboy#readme) and [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) * [multiparty](https://www.npmjs.org/package/multiparty#readme) and [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) * [formidable](https://www.npmjs.org/package/formidable#readme) * [multer](https://www.npmjs.org/package/multer#readme) This module provides the following parsers: * [JSON body parser](#bodyparserjsonoptions) * [Raw body parser](#bodyparserrawoptions) * [Text body parser](#bodyparsertextoptions) * [URL-encoded form body parser](#bodyparserurlencodedoptions) Other body parsers you might be interested in: - [body](https://www.npmjs.org/package/body#readme) - [co-body](https://www.npmjs.org/package/co-body#readme) ## Installation ```sh $ npm install body-parser ``` ## API <!-- eslint-disable no-unused-vars --> ```js var bodyParser = require('body-parser') ``` The `bodyParser` object exposes various factories to create middlewares. All middlewares will populate the `req.body` property with the parsed body when the `Content-Type` request header matches the `type` option, or an empty object (`{}`) if there was no body to parse, the `Content-Type` was not matched, or an error occurred. The various errors returned by this module are described in the [errors section](#errors). ### bodyParser.json(options) Returns middleware that only parses `json` and only looks at requests where the `Content-Type` header matches the `type` option. This parser accepts any Unicode encoding of the body and supports automatic inflation of `gzip` and `deflate` encodings. A new `body` object containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). #### Options The `json` function takes an option `options` object that may contain any of the following keys: ##### inflate When set to `true`, then deflated (compressed) bodies will be inflated; when `false`, deflated bodies are rejected. Defaults to `true`. ##### limit Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults to `'100kb'`. ##### reviver The `reviver` option is passed directly to `JSON.parse` as the second argument. You can find more information on this argument [in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). ##### strict When set to `true`, will only accept arrays and objects; when `false` will accept anything `JSON.parse` accepts. Defaults to `true`. ##### type The `type` option is used to determine what media type the middleware will parse. This option can be a function or a string. If a string, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `json`), a mime type (like `application/json`), or a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. Defaults to `application/json`. ##### verify The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. ### bodyParser.raw(options) Returns middleware that parses all bodies as a `Buffer` and only looks at requests where the `Content-Type` header matches the `type` option. This parser supports automatic inflation of `gzip` and `deflate` encodings. A new `body` object containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). This will be a `Buffer` object of the body. #### Options The `raw` function takes an option `options` object that may contain any of the following keys: ##### inflate When set to `true`, then deflated (compressed) bodies will be inflated; when `false`, deflated bodies are rejected. Defaults to `true`. ##### limit Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults to `'100kb'`. ##### type The `type` option is used to determine what media type the middleware will parse. This option can be a function or a string. If a string, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `bin`), a mime type (like `application/octet-stream`), or a mime type with a wildcard (like `*/*` or `application/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. Defaults to `application/octet-stream`. ##### verify The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. ### bodyParser.text(options) Returns middleware that parses all bodies as a string and only looks at requests where the `Content-Type` header matches the `type` option. This parser supports automatic inflation of `gzip` and `deflate` encodings. A new `body` string containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). This will be a string of the body. #### Options The `text` function takes an option `options` object that may contain any of the following keys: ##### defaultCharset Specify the default character set for the text content if the charset is not specified in the `Content-Type` header of the request. Defaults to `utf-8`. ##### inflate When set to `true`, then deflated (compressed) bodies will be inflated; when `false`, deflated bodies are rejected. Defaults to `true`. ##### limit Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults to `'100kb'`. ##### type The `type` option is used to determine what media type the middleware will parse. This option can be a function or a string. If a string, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `txt`), a mime type (like `text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. Defaults to `text/plain`. ##### verify The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. ### bodyParser.urlencoded(options) Returns middleware that only parses `urlencoded` bodies and only looks at requests where the `Content-Type` header matches the `type` option. This parser accepts only UTF-8 encoding of the body and supports automatic inflation of `gzip` and `deflate` encodings. A new `body` object containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). This object will contain key-value pairs, where the value can be a string or array (when `extended` is `false`), or any type (when `extended` is `true`). #### Options The `urlencoded` function takes an option `options` object that may contain any of the following keys: ##### extended The `extended` option allows to choose between parsing the URL-encoded data with the `querystring` library (when `false`) or the `qs` library (when `true`). The "extended" syntax allows for rich objects and arrays to be encoded into the URL-encoded format, allowing for a JSON-like experience with URL-encoded. For more information, please [see the qs library](https://www.npmjs.org/package/qs#readme). Defaults to `true`, but using the default has been deprecated. Please research into the difference between `qs` and `querystring` and choose the appropriate setting. ##### inflate When set to `true`, then deflated (compressed) bodies will be inflated; when `false`, deflated bodies are rejected. Defaults to `true`. ##### limit Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults to `'100kb'`. ##### parameterLimit The `parameterLimit` option controls the maximum number of parameters that are allowed in the URL-encoded data. If a request contains more parameters than this value, a 413 will be returned to the client. Defaults to `1000`. ##### type The `type` option is used to determine what media type the middleware will parse. This option can be a function or a string. If a string, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `urlencoded`), a mime type (like `application/x-www-form-urlencoded`), or a mime type with a wildcard (like `*/x-www-form-urlencoded`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. Defaults to `application/x-www-form-urlencoded`. ##### verify The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. ## Errors The middlewares provided by this module create errors depending on the error condition during parsing. The errors will typically have a `status` property that contains the suggested HTTP response code and a `body` property containing the read body, if available. The following are the common errors emitted, though any error can come through for various reasons. ### content encoding unsupported This error will occur when the request had a `Content-Encoding` header that contained an encoding but the "inflation" option was set to `false`. The `status` property is set to `415`. ### request aborted This error will occur when the request is aborted by the client before reading the body has finished. The `received` property will be set to the number of bytes received before the request was aborted and the `expected` property is set to the number of expected bytes. The `status` property is set to `400`. ### request entity too large This error will occur when the request body's size is larger than the "limit" option. The `limit` property will be set to the byte limit and the `length` property will be set to the request body's length. The `status` property is set to `413`. ### request size did not match content length This error will occur when the request's length did not match the length from the `Content-Length` header. This typically occurs when the request is malformed, typically when the `Content-Length` header was calculated based on characters instead of bytes. The `status` property is set to `400`. ### stream encoding should not be set This error will occur when something called the `req.setEncoding` method prior to this middleware. This module operates directly on bytes only and you cannot call `req.setEncoding` when using this module. The `status` property is set to `500`. ### unsupported charset "BOGUS" This error will occur when the request had a charset parameter in the `Content-Type` header, but the `iconv-lite` module does not support it OR the parser does not support it. The charset is contained in the message as well as in the `charset` property. The `status` property is set to `415`. ### unsupported content encoding "bogus" This error will occur when the request had a `Content-Encoding` header that contained an unsupported encoding. The encoding is contained in the message as well as in the `encoding` property. The `status` property is set to `415`. ## Examples ### Express/Connect top-level generic This example demonstrates adding a generic JSON and URL-encoded parser as a top-level middleware, which will parse the bodies of all incoming requests. This is the simplest setup. ```js var express = require('express') var bodyParser = require('body-parser') var app = express() // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) // parse application/json app.use(bodyParser.json()) app.use(function (req, res) { res.setHeader('Content-Type', 'text/plain') res.write('you posted:\n') res.end(JSON.stringify(req.body, null, 2)) }) ``` ### Express route-specific This example demonstrates adding body parsers specifically to the routes that need them. In general, this is the most recommended way to use body-parser with Express. ```js var express = require('express') var bodyParser = require('body-parser') var app = express() // create application/json parser var jsonParser = bodyParser.json() // create application/x-www-form-urlencoded parser var urlencodedParser = bodyParser.urlencoded({ extended: false }) // POST /login gets urlencoded bodies app.post('/login', urlencodedParser, function (req, res) { if (!req.body) return res.sendStatus(400) res.send('welcome, ' + req.body.username) }) // POST /api/users gets JSON bodies app.post('/api/users', jsonParser, function (req, res) { if (!req.body) return res.sendStatus(400) // create user in req.body }) ``` ### Change accepted type for parsers All the parsers accept a `type` option which allows you to change the `Content-Type` that the middleware will parse. ```js var express = require('express') var bodyParser = require('body-parser') var app = express() // parse various different custom JSON types as JSON app.use(bodyParser.json({ type: 'application/*+json' })) // parse some custom thing into a Buffer app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) // parse an HTML body into a string app.use(bodyParser.text({ type: 'text/html' })) ``` ## License [MIT](LICENSE) [npm-image]: https://img.shields.io/npm/v/body-parser.svg [npm-url]: https://npmjs.org/package/body-parser [travis-image]: https://img.shields.io/travis/expressjs/body-parser/master.svg [travis-url]: https://travis-ci.org/expressjs/body-parser [coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master [downloads-image]: https://img.shields.io/npm/dm/body-parser.svg [downloads-url]: https://npmjs.org/package/body-parser [gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg [gratipay-url]: https://www.gratipay.com/dougwilson/
{ "pile_set_name": "Github" }
<?php /* * This file is part of the BeSimpleSoapBundle. * * (c) Christian Kerl <[email protected]> * (c) Francis Besset <[email protected]> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace BeSimple\SoapCommon\Tests; use BeSimple\SoapCommon\Mime\PartHeader; use BeSimple\SoapCommon\Tests\Fixtures\MimePartHeader; class PartHeaderTest extends \PHPUnit_Framework_TestCase { public function testSetGetHeader() { $ph = new MimePartHeader(); $ph->setHeader('Content-Type', 'text/xml'); $this->assertEquals('text/xml', $ph->getHeader('Content-Type')); } public function testSetGetHeaderSubvalue() { $ph = new MimePartHeader(); $ph->setHeader('Content-Type', 'utf-8', 'charset'); $this->assertEquals(null, $ph->getHeader('Content-Type', 'charset')); $ph->setHeader('Content-Type', 'text/xml'); $ph->setHeader('Content-Type', 'charset', 'utf-8'); $this->assertEquals('utf-8', $ph->getHeader('Content-Type', 'charset')); } public function testGenerateHeaders() { $ph = new MimePartHeader(); $class = new \ReflectionClass($ph); $method = $class->getMethod('generateHeaders'); $method->setAccessible(true); $this->assertEquals('', $method->invoke($ph)); $ph->setHeader('Content-Type', 'text/xml'); $this->assertEquals("Content-Type: text/xml\r\n", $method->invoke($ph)); $ph->setHeader('Content-Type', 'charset', 'utf-8'); $this->assertEquals("Content-Type: text/xml; charset=utf-8\r\n", $method->invoke($ph)); $ph->setHeader('Content-Type', 'type', 'text/xml'); $this->assertEquals("Content-Type: text/xml; charset=utf-8; type=\"text/xml\"\r\n", $method->invoke($ph)); } }
{ "pile_set_name": "Github" }
<component name="ProjectCodeStyleConfiguration"> <code_scheme name="Project" version="173"> <codeStyleSettings language="XML"> <indentOptions> <option name="CONTINUATION_INDENT_SIZE" value="4" /> </indentOptions> <arrangement> <rules> <section> <rule> <match> <AND> <NAME>xmlns:android</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>xmlns:.*</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:id</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:name</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>name</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>style</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>.*</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> <order>ANDROID_ATTRIBUTE_ORDER</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*</NAME> <XML_ATTRIBUTE /> <XML_NAMESPACE>.*</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> </rules> </arrangement> </codeStyleSettings> </code_scheme> </component>
{ "pile_set_name": "Github" }
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LatinExtendedD.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS["STIXGeneral-bold"],{42898:[691,19,769,27,734]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Bold/LatinExtendedD.js");
{ "pile_set_name": "Github" }
sha256:92de175f666d14c55ddb24e9a7fef269d4037afd67d6cb9e516d134a3840fdda
{ "pile_set_name": "Github" }
{ "tabNodeContainer": { //"height": "20px", //"background": "url("+o2.session.path+"/widget/$Tab/moduleList/tabAreaBg.gif)", //"border-top": "1px solid #CCC", "border-bottom": "1px solid #CCC", "overflow": "hidden" }, "contentNodeContainer": { "overflow": "hidden", "clear": "left" }, "contentNodeArea": { "background-color": "#FFF", "margin": "5px", "border-top": "1px solid #999999", "border-left": "1px solid #999999", "border-right": "1px solid #DDD", "border-bottom": "1px solid #DDD", "overflow": "hidden", "display": "none", "opacity": 0 }, "tabNode": { "position": "static", "margin-left": "5px", "margin-top": "0px", "margin-right": "-12px", "float": "left", "height": "19px", "line-height": "19px", "width": "70px", "cursor": "pointer", "background": "#EEEEEE", "border-top-left-radius": "5px", "border-top-right-radius": "30px", "border": "1px solid #CCC", "border-bottom": "0px solid #CCC" }, "tabTextNode": { "font-size": "12px", "line-height": "20px", "text-align": "center", "color": "#333333", "margin-right": "8px", "margin-top": "0px", "font-weight": "normal", "margin-left": "8px", "padding": "0 5px", "display": "inline" }, "tabCloseNode": { "height": "20px", "width": "16px", "background": "url("+o2.session.path+"/widget/$Tab/moduleList/close_gray.png) left center", "background-repeat": "no-repeat" , "float": "right" }, "tabNodeCurrent": { "position": "relative", "top": "0px", "margin-left": "5px", "margin-top": "0px", "margin-right": "-12px", "float": "left", "height": "20px", "width": "70px", "background": "url("+o2.session.path+"/widget/$Tab/moduleList/tabNodeCurrentBg.gif) center center", "border-top-left-radius": "5px", "border-top-right-radius": "30px", "border": "1px solid #CCC", "border-bottom": "0px solid #CCC" }, "tabTextNodeCurrent": { "font-size": "12px", "line-height": "20px", "text-align": "center", "color": "#bf6364", "margin-right": "8px", "margin-left": "8px", "font-weight": "normal", "margin-top": "0px", "float": "left", "padding": "0 5px", "display": "inline" }, "tabCloseNodeCurrent": { "height": "30px", "width": "16px", "background": "url("+o2.session.path+"/widget/$Tab/moduleList/close.png) left center", "background-repeat": "no-repeat", "float": "left", "display": "inline" } }
{ "pile_set_name": "Github" }
<template> <div class="icons-preview-settings"> <div class="clr-control-container clr-control-inline"> <span class="control-container-title"> Preview: </span> <div class="clr-toggle-wrapper"> <input type="checkbox" class="clr-input" id="is-solid-checkbox" v-model="isSolid" /> <label for="is-solid-checkbox" class="clr-control-label">Solid</label> </div> </div> <div class="clr-control-container clr-control-inline"> <span class="control-container-title"> Variations: </span> <div class="clr-radio-wrapper"> <input type="radio" class="clr-input" id="is-none-radio" value="none" v-model="variation" /> <label for="is-none-radio" class="clr-control-label">none</label> </div> <div class="clr-radio-wrapper"> <input type="radio" class="clr-input" id="is-badge-radio" value="badge" v-model="variation" /> <label for="is-badge-radio" class="clr-control-label">badge</label> </div> <div class="clr-radio-wrapper"> <input type="radio" class="clr-input" id="is-alert-radio" value="alert" v-model="variation" /> <label for="is-alert-radio" class="clr-control-label">alert</label> </div> </div> </div> </template> <script> export default { name: 'DocIconsPreviewSettings', data: function () { return { variation: 'none', isSolid: false, }; }, watch: { variation: function (value) { this.$emit('variation-change', value); }, isSolid: function (value) { this.$emit('is-solid-change', value); }, }, }; </script> <style scoped lang="scss"> .icons-preview-settings { display: grid; grid-template-columns: 8rem auto; padding: 0.75rem 0; } .control-container-title { padding-right: 0.5rem; } .clr-toggle-wrapper { margin-right: 0; } </style>
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <title>coronavirus-server</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" type="image/x-icon" href="//v4.loopback.io/favicon.ico"> <style> h3 { margin-left: 25px; text-align: center; } a, a:visited { color: #3f5dff; } h3 a { margin-left: 10px; } a:hover, a:focus, a:active { color: #001956; } .power { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); } .info { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) } .info h1 { text-align: center; margin-bottom: 0; } .info p { text-align: center; margin-bottom: 3em; margin-top: 1em; } </style> </head> <body> <div class="info"> <h1>coronavirus-server</h1> <p>Version 1.0.0</p> <h3>OpenAPI spec: <a href="/openapi.json">/openapi.json</a></h3> <h3>API Explorer: <a href="/explorer">/explorer</a></h3> </div> <footer class="power"> <a href="https://v4.loopback.io" target="_blank"> <img src="https://loopback.io/images/branding/powered-by-loopback/blue/powered-by-loopback-sm.png" /> </a> </footer> </body> </html>
{ "pile_set_name": "Github" }
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import gzip import numpy as np import struct # load compressed MNIST gz files and return numpy arrays def load_data(filename, label=False): with gzip.open(filename) as gz: struct.unpack('I', gz.read(4)) n_items = struct.unpack('>I', gz.read(4)) if not label: n_rows = struct.unpack('>I', gz.read(4))[0] n_cols = struct.unpack('>I', gz.read(4))[0] res = np.frombuffer(gz.read(n_items[0] * n_rows * n_cols), dtype=np.uint8) res = res.reshape(n_items[0], n_rows * n_cols) else: res = np.frombuffer(gz.read(n_items[0]), dtype=np.uint8) res = res.reshape(n_items[0], 1) return res # one-hot encode a 1-D array def one_hot_encode(array, num_of_classes): return np.eye(num_of_classes)[array.reshape(-1)]
{ "pile_set_name": "Github" }
var arraySample = require('./_arraySample'), baseSample = require('./_baseSample'), isArray = require('./isArray'); /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } module.exports = sample;
{ "pile_set_name": "Github" }
EU aiming to fuel development aid European Union finance ministers meet on Thursday to discuss proposals, including a tax on jet fuel, to boost development aid for poorer nations. The policy makers are to ask for a report into how more development money can be raised, the EU said. The world's richest countries have said they want to increase the amount of aid they give to 0.7% of their annual gross national income by 2015. Airlines have reacted strongly against the proposed fuel levy. Profits have been under pressure in the airline industry, with low-cost firms driving down prices and demand dipping after the 11 September terrorist attacks and the outbreak of the killer SARS virus. Things have picked up, but some European and US companies are teetering on the brink of bankruptcy. At present, the fuel used by airlines enjoys either a very low tax rate or is untaxed in EU member states. "Of course we applaud humanitarian initiatives, but why target the airlines?" said Ulrich Schulte-Strathaus, secretary general of the Association of European Airlines. "Our industry is in the midst of a fundamental crisis...only to be once again confronted with a measure designed to increase our costs," he continued. The EU sought to allay the airlines' fears, stressing that Thursday's meeting was only a first step and that other proposals were also under consideration. It added that any plan to levy taxes on jet fuel "should not hinder the competitiveness of the airlines and that they themselves will not be solely funding development". Any tax would only be implemented after full consultation with the airlines, the EU said. There is thought to be widespread support for the plan - tabled by France and Germany following the recent G7 meeting of the world's richest nations - from EU ministers. The issue of poverty in Africa and South Asia has forced itself to the top of the politicial agenda, with politicians and campaigners calling for more to be done. At their meeting in London, G7 finance ministers backed plans to write off up to 100% of the debts of some of the world's poorest countries.
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html class="no-js" lang="en"> <head> <title>Chaos engineering with the Snow Monkey · Otoroshi</title> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="description" content='otoroshi-manual'/> <link href="https://fonts.googleapis.com/css?family=Roboto:100normal,100italic,300normal,300italic,400normal,400italic,500normal,500italic,700normal,700italic,900normal,900italicc" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../lib/jquery/jquery.min.js"></script> <script type="text/javascript" src="../js/page.js"></script> <script type="text/javascript" src="../js/groups.js"></script> <link rel="stylesheet" type="text/css" href="../lib/normalize.css/normalize.css"/> <link rel="stylesheet" type="text/css" href="../lib/foundation/dist/foundation.min.css"/> <link rel="stylesheet" type="text/css" href="../css/page.css"/> <!-- <link rel="shortcut icon" href="../images/favicon.ico" /> --> </head> <body> <div class="off-canvas-wrapper"> <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper> <div class="off-canvas position-left" id="off-canvas-menu" data-off-canvas> <nav class="off-canvas-nav"> <div class="nav-home"> <a href="../index.html" > <span class="home-icon">⌂</span>Otoroshi </a> <div class="version-number"> 1.4.22 </div> </div> <div class="nav-toc"> <ul> <li><a href="../about.html" class="page">About Otoroshi</a></li> <li><a href="../archi.html" class="page">Architecture</a></li> <li><a href="../features.html" class="page">Features</a></li> <li><a href="../quickstart.html" class="page">Try Otoroshi in 5 minutes</a></li> <li><a href="../getotoroshi/index.html" class="page">Get Otoroshi</a> <ul> <li><a href="../getotoroshi/fromsources.html" class="page">From sources</a></li> <li><a href="../getotoroshi/frombinaries.html" class="page">From binaries</a></li> <li><a href="../getotoroshi/fromdocker.html" class="page">From docker</a></li> </ul></li> <li><a href="../firstrun/index.html" class="page">First run</a> <ul> <li><a href="../firstrun/datastore.html" class="page">Choose your datastore</a></li> <li><a href="../firstrun/configfile.html" class="page">Config. with files</a></li> <li><a href="../firstrun/env.html" class="page">Config. with ENVs</a></li> <li><a href="../firstrun/initialstate.html" class="page">Import initial state</a></li> <li><a href="../firstrun/host.html" class="page">Setup your hosts</a></li> <li><a href="../firstrun/run.html" class="page">Run Otoroshi</a></li> </ul></li> <li><a href="../setup/index.html" class="page">Setup Otoroshi</a> <ul> <li><a href="../setup/admin.html" class="page">Manage admin users</a></li> <li><a href="../setup/dangerzone.html" class="page">Configure the Danger zone</a></li> </ul></li> <li><a href="../usage/index.html" class="page">Using Otoroshi</a> <ul> <li><a href="../usage/1-groups.html" class="page">Managing service groups</a></li> <li><a href="../usage/2-services.html" class="page">Managing services</a></li> <li><a href="../usage/3-apikeys.html" class="page">Managing API keys</a></li> <li><a href="../usage/4-monitor.html" class="page">Monitoring services</a></li> <li><a href="../usage/5-sessions.html" class="page">Managing sessions</a></li> <li><a href="../usage/6-audit.html" class="page">Auditing Otoroshi</a></li> <li><a href="../usage/7-metrics.html" class="page">Otoroshi global metrics</a></li> <li><a href="../usage/8-importsexports.html" class="page">Import and export</a></li> <li><a href="../usage/9-auth.html" class="page">Authentication</a></li> </ul></li> <li><a href="../integrations/index.html" class="page">Third party Integrations</a> <ul> <li><a href="../integrations/analytics.html" class="page">Analytics</a></li> <li><a href="../integrations/mailgun.html" class="page">Mailgun</a></li> <li><a href="../integrations/statsd.html" class="page">StatsD / Datadog</a></li> <li><a href="../integrations/clevercloud.html" class="page">Clever Cloud</a></li> </ul></li> <li><a href="../topics/index.html" class="page">Detailed topics</a> <ul> <li><a href="../topics/snow-monkey.html" class="active page">Chaos engineering with the Snow Monkey</a></li> <li><a href="../topics/jwt-verifications.html" class="page">JWT Tokens verification</a></li> <li><a href="../topics/ssl.html" class="page">SSL/TLS termination with Otoroshi</a></li> <li><a href="../topics/mtls.html" class="page">Mutual TLS with Otoroshi</a></li> <li><a href="../topics/clustering.html" class="page">Otoroshi clustering</a></li> <li><a href="../topics/plugins.html" class="page">Otoroshi plugins</a></li> <li><a href="../topics/monitoring.html" class="page">Monitoring Otoroshi</a></li> </ul></li> <li><a href="../api.html" class="page">Admin REST API</a></li> <li><a href="../deploy/index.html" class="page">Deploy to production</a> <ul> <li><a href="../deploy/clevercloud.html" class="page">Clever Cloud</a></li> <li><a href="../deploy/aws-beanstalk.html" class="page">AWS - Elastic Beanstalk</a></li> <li><a href="../deploy/other.html" class="page">Others</a></li> <li><a href="../deploy/scaling.html" class="page">Scaling Otoroshi</a></li> </ul></li> <li><a href="../dev.html" class="page">Developing Otoroshi</a></li> </ul> </div> </nav> </div> <div class="off-canvas-content" data-off-canvas-content> <header class="site-header expanded row"> <div class="small-12 column"> <a href="#" class="off-canvas-toggle hide-for-medium" data-toggle="off-canvas-menu"><svg class="svg-icon svg-icon-menu" version="1.1" id="Menu" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"> <path class="svg-icon-menu-path" fill="#53CDEC" d="M16.4,9H3.6C3.048,9,3,9.447,3,10c0,0.553,0.048,1,0.6,1H16.4c0.552,0,0.6-0.447,0.6-1C17,9.447,16.952,9,16.4,9z M16.4,13 H3.6C3.048,13,3,13.447,3,14c0,0.553,0.048,1,0.6,1H16.4c0.552,0,0.6-0.447,0.6-1C17,13.447,16.952,13,16.4,13z M3.6,7H16.4 C16.952,7,17,6.553,17,6c0-0.553-0.048-1-0.6-1H3.6C3.048,5,3,5.447,3,6C3,6.553,3.048,7,3.6,7z"/></svg> </a> <div class="title-wrapper"> <div class="title-logo"></div> <div class="title"><a href="../index.html">Otoroshi</a></div> </div> <!-- <a href="https://www.example.com" class="logo show-for-medium">logo</a> --> </div> </header> <div class="expanded row"> <div class="medium-3 large-2 show-for-medium column"> <nav class="site-nav"> <div class="nav-home"> <a href="../index.html" > <span class="home-icon">⌂</span>Otoroshi </a> <div class="version-number"> 1.4.22 </div> </div> <div class="nav-toc"> <ul> <li><a href="../about.html" class="page">About Otoroshi</a></li> <li><a href="../archi.html" class="page">Architecture</a></li> <li><a href="../features.html" class="page">Features</a></li> <li><a href="../quickstart.html" class="page">Try Otoroshi in 5 minutes</a></li> <li><a href="../getotoroshi/index.html" class="page">Get Otoroshi</a> <ul> <li><a href="../getotoroshi/fromsources.html" class="page">From sources</a></li> <li><a href="../getotoroshi/frombinaries.html" class="page">From binaries</a></li> <li><a href="../getotoroshi/fromdocker.html" class="page">From docker</a></li> </ul></li> <li><a href="../firstrun/index.html" class="page">First run</a> <ul> <li><a href="../firstrun/datastore.html" class="page">Choose your datastore</a></li> <li><a href="../firstrun/configfile.html" class="page">Config. with files</a></li> <li><a href="../firstrun/env.html" class="page">Config. with ENVs</a></li> <li><a href="../firstrun/initialstate.html" class="page">Import initial state</a></li> <li><a href="../firstrun/host.html" class="page">Setup your hosts</a></li> <li><a href="../firstrun/run.html" class="page">Run Otoroshi</a></li> </ul></li> <li><a href="../setup/index.html" class="page">Setup Otoroshi</a> <ul> <li><a href="../setup/admin.html" class="page">Manage admin users</a></li> <li><a href="../setup/dangerzone.html" class="page">Configure the Danger zone</a></li> </ul></li> <li><a href="../usage/index.html" class="page">Using Otoroshi</a> <ul> <li><a href="../usage/1-groups.html" class="page">Managing service groups</a></li> <li><a href="../usage/2-services.html" class="page">Managing services</a></li> <li><a href="../usage/3-apikeys.html" class="page">Managing API keys</a></li> <li><a href="../usage/4-monitor.html" class="page">Monitoring services</a></li> <li><a href="../usage/5-sessions.html" class="page">Managing sessions</a></li> <li><a href="../usage/6-audit.html" class="page">Auditing Otoroshi</a></li> <li><a href="../usage/7-metrics.html" class="page">Otoroshi global metrics</a></li> <li><a href="../usage/8-importsexports.html" class="page">Import and export</a></li> <li><a href="../usage/9-auth.html" class="page">Authentication</a></li> </ul></li> <li><a href="../integrations/index.html" class="page">Third party Integrations</a> <ul> <li><a href="../integrations/analytics.html" class="page">Analytics</a></li> <li><a href="../integrations/mailgun.html" class="page">Mailgun</a></li> <li><a href="../integrations/statsd.html" class="page">StatsD / Datadog</a></li> <li><a href="../integrations/clevercloud.html" class="page">Clever Cloud</a></li> </ul></li> <li><a href="../topics/index.html" class="page">Detailed topics</a> <ul> <li><a href="../topics/snow-monkey.html" class="active page">Chaos engineering with the Snow Monkey</a></li> <li><a href="../topics/jwt-verifications.html" class="page">JWT Tokens verification</a></li> <li><a href="../topics/ssl.html" class="page">SSL/TLS termination with Otoroshi</a></li> <li><a href="../topics/mtls.html" class="page">Mutual TLS with Otoroshi</a></li> <li><a href="../topics/clustering.html" class="page">Otoroshi clustering</a></li> <li><a href="../topics/plugins.html" class="page">Otoroshi plugins</a></li> <li><a href="../topics/monitoring.html" class="page">Monitoring Otoroshi</a></li> </ul></li> <li><a href="../api.html" class="page">Admin REST API</a></li> <li><a href="../deploy/index.html" class="page">Deploy to production</a> <ul> <li><a href="../deploy/clevercloud.html" class="page">Clever Cloud</a></li> <li><a href="../deploy/aws-beanstalk.html" class="page">AWS - Elastic Beanstalk</a></li> <li><a href="../deploy/other.html" class="page">Others</a></li> <li><a href="../deploy/scaling.html" class="page">Scaling Otoroshi</a></li> </ul></li> <li><a href="../dev.html" class="page">Developing Otoroshi</a></li> </ul> </div> </nav> </div> <div class="small-12 medium-9 large-10 column"> <section class="site-content"> <div class="page-header row"> <div class="medium-12 show-for-medium column"> <div class="nav-breadcrumbs"> <ul> <li><a href="../index.html">Otoroshi</a></li> <li><a href="../topics/index.html">Detailed topics</a></li> <li>Chaos engineering with the Snow Monkey</li> </ul> </div> </div> </div> <div class="page-content row"> <div class="small-12 large-9 column" id="docs"> <h1><a href="#chaos-engineering-with-the-snow-monkey" name="chaos-engineering-with-the-snow-monkey" class="anchor"><span class="anchor-link"></span></a>Chaos engineering with the Snow Monkey</h1> <p>Nihonzaru (the Snow Monkey) is the chaos engineering tool provided by Otoroshi. You can access it at <code>Settings (cog icon) / Snow Monkey</code>.</p><div class="centered-img"> <img src="https://github.com/MAIF/otoroshi/raw/master/resources/nihonzaru-logo.png" /></div> <h2><a href="#chaos-engineering" name="chaos-engineering" class="anchor"><span class="anchor-link"></span></a>Chaos engineering</h2> <p>Otoroshi offers some tools to introduce <a href="https://principlesofchaos.org/">chaos engineering</a> in your everyday life. With chaos engineering, you will improve the resilience of your architecture by creating faults in production on running systems. With <a href="https://en.wikipedia.org/wiki/Japanese_macaque">Nihonzaru (the snow monkey)</a> Otoroshi helps you to create faults on http request/response handled by Otoroshi. </p><div class="centered-img"> <img src="../img/snow-monkey.png" /></div> <h2><a href="#settings" name="settings" class="anchor"><span class="anchor-link"></span></a>Settings</h2><div class="centered-img"> <img src="../img/snow-monkey-settings.png" /></div> <p>The snow monkey let you define a few settings to work properly :</p> <ul> <li><strong>Include user facing apps.</strong>: you want to create fault in production, but maybe you don&rsquo;t want your users to enjoy some nice snow monkey generated error pages. Using this switch let you include of not user facing apps (ui apps). Each service descriptor has a <code>User facing app switch</code> that will be used by the snow monkey.</li> <li><strong>Dry run</strong>: when dry run is enabled, outages will be registered and will generate events and alerts (in the otoroshi eventing system) but requests won&rsquo;t be actualy impacted. It&rsquo;s a good way to prepare applications to the snow monkey habits</li> <li><strong>Outage strategy</strong>: Either <code>AllServicesPerGroup</code> or <code>OneServicePerGroup</code>. It means that only one service per group or all services per groups will have <code>n</code> outages (see next bullet point) during the snow monkey working period</li> <li><strong>Outages per day</strong>: during snow monkey working period, each service per group or one service per group will have only <code>n</code> outages registered</li> <li><strong>Working period</strong>: the snow monkey only works during a working period. Here you can defined when it starts and when it stops</li> <li><strong>Outage duration</strong>: here you can defined the bounds for the random outage duration when an outage is created on a service</li> <li><strong>Impacted groups</strong>: here you can define a list of service groups impacted by the snow monkey. If none is specified, then all service groups will be impacted</li> </ul> <h2><a href="#faults" name="faults" class="anchor"><span class="anchor-link"></span></a>Faults</h2> <p>With the snow monkey, you can generate four types of faults</p> <ul> <li><strong>Large request fault</strong>: Add trailing bytes at the end of the request body (if one)</li> <li><strong>Large response fault</strong>: Add trailing bytes at the end of the response body</li> <li><strong>Latency injection fault</strong>: Add random response latency between two bounds</li> <li><strong>Bad response injection fault</strong>: Create predefined responses with custom headers, body and status code</li> </ul> <p>Each fault let you define a ratio for impacted requests. If you specify a ratio of <code>0.2</code>, then 20% of the requests for the impacte service will be impacted by this fault</p><div class="centered-img"> <img src="../img/snow-monkey-faults.png" /></div> <p>Then you juste have to start the snow monkey and enjoy the show ;)</p><div class="centered-img"> <img src="../img/snow-monkey-start.png" /></div> <h2><a href="#current-outages" name="current-outages" class="anchor"><span class="anchor-link"></span></a>Current outages</h2> <p>In the last section of the snow monkey page, you can see current outages (per service), when they started, their duration, etc &hellip;</p><div class="centered-img"> <img src="../img/snow-monkey-outages.png" /></div> <div class="nav-next"> <p><strong>Next:</strong> <a href="../topics/jwt-verifications.html">JWT Tokens verification</a></p> </div> </div> <div class="large-3 show-for-large column" data-sticky-container> <nav class="sidebar sticky" data-sticky data-anchor="docs" data-sticky-on="large"> <div class="page-nav"> <div class="nav-title">On this page:</div> <div class="nav-toc"> <ul> <li><a href="../topics/snow-monkey.html#chaos-engineering-with-the-snow-monkey" class="header">Chaos engineering with the Snow Monkey</a> <ul> <li><a href="../topics/snow-monkey.html#chaos-engineering" class="header">Chaos engineering</a></li> <li><a href="../topics/snow-monkey.html#settings" class="header">Settings</a></li> <li><a href="../topics/snow-monkey.html#faults" class="header">Faults</a></li> <li><a href="../topics/snow-monkey.html#current-outages" class="header">Current outages</a></li> </ul></li> </ul> </div> </div> </nav> </div> </div> </section> </div> </div> <footer class="site-footer"> <section class="site-footer-nav"> <div class="expanded row"> <div class="small-12 large-offset-2 large-10 column"> <div class="row site-footer-content"> <div class="small-12 medium-4 large-3 text-center column"> <div class="nav-links"> <ul> <!-- <li><a href="https://www.example.com/products/">Products</a> --> </ul> </div> </div> </div> </div> </div> </section> <section class="site-footer-base"> <div class="expanded row"> <div class="small-12 large-offset-2 large-10 column"> <div class="row site-footer-content"> <div class="small-12 text-center large-9 column"> <!-- <div class="copyright"> <span class="text">&copy; 2020</span> <a href="https://www.example.com" class="logo">logo</a> </div> --> </div> </div> </div> </div> </section> </footer> </div> </div> </div> </body> <script type="text/javascript" src="../lib/foundation/dist/foundation.min.js"></script> <script type="text/javascript">jQuery(document).foundation();</script> <script type="text/javascript" src="../js/magellan.js"></script> <style type="text/css">@import "../lib/prettify/prettify.css";</style> <script type="text/javascript" src="../lib/prettify/prettify.js"></script> <script type="text/javascript" src="../lib/prettify/lang-scala.js"></script> <script type="text/javascript">jQuery(function(){window.prettyPrint && prettyPrint()});</script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/elasticlunr/0.9.5/elasticlunr.js"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-112498312-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-112498312-1'); </script> </html>
{ "pile_set_name": "Github" }
/* Copyright 2017 The Kubernetes Authors. 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 gce import ( "k8s.io/klog" computealpha "google.golang.org/api/compute/v0.alpha" computebeta "google.golang.org/api/compute/v0.beta" compute "google.golang.org/api/compute/v1" "k8s.io/api/core/v1" utilversion "k8s.io/apimachinery/pkg/util/version" "k8s.io/kubernetes/pkg/cloudprovider/providers/gce/cloud" "k8s.io/kubernetes/pkg/cloudprovider/providers/gce/cloud/filter" "k8s.io/kubernetes/pkg/cloudprovider/providers/gce/cloud/meta" "k8s.io/kubernetes/pkg/master/ports" ) const ( nodesHealthCheckPath = "/healthz" lbNodesHealthCheckPort = ports.ProxyHealthzPort ) var ( minNodesHealthCheckVersion *utilversion.Version ) func init() { if v, err := utilversion.ParseGeneric("1.7.2"); err != nil { klog.Fatalf("Failed to parse version for minNodesHealthCheckVersion: %v", err) } else { minNodesHealthCheckVersion = v } } func newHealthcheckMetricContext(request string) *metricContext { return newHealthcheckMetricContextWithVersion(request, computeV1Version) } func newHealthcheckMetricContextWithVersion(request, version string) *metricContext { return newGenericMetricContext("healthcheck", request, unusedMetricLabel, unusedMetricLabel, version) } // GetHTTPHealthCheck returns the given HttpHealthCheck by name. func (g *Cloud) GetHTTPHealthCheck(name string) (*compute.HttpHealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("get_legacy") v, err := g.c.HttpHealthChecks().Get(ctx, meta.GlobalKey(name)) return v, mc.Observe(err) } // UpdateHTTPHealthCheck applies the given HttpHealthCheck as an update. func (g *Cloud) UpdateHTTPHealthCheck(hc *compute.HttpHealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("update_legacy") return mc.Observe(g.c.HttpHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc)) } // DeleteHTTPHealthCheck deletes the given HttpHealthCheck by name. func (g *Cloud) DeleteHTTPHealthCheck(name string) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("delete_legacy") return mc.Observe(g.c.HttpHealthChecks().Delete(ctx, meta.GlobalKey(name))) } // CreateHTTPHealthCheck creates the given HttpHealthCheck. func (g *Cloud) CreateHTTPHealthCheck(hc *compute.HttpHealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("create_legacy") return mc.Observe(g.c.HttpHealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc)) } // ListHTTPHealthChecks lists all HttpHealthChecks in the project. func (g *Cloud) ListHTTPHealthChecks() ([]*compute.HttpHealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("list_legacy") v, err := g.c.HttpHealthChecks().List(ctx, filter.None) return v, mc.Observe(err) } // Legacy HTTPS Health Checks // GetHTTPSHealthCheck returns the given HttpsHealthCheck by name. func (g *Cloud) GetHTTPSHealthCheck(name string) (*compute.HttpsHealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("get_legacy") v, err := g.c.HttpsHealthChecks().Get(ctx, meta.GlobalKey(name)) return v, mc.Observe(err) } // UpdateHTTPSHealthCheck applies the given HttpsHealthCheck as an update. func (g *Cloud) UpdateHTTPSHealthCheck(hc *compute.HttpsHealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("update_legacy") return mc.Observe(g.c.HttpsHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc)) } // DeleteHTTPSHealthCheck deletes the given HttpsHealthCheck by name. func (g *Cloud) DeleteHTTPSHealthCheck(name string) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("delete_legacy") return mc.Observe(g.c.HttpsHealthChecks().Delete(ctx, meta.GlobalKey(name))) } // CreateHTTPSHealthCheck creates the given HttpsHealthCheck. func (g *Cloud) CreateHTTPSHealthCheck(hc *compute.HttpsHealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("create_legacy") return mc.Observe(g.c.HttpsHealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc)) } // ListHTTPSHealthChecks lists all HttpsHealthChecks in the project. func (g *Cloud) ListHTTPSHealthChecks() ([]*compute.HttpsHealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("list_legacy") v, err := g.c.HttpsHealthChecks().List(ctx, filter.None) return v, mc.Observe(err) } // Generic HealthCheck // GetHealthCheck returns the given HealthCheck by name. func (g *Cloud) GetHealthCheck(name string) (*compute.HealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("get") v, err := g.c.HealthChecks().Get(ctx, meta.GlobalKey(name)) return v, mc.Observe(err) } // GetAlphaHealthCheck returns the given alpha HealthCheck by name. func (g *Cloud) GetAlphaHealthCheck(name string) (*computealpha.HealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContextWithVersion("get", computeAlphaVersion) v, err := g.c.AlphaHealthChecks().Get(ctx, meta.GlobalKey(name)) return v, mc.Observe(err) } // GetBetaHealthCheck returns the given beta HealthCheck by name. func (g *Cloud) GetBetaHealthCheck(name string) (*computebeta.HealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContextWithVersion("get", computeBetaVersion) v, err := g.c.BetaHealthChecks().Get(ctx, meta.GlobalKey(name)) return v, mc.Observe(err) } // UpdateHealthCheck applies the given HealthCheck as an update. func (g *Cloud) UpdateHealthCheck(hc *compute.HealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("update") return mc.Observe(g.c.HealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc)) } // UpdateAlphaHealthCheck applies the given alpha HealthCheck as an update. func (g *Cloud) UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContextWithVersion("update", computeAlphaVersion) return mc.Observe(g.c.AlphaHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc)) } // UpdateBetaHealthCheck applies the given beta HealthCheck as an update. func (g *Cloud) UpdateBetaHealthCheck(hc *computebeta.HealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContextWithVersion("update", computeBetaVersion) return mc.Observe(g.c.BetaHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc)) } // DeleteHealthCheck deletes the given HealthCheck by name. func (g *Cloud) DeleteHealthCheck(name string) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("delete") return mc.Observe(g.c.HealthChecks().Delete(ctx, meta.GlobalKey(name))) } // CreateHealthCheck creates the given HealthCheck. func (g *Cloud) CreateHealthCheck(hc *compute.HealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("create") return mc.Observe(g.c.HealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc)) } // CreateAlphaHealthCheck creates the given alpha HealthCheck. func (g *Cloud) CreateAlphaHealthCheck(hc *computealpha.HealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContextWithVersion("create", computeAlphaVersion) return mc.Observe(g.c.AlphaHealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc)) } // CreateBetaHealthCheck creates the given beta HealthCheck. func (g *Cloud) CreateBetaHealthCheck(hc *computebeta.HealthCheck) error { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContextWithVersion("create", computeBetaVersion) return mc.Observe(g.c.BetaHealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc)) } // ListHealthChecks lists all HealthCheck in the project. func (g *Cloud) ListHealthChecks() ([]*compute.HealthCheck, error) { ctx, cancel := cloud.ContextWithCallTimeout() defer cancel() mc := newHealthcheckMetricContext("list") v, err := g.c.HealthChecks().List(ctx, filter.None) return v, mc.Observe(err) } // GetNodesHealthCheckPort returns the health check port used by the GCE load // balancers (l4) for performing health checks on nodes. func GetNodesHealthCheckPort() int32 { return lbNodesHealthCheckPort } // GetNodesHealthCheckPath returns the health check path used by the GCE load // balancers (l4) for performing health checks on nodes. func GetNodesHealthCheckPath() string { return nodesHealthCheckPath } // isAtLeastMinNodesHealthCheckVersion checks if a version is higher than // `minNodesHealthCheckVersion`. func isAtLeastMinNodesHealthCheckVersion(vstring string) bool { version, err := utilversion.ParseGeneric(vstring) if err != nil { klog.Errorf("vstring (%s) is not a valid version string: %v", vstring, err) return false } return version.AtLeast(minNodesHealthCheckVersion) } // supportsNodesHealthCheck returns false if anyone of the nodes has version // lower than `minNodesHealthCheckVersion`. func supportsNodesHealthCheck(nodes []*v1.Node) bool { for _, node := range nodes { if !isAtLeastMinNodesHealthCheckVersion(node.Status.NodeInfo.KubeProxyVersion) { return false } } return true }
{ "pile_set_name": "Github" }
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package eval import ( "go/ast" "go/token" "log" "math/big" "reflect" "sort" "unsafe" // For Sizeof ) // XXX(Spec) The type compatibility section is very confusing because // it makes it seem like there are three distinct types of // compatibility: plain compatibility, assignment compatibility, and // comparison compatibility. As I understand it, there's really only // assignment compatibility and comparison and conversion have some // restrictions and have special meaning in some cases where the types // are not otherwise assignment compatible. The comparison // compatibility section is almost all about the semantics of // comparison, not the type checking of it, so it would make much more // sense in the comparison operators section. The compatibility and // assignment compatibility sections should be rolled into one. type Type interface { // compat returns whether this type is compatible with another // type. If conv is false, this is normal compatibility, // where two named types are compatible only if they are the // same named type. If conv if true, this is conversion // compatibility, where two named types are conversion // compatible if their definitions are conversion compatible. // // TODO(austin) Deal with recursive types compat(o Type, conv bool) bool // lit returns this type's literal. If this is a named type, // this is the unnamed underlying type. Otherwise, this is an // identity operation. lit() Type // isBoolean returns true if this is a boolean type. isBoolean() bool // isInteger returns true if this is an integer type. isInteger() bool // isFloat returns true if this is a floating type. isFloat() bool // isIdeal returns true if this is an ideal int or float. isIdeal() bool // Zero returns a new zero value of this type. Zero() Value // String returns the string representation of this type. String() string // The position where this type was defined, if any. //Pos() token.Pos } type BoundedType interface { Type // minVal returns the smallest value of this type. minVal() *big.Rat // maxVal returns the largest value of this type. maxVal() *big.Rat } var universePos = token.NoPos /* * Type array maps. These are used to memoize composite types. */ type typeArrayMapEntry struct { key []Type v interface{} next *typeArrayMapEntry } type typeArrayMap map[uintptr]*typeArrayMapEntry func hashTypeArray(key []Type) uintptr { hash := uintptr(0) for _, t := range key { hash = hash * 33 if t == nil { continue } addr := reflect.ValueOf(t).Pointer() hash ^= addr } return hash } func newTypeArrayMap() typeArrayMap { return make(map[uintptr]*typeArrayMapEntry) } func (m typeArrayMap) Get(key []Type) interface{} { ent, ok := m[hashTypeArray(key)] if !ok { return nil } nextEnt: for ; ent != nil; ent = ent.next { if len(key) != len(ent.key) { continue } for i := 0; i < len(key); i++ { if key[i] != ent.key[i] { continue nextEnt } } // Found it return ent.v } return nil } func (m typeArrayMap) Put(key []Type, v interface{}) interface{} { hash := hashTypeArray(key) ent := m[hash] new := &typeArrayMapEntry{key, v, ent} m[hash] = new return v } /* * Common type */ type commonType struct{} func (commonType) isBoolean() bool { return false } func (commonType) isInteger() bool { return false } func (commonType) isFloat() bool { return false } func (commonType) isIdeal() bool { return false } /* * Package */ type packageField struct { Name string Type Type } type packageType struct { commonType Elems []packageField } var packageTypes = make(map[string]*packageType) func newPackageType(path string, fields []packageField) *packageType { t, ok := packageTypes[path] if !ok { t = &packageType{commonType{}, fields} packageTypes[path] = t } return t } func (p *packageType) compat(o Type, conv bool) bool { return false } func (p *packageType) lit() Type { return p } func (p *packageType) String() string { // Use angle brackets as a convention for printing the // underlying, unnamed type. This should only show up in // debug output. return "<package>" } func (p *packageType) Zero() Value { pkg := packageV{} pkg.name = "" pkg.idents = make([]Value, 0) return &pkg } /* * Bool */ type boolType struct { commonType } var BoolType = universe.DefineType("bool", universePos, &boolType{}) func (t *boolType) compat(o Type, conv bool) bool { _, ok := o.lit().(*boolType) return ok } func (t *boolType) lit() Type { return t } func (t *boolType) isBoolean() bool { return true } func (boolType) String() string { // Use angle brackets as a convention for printing the // underlying, unnamed type. This should only show up in // debug output. return "<bool>" } func (t *boolType) Zero() Value { res := boolV(false) return &res } /* * Uint */ type uintType struct { commonType // 0 for architecture-dependent types Bits uint // true for uintptr, false for all others Ptr bool name string } var ( Uint8Type = universe.DefineType("uint8", universePos, &uintType{commonType{}, 8, false, "uint8"}) Uint16Type = universe.DefineType("uint16", universePos, &uintType{commonType{}, 16, false, "uint16"}) Uint32Type = universe.DefineType("uint32", universePos, &uintType{commonType{}, 32, false, "uint32"}) Uint64Type = universe.DefineType("uint64", universePos, &uintType{commonType{}, 64, false, "uint64"}) UintType = universe.DefineType("uint", universePos, &uintType{commonType{}, 0, false, "uint"}) UintptrType = universe.DefineType("uintptr", universePos, &uintType{commonType{}, 0, true, "uintptr"}) ) func (t *uintType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*uintType) return ok && t == t2 } func (t *uintType) lit() Type { return t } func (t *uintType) isInteger() bool { return true } func (t *uintType) String() string { return "<" + t.name + ">" } func (t *uintType) Zero() Value { switch t.Bits { case 0: if t.Ptr { res := uintptrV(0) return &res } else { res := uintV(0) return &res } case 8: res := uint8V(0) return &res case 16: res := uint16V(0) return &res case 32: res := uint32V(0) return &res case 64: res := uint64V(0) return &res } panic("unexpected uint bit count") } func (t *uintType) minVal() *big.Rat { return big.NewRat(0, 1) } func (t *uintType) maxVal() *big.Rat { bits := t.Bits if bits == 0 { if t.Ptr { bits = uint(8 * unsafe.Sizeof(uintptr(0))) } else { bits = uint(8 * unsafe.Sizeof(uint(0))) } } numer := big.NewInt(1) numer.Lsh(numer, bits) numer.Sub(numer, idealOne) return new(big.Rat).SetInt(numer) } /* * Int */ type intType struct { commonType // XXX(Spec) Numeric types: "There is also a set of // architecture-independent basic numeric types whose size // depends on the architecture." Should that be // architecture-dependent? // 0 for architecture-dependent types Bits uint name string } var ( Int8Type = universe.DefineType("int8", universePos, &intType{commonType{}, 8, "int8"}) Int16Type = universe.DefineType("int16", universePos, &intType{commonType{}, 16, "int16"}) Int32Type = universe.DefineType("int32", universePos, &intType{commonType{}, 32, "int32"}) Int64Type = universe.DefineType("int64", universePos, &intType{commonType{}, 64, "int64"}) IntType = universe.DefineType("int", universePos, &intType{commonType{}, 0, "int"}) ) func (t *intType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*intType) return ok && t == t2 } func (t *intType) lit() Type { return t } func (t *intType) isInteger() bool { return true } func (t *intType) String() string { return "<" + t.name + ">" } func (t *intType) Zero() Value { switch t.Bits { case 8: res := int8V(0) return &res case 16: res := int16V(0) return &res case 32: res := int32V(0) return &res case 64: res := int64V(0) return &res case 0: res := intV(0) return &res } panic("unexpected int bit count") } func (t *intType) minVal() *big.Rat { bits := t.Bits if bits == 0 { bits = uint(8 * unsafe.Sizeof(int(0))) } numer := big.NewInt(-1) numer.Lsh(numer, bits-1) return new(big.Rat).SetInt(numer) } func (t *intType) maxVal() *big.Rat { bits := t.Bits if bits == 0 { bits = uint(8 * unsafe.Sizeof(int(0))) } numer := big.NewInt(1) numer.Lsh(numer, bits-1) numer.Sub(numer, idealOne) return new(big.Rat).SetInt(numer) } /* * Ideal int */ type idealIntType struct { commonType } var IdealIntType Type = &idealIntType{} func (t *idealIntType) compat(o Type, conv bool) bool { _, ok := o.lit().(*idealIntType) return ok } func (t *idealIntType) lit() Type { return t } func (t *idealIntType) isInteger() bool { return true } func (t *idealIntType) isIdeal() bool { return true } func (t *idealIntType) String() string { return "ideal integer" } func (t *idealIntType) Zero() Value { return &idealIntV{idealZero} } /* * Float */ type floatType struct { commonType // 0 for architecture-dependent type Bits uint name string } var ( Float32Type = universe.DefineType("float32", universePos, &floatType{commonType{}, 32, "float32"}) Float64Type = universe.DefineType("float64", universePos, &floatType{commonType{}, 64, "float64"}) ) func (t *floatType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*floatType) return ok && t == t2 } func (t *floatType) lit() Type { return t } func (t *floatType) isFloat() bool { return true } func (t *floatType) String() string { return "<" + t.name + ">" } func (t *floatType) Zero() Value { switch t.Bits { case 32: res := float32V(0) return &res case 64: res := float64V(0) return &res } panic("unexpected float bit count") } var maxFloat32Val *big.Rat var maxFloat64Val *big.Rat var minFloat32Val *big.Rat var minFloat64Val *big.Rat func (t *floatType) minVal() *big.Rat { bits := t.Bits switch bits { case 32: return minFloat32Val case 64: return minFloat64Val } log.Panicf("unexpected floating point bit count: %d", bits) panic("unreachable") } func (t *floatType) maxVal() *big.Rat { bits := t.Bits switch bits { case 32: return maxFloat32Val case 64: return maxFloat64Val } log.Panicf("unexpected floating point bit count: %d", bits) panic("unreachable") } /* * Ideal float */ type idealFloatType struct { commonType } var IdealFloatType Type = &idealFloatType{} func (t *idealFloatType) compat(o Type, conv bool) bool { _, ok := o.lit().(*idealFloatType) return ok } func (t *idealFloatType) lit() Type { return t } func (t *idealFloatType) isFloat() bool { return true } func (t *idealFloatType) isIdeal() bool { return true } func (t *idealFloatType) String() string { return "ideal float" } func (t *idealFloatType) Zero() Value { return &idealFloatV{big.NewRat(0, 1)} } /* * String */ type stringType struct { commonType } var StringType = universe.DefineType("string", universePos, &stringType{}) func (t *stringType) compat(o Type, conv bool) bool { _, ok := o.lit().(*stringType) return ok } func (t *stringType) lit() Type { return t } func (t *stringType) String() string { return "<string>" } func (t *stringType) Zero() Value { res := stringV("") return &res } /* * Array */ type ArrayType struct { commonType Len int64 Elem Type } var arrayTypes = make(map[int64]map[Type]*ArrayType) // Two array types are identical if they have identical element types // and the same array length. func NewArrayType(len int64, elem Type) *ArrayType { ts, ok := arrayTypes[len] if !ok { ts = make(map[Type]*ArrayType) arrayTypes[len] = ts } t, ok := ts[elem] if !ok { t = &ArrayType{commonType{}, len, elem} ts[elem] = t } return t } func (t *ArrayType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*ArrayType) if !ok { return false } return t.Len == t2.Len && t.Elem.compat(t2.Elem, conv) } func (t *ArrayType) lit() Type { return t } func (t *ArrayType) String() string { return "[]" + t.Elem.String() } func (t *ArrayType) Zero() Value { res := arrayV(make([]Value, t.Len)) // TODO(austin) It's unfortunate that each element is // separately heap allocated. We could add ZeroArray to // everything, though that doesn't help with multidimensional // arrays. Or we could do something unsafe. We'll have this // same problem with structs. for i := int64(0); i < t.Len; i++ { res[i] = t.Elem.Zero() } return &res } /* * Struct */ type StructField struct { Name string Type Type Anonymous bool } type StructType struct { commonType Elems []StructField } var structTypes = newTypeArrayMap() // Two struct types are identical if they have the same sequence of // fields, and if corresponding fields have the same names and // identical types. Two anonymous fields are considered to have the // same name. func NewStructType(fields []StructField) *StructType { // Start by looking up just the types fts := make([]Type, len(fields)) for i, f := range fields { fts[i] = f.Type } tMapI := structTypes.Get(fts) if tMapI == nil { tMapI = structTypes.Put(fts, make(map[string]*StructType)) } tMap := tMapI.(map[string]*StructType) // Construct key for field names key := "" for _, f := range fields { // XXX(Spec) It's not clear if struct { T } and struct // { T T } are either identical or compatible. The // "Struct Types" section says that the name of that // field is "T", which suggests that they are // identical, but it really means that it's the name // for the purpose of selector expressions and nothing // else. We decided that they should be neither // identical or compatible. if f.Anonymous { key += "!" } key += f.Name + " " } // XXX(Spec) Do the tags also have to be identical for the // types to be identical? I certainly hope so, because // otherwise, this is the only case where two distinct type // objects can represent identical types. t, ok := tMap[key] if !ok { // Create new struct type t = &StructType{commonType{}, fields} tMap[key] = t } return t } func (t *StructType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*StructType) if !ok { return false } if len(t.Elems) != len(t2.Elems) { return false } for i, e := range t.Elems { e2 := t2.Elems[i] // XXX(Spec) An anonymous and a non-anonymous field // are neither identical nor compatible. if e.Anonymous != e2.Anonymous || (!e.Anonymous && e.Name != e2.Name) || !e.Type.compat(e2.Type, conv) { return false } } return true } func (t *StructType) lit() Type { return t } func (t *StructType) String() string { s := "struct {" for i, f := range t.Elems { if i > 0 { s += "; " } if !f.Anonymous { s += f.Name + " " } s += f.Type.String() } return s + "}" } func (t *StructType) Zero() Value { res := structV(make([]Value, len(t.Elems))) for i, f := range t.Elems { res[i] = f.Type.Zero() } return &res } /* * Pointer */ type PtrType struct { commonType Elem Type } var ptrTypes = make(map[Type]*PtrType) // Two pointer types are identical if they have identical base types. func NewPtrType(elem Type) *PtrType { t, ok := ptrTypes[elem] if !ok { t = &PtrType{commonType{}, elem} ptrTypes[elem] = t } return t } func (t *PtrType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*PtrType) if !ok { return false } return t.Elem.compat(t2.Elem, conv) } func (t *PtrType) lit() Type { return t } func (t *PtrType) String() string { return "*" + t.Elem.String() } func (t *PtrType) Zero() Value { return &ptrV{nil} } /* * Function */ type FuncType struct { commonType // TODO(austin) Separate receiver Type for methods? In []Type Variadic bool Out []Type builtin string } var funcTypes = newTypeArrayMap() var variadicFuncTypes = newTypeArrayMap() // Create singleton function types for magic built-in functions var ( appendType = &FuncType{builtin: "append"} capType = &FuncType{builtin: "cap"} closeType = &FuncType{builtin: "close"} closedType = &FuncType{builtin: "closed"} lenType = &FuncType{builtin: "len"} makeType = &FuncType{builtin: "make"} newType = &FuncType{builtin: "new"} panicType = &FuncType{builtin: "panic"} printType = &FuncType{builtin: "print"} printlnType = &FuncType{builtin: "println"} copyType = &FuncType{builtin: "copy"} ) // Two function types are identical if they have the same number of // parameters and result values and if corresponding parameter and // result types are identical. All "..." parameters have identical // type. Parameter and result names are not required to match. func NewFuncType(in []Type, variadic bool, out []Type) *FuncType { inMap := funcTypes if variadic { inMap = variadicFuncTypes } outMapI := inMap.Get(in) if outMapI == nil { outMapI = inMap.Put(in, newTypeArrayMap()) } outMap := outMapI.(typeArrayMap) tI := outMap.Get(out) if tI != nil { return tI.(*FuncType) } t := &FuncType{commonType{}, in, variadic, out, ""} outMap.Put(out, t) return t } func (t *FuncType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*FuncType) if !ok { return false } if len(t.In) != len(t2.In) || t.Variadic != t2.Variadic || len(t.Out) != len(t2.Out) { return false } for i := range t.In { if !t.In[i].compat(t2.In[i], conv) { return false } } for i := range t.Out { if !t.Out[i].compat(t2.Out[i], conv) { return false } } return true } func (t *FuncType) lit() Type { return t } func typeListString(ts []Type, ns []*ast.Ident) string { s := "" for i, t := range ts { if i > 0 { s += ", " } if ns != nil && ns[i] != nil { s += ns[i].Name + " " } if t == nil { // Some places use nil types to represent errors s += "<none>" } else { s += t.String() } } return s } func (t *FuncType) String() string { if t.builtin != "" { return "built-in function " + t.builtin } args := typeListString(t.In, nil) if t.Variadic { if len(args) > 0 { args += ", " } args += "..." } s := "func(" + args + ")" if len(t.Out) > 0 { s += " (" + typeListString(t.Out, nil) + ")" } return s } func (t *FuncType) Zero() Value { return &funcV{nil} } type FuncDecl struct { Type *FuncType Name *ast.Ident // nil for function literals // InNames will be one longer than Type.In if this function is // variadic. InNames []*ast.Ident OutNames []*ast.Ident } func (t *FuncDecl) String() string { s := "func" if t.Name != nil { s += " " + t.Name.Name } s += funcTypeString(t.Type, t.InNames, t.OutNames) return s } func funcTypeString(ft *FuncType, ins []*ast.Ident, outs []*ast.Ident) string { s := "(" s += typeListString(ft.In, ins) if ft.Variadic { if len(ft.In) > 0 { s += ", " } s += "..." } s += ")" if len(ft.Out) > 0 { s += " (" + typeListString(ft.Out, outs) + ")" } return s } /* * Interface */ // TODO(austin) Interface values, types, and type compilation are // implemented, but none of the type checking or semantics of // interfaces are. type InterfaceType struct { commonType // TODO(austin) This should be a map from names to // *FuncType's. We only need the sorted list for generating // the type map key. It's detrimental for everything else. methods []IMethod } type IMethod struct { Name string Type *FuncType } var interfaceTypes = newTypeArrayMap() func NewInterfaceType(methods []IMethod, embeds []*InterfaceType) *InterfaceType { // Count methods of embedded interfaces nMethods := len(methods) for _, e := range embeds { nMethods += len(e.methods) } // Combine methods allMethods := make([]IMethod, nMethods) copy(allMethods, methods) n := len(methods) for _, e := range embeds { for _, m := range e.methods { allMethods[n] = m n++ } } // Sort methods sort.Sort(iMethodSorter(allMethods)) mts := make([]Type, len(allMethods)) for i, m := range methods { mts[i] = m.Type } tMapI := interfaceTypes.Get(mts) if tMapI == nil { tMapI = interfaceTypes.Put(mts, make(map[string]*InterfaceType)) } tMap := tMapI.(map[string]*InterfaceType) key := "" for _, m := range allMethods { key += m.Name + " " } t, ok := tMap[key] if !ok { t = &InterfaceType{commonType{}, allMethods} tMap[key] = t } return t } type iMethodSorter []IMethod func (s iMethodSorter) Less(a, b int) bool { return s[a].Name < s[b].Name } func (s iMethodSorter) Swap(a, b int) { s[a], s[b] = s[b], s[a] } func (s iMethodSorter) Len() int { return len(s) } func (t *InterfaceType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*InterfaceType) if !ok { return false } if len(t.methods) != len(t2.methods) { return false } for i, e := range t.methods { e2 := t2.methods[i] if e.Name != e2.Name || !e.Type.compat(e2.Type, conv) { return false } } return true } func (t *InterfaceType) lit() Type { return t } func (t *InterfaceType) String() string { // TODO(austin) Instead of showing embedded interfaces, this // shows their methods. s := "interface {" for i, m := range t.methods { if i > 0 { s += "; " } s += m.Name + funcTypeString(m.Type, nil, nil) } return s + "}" } // implementedBy tests if o implements t, returning nil, true if it does. // Otherwise, it returns a method of t that o is missing and false. func (t *InterfaceType) implementedBy(o Type) (*IMethod, bool) { if len(t.methods) == 0 { return nil, true } // The methods of a named interface types are those of the // underlying type. if it, ok := o.lit().(*InterfaceType); ok { o = it } // XXX(Spec) Interface types: "A type implements any interface // comprising any subset of its methods" It's unclear if // methods must have identical or compatible types. 6g // requires identical types. switch o := o.(type) { case *NamedType: for _, tm := range t.methods { sm, ok := o.methods[tm.Name] if !ok || sm.decl.Type != tm.Type { return &tm, false } } return nil, true case *InterfaceType: var ti, oi int for ti < len(t.methods) && oi < len(o.methods) { tm, om := &t.methods[ti], &o.methods[oi] switch { case tm.Name == om.Name: if tm.Type != om.Type { return tm, false } ti++ oi++ case tm.Name > om.Name: oi++ default: return tm, false } } if ti < len(t.methods) { return &t.methods[ti], false } return nil, true } return &t.methods[0], false } func (t *InterfaceType) Zero() Value { return &interfaceV{} } /* * Slice */ type SliceType struct { commonType Elem Type } var sliceTypes = make(map[Type]*SliceType) // Two slice types are identical if they have identical element types. func NewSliceType(elem Type) *SliceType { t, ok := sliceTypes[elem] if !ok { t = &SliceType{commonType{}, elem} sliceTypes[elem] = t } return t } func (t *SliceType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*SliceType) if !ok { return false } return t.Elem.compat(t2.Elem, conv) } func (t *SliceType) lit() Type { return t } func (t *SliceType) String() string { return "[]" + t.Elem.String() } func (t *SliceType) Zero() Value { // The value of an uninitialized slice is nil. The length and // capacity of a nil slice are 0. return &sliceV{Slice{nil, 0, 0}} } /* * Map type */ type MapType struct { commonType Key Type Elem Type } var mapTypes = make(map[Type]map[Type]*MapType) func NewMapType(key Type, elem Type) *MapType { ts, ok := mapTypes[key] if !ok { ts = make(map[Type]*MapType) mapTypes[key] = ts } t, ok := ts[elem] if !ok { t = &MapType{commonType{}, key, elem} ts[elem] = t } return t } func (t *MapType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*MapType) if !ok { return false } return t.Elem.compat(t2.Elem, conv) && t.Key.compat(t2.Key, conv) } func (t *MapType) lit() Type { return t } func (t *MapType) String() string { return "map[" + t.Key.String() + "] " + t.Elem.String() } func (t *MapType) Zero() Value { // The value of an uninitialized map is nil. return &mapV{nil} } /* type ChanType struct { // TODO(austin) } */ /* * Named types */ type Method struct { decl *FuncDecl fn Func } type NamedType struct { NamePos token.Pos Name string // Underlying type. If incomplete is true, this will be nil. // If incomplete is false and this is still nil, then this is // a placeholder type representing an error. Def Type // True while this type is being defined. incomplete bool methods map[string]Method } // TODO(austin) This is temporarily needed by the debugger's remote // type parser. This should only be possible with block.DefineType. func NewNamedType(name string) *NamedType { return &NamedType{token.NoPos, name, nil, true, make(map[string]Method)} } func (t *NamedType) Pos() token.Pos { return t.NamePos } func (t *NamedType) Complete(def Type) { if !t.incomplete { log.Panicf("cannot complete already completed NamedType %+v", *t) } // We strip the name from def because multiple levels of // naming are useless. if ndef, ok := def.(*NamedType); ok { def = ndef.Def } t.Def = def t.incomplete = false } func (t *NamedType) compat(o Type, conv bool) bool { t2, ok := o.(*NamedType) if ok { if conv { // Two named types are conversion compatible // if their literals are conversion // compatible. return t.Def.compat(t2.Def, conv) } else { // Two named types are compatible if their // type names originate in the same type // declaration. return t == t2 } } // A named and an unnamed type are compatible if the // respective type literals are compatible. return o.compat(t.Def, conv) } func (t *NamedType) lit() Type { return t.Def.lit() } func (t *NamedType) isBoolean() bool { return t.Def.isBoolean() } func (t *NamedType) isInteger() bool { return t.Def.isInteger() } func (t *NamedType) isFloat() bool { return t.Def.isFloat() } func (t *NamedType) isIdeal() bool { return false } func (t *NamedType) String() string { return t.Name } func (t *NamedType) Zero() Value { return t.Def.Zero() } /* * Multi-valued type */ // MultiType is a special type used for multi-valued expressions, akin // to a tuple type. It's not generally accessible within the // language. type MultiType struct { commonType Elems []Type } var multiTypes = newTypeArrayMap() func NewMultiType(elems []Type) *MultiType { if t := multiTypes.Get(elems); t != nil { return t.(*MultiType) } t := &MultiType{commonType{}, elems} multiTypes.Put(elems, t) return t } func (t *MultiType) compat(o Type, conv bool) bool { t2, ok := o.lit().(*MultiType) if !ok { return false } if len(t.Elems) != len(t2.Elems) { return false } for i := range t.Elems { if !t.Elems[i].compat(t2.Elems[i], conv) { return false } } return true } var EmptyType Type = NewMultiType([]Type{}) func (t *MultiType) lit() Type { return t } func (t *MultiType) String() string { if len(t.Elems) == 0 { return "<none>" } return typeListString(t.Elems, nil) } func (t *MultiType) Zero() Value { res := make([]Value, len(t.Elems)) for i, t := range t.Elems { res[i] = t.Zero() } return multiV(res) } /* * Initialize the universe */ func init() { numer := big.NewInt(0xffffff) numer.Lsh(numer, 127-23) maxFloat32Val = new(big.Rat).SetInt(numer) numer.SetInt64(0x1fffffffffffff) numer.Lsh(numer, 1023-52) maxFloat64Val = new(big.Rat).SetInt(numer) minFloat32Val = new(big.Rat).Neg(maxFloat32Val) minFloat64Val = new(big.Rat).Neg(maxFloat64Val) // To avoid portability issues all numeric types are distinct // except byte, which is an alias for uint8. // Make byte an alias for the named type uint8. Type aliases // are otherwise impossible in Go, so just hack it here. universe.defs["byte"] = universe.defs["uint8"] // Built-in functions universe.DefineConst("append", universePos, appendType, nil) universe.DefineConst("cap", universePos, capType, nil) universe.DefineConst("close", universePos, closeType, nil) universe.DefineConst("closed", universePos, closedType, nil) universe.DefineConst("copy", universePos, copyType, nil) universe.DefineConst("len", universePos, lenType, nil) universe.DefineConst("make", universePos, makeType, nil) universe.DefineConst("new", universePos, newType, nil) universe.DefineConst("panic", universePos, panicType, nil) universe.DefineConst("print", universePos, printType, nil) universe.DefineConst("println", universePos, printlnType, nil) }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OD4B.Configuration.Async.Common { public class SiteModificationConfig { public string SiteUrl { get; set; } public string JSFile { get; set; } public string ThemeName { get; set; } public string ThemeColorFile { get; set; } public string ThemeFontFile { get; set; } public string ThemeBGFile { get; set; } } }
{ "pile_set_name": "Github" }
/* * Copyright 2000-2013 JetBrains s.r.o. * * 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 com.intellij.psi.codeStyle; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.JDOMExternalizable; import com.intellij.openapi.util.WriteExternalException; import com.intellij.openapi.util.text.StringUtil; import org.jdom.Element; import org.jetbrains.annotations.NonNls; import java.util.ArrayList; import java.util.List; public class PackageEntryTable implements JDOMExternalizable, Cloneable { private final List<PackageEntry> myEntries = new ArrayList<>(); public boolean equals(Object obj) { if (!(obj instanceof PackageEntryTable)) { return false; } PackageEntryTable other = (PackageEntryTable)obj; if (other.myEntries.size() != myEntries.size()) { return false; } for (int i = 0; i < myEntries.size(); i++) { PackageEntry entry = myEntries.get(i); PackageEntry otherentry = other.myEntries.get(i); if (!Comparing.equal(entry, otherentry)) { return false; } } return true; } public int hashCode() { if (!myEntries.isEmpty() && myEntries.get(0) != null) { return myEntries.get(0).hashCode(); } return 0; } @Override public Object clone() throws CloneNotSupportedException { PackageEntryTable clon = new PackageEntryTable(); clon.copyFrom(this); return clon; } public void copyFrom(PackageEntryTable packageTable) { myEntries.clear(); myEntries.addAll(packageTable.myEntries); } public PackageEntry[] getEntries() { return myEntries.toArray(new PackageEntry[0]); } public void insertEntryAt(PackageEntry entry, int i) { myEntries.add(i, entry); } public void removeEntryAt(int i) { myEntries.remove(i); } public PackageEntry getEntryAt(int i) { return myEntries.get(i); } public int getEntryCount() { return myEntries.size(); } public void setEntryAt(PackageEntry entry, int i) { myEntries.set(i, entry); } public boolean contains(String packageName) { for (PackageEntry entry : myEntries) { if (packageName.startsWith(entry.getPackageName())) { if (packageName.length() == entry.getPackageName().length()) return true; if (entry.isWithSubpackages()) { if (packageName.charAt(entry.getPackageName().length()) == '.') return true; } } } return false; } @Override public void readExternal(Element element) throws InvalidDataException { myEntries.clear(); List<Element> children = element.getChildren(); for (final Object aChildren : children) { @NonNls Element e = (Element)aChildren; @NonNls String name = e.getName(); if ("package".equals(name)) { String packageName = e.getAttributeValue("name"); boolean isStatic = Boolean.parseBoolean(e.getAttributeValue("static")); boolean withSubpackages = Boolean.parseBoolean(e.getAttributeValue("withSubpackages")); if (packageName == null) { throw new InvalidDataException(); } PackageEntry entry; if (packageName.isEmpty()) { entry = isStatic ? PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY : PackageEntry.ALL_OTHER_IMPORTS_ENTRY; } else { entry = new PackageEntry(isStatic, packageName, withSubpackages); } myEntries.add(entry); } else { if ("emptyLine".equals(name)) { myEntries.add(PackageEntry.BLANK_LINE_ENTRY); } } } } @Override public void writeExternal(Element parentNode) throws WriteExternalException { for (PackageEntry entry : myEntries) { if (entry == PackageEntry.BLANK_LINE_ENTRY) { @NonNls Element element = new Element("emptyLine"); parentNode.addContent(element); } else { @NonNls Element element = new Element("package"); parentNode.addContent(element); String packageName = entry.getPackageName(); element.setAttribute("name", entry == PackageEntry.ALL_OTHER_IMPORTS_ENTRY || entry == PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY ? "": packageName); element.setAttribute("withSubpackages", entry.isWithSubpackages() ? "true" : "false"); element.setAttribute("static", entry.isStatic() ? "true" : "false"); } } } public void removeEmptyPackages() { for(int i = myEntries.size()-1; i>=0; i--){ PackageEntry entry = myEntries.get(i); if(StringUtil.isEmptyOrSpaces(entry.getPackageName())) { removeEntryAt(i); } } } public void addEntry(PackageEntry entry) { myEntries.add(entry); } }
{ "pile_set_name": "Github" }
/* Usage: test-escape_windows_command_arg.exe This is a test program for the escape_windows_command_arg function from nbase_str.c. Its code is strictly Windows-specific. Basically, it performs escape_windows_command_arg on arrays of strings merging its results with spaces and tests if an attempt to decode them with CommandLineToArgvW results in the same strings. */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include "nbase.h" #include <shellapi.h> const char *TESTS[][5] = { { NULL }, {"", NULL}, {"", "", NULL}, {"1", "2", "3", "4", NULL}, {"a", "b", "c", NULL}, {"a b", "c", NULL}, {"a b c", NULL}, {" a b c ", NULL}, {"\"quote\"", NULL}, {"back\\slash", NULL}, {"backslash at end\\", NULL}, {"double\"\"quote", NULL}, {" a\nb\tc\rd\ne", NULL}, {"..\\test\\toupper.lua", NULL}, {"backslash at end\\", "som\\ething\"af\\te\\r", NULL}, {"three\\\\\\backslashes", "som\\ething\"af\\te\\r", NULL}, {"three\"\"\"quotes", "som\\ething\"af\\te\\r", NULL}, }; static LPWSTR utf8_to_wchar(const char *s) { LPWSTR result; int size, ret; /* Get needed buffer size. */ size = MultiByteToWideChar(CP_UTF8, 0, s, -1, NULL, 0); if (size == 0) { fprintf(stderr, "MultiByteToWideChar 1 failed: %d\n", GetLastError()); exit(1); } result = (LPWSTR) malloc(sizeof(*result) * size); ret = MultiByteToWideChar(CP_UTF8, 0, s, -1, result, size); if (ret == 0) { fprintf(stderr, "MultiByteToWideChar 2 failed: %d\n", GetLastError()); exit(1); } return result; } static char *wchar_to_utf8(const LPWSTR s) { char *result; int size, ret; /* Get needed buffer size. */ size = WideCharToMultiByte(CP_UTF8, 0, s, -1, NULL, 0, NULL, NULL); if (size == 0) { fprintf(stderr, "WideCharToMultiByte 1 failed: %d\n", GetLastError()); exit(1); } result = (char *) malloc(size); ret = WideCharToMultiByte(CP_UTF8, 0, s, -1, result, size, NULL, NULL); if (ret == 0) { fprintf(stderr, "WideCharToMultiByte 2 failed: %d\n", GetLastError()); exit(1); } return result; } static char **wchar_to_utf8_array(const LPWSTR a[], unsigned int len) { char **result; unsigned int i; result = (char **) malloc(sizeof(*result) * len); if (result == NULL) return NULL; for (i = 0; i < len; i++) result[i] = wchar_to_utf8(a[i]); return result; } static unsigned int nullarray_length(const char *a[]) { unsigned int i; for (i = 0; a[i] != NULL; i++) ; return i; } static char *append(char *p, const char *s) { size_t plen, slen; plen = strlen(p); slen = strlen(s); p = (char *) realloc(p, plen + slen + 1); if (p == NULL) return NULL; return strncat(p, s, plen+slen); } /* Turns an array of strings into an escaped flat command line. */ static LPWSTR build_commandline(const char *args[], unsigned int len) { unsigned int i; char *result; result = strdup("progname"); for (i = 0; i < len; i++) { result = append(result, " "); result = append(result, escape_windows_command_arg(args[i])); } return utf8_to_wchar(result); } static int arrays_equal(const char **a, unsigned int alen, const char **b, unsigned int blen) { unsigned int i; if (alen != blen) return 0; for (i = 0; i < alen; i++) { if (strcmp(a[i], b[i]) != 0) return 0; } return 1; } static char *format_array(const char **args, unsigned int len) { char *result; unsigned int i; result = strdup(""); result = append(result, "{"); for (i = 0; i < len; i++) { if (i > 0) result = append(result, ", "); result = append(result, "["); result = append(result, args[i]); result = append(result, "]"); } result = append(result, "}"); return result; } static int run_test(const char *args[]) { LPWSTR *argvw; char **result; int args_len, argvw_len, result_len; args_len = nullarray_length(args); argvw = CommandLineToArgvW(build_commandline(args, args_len), &argvw_len); /* Account for added argv[0] in argvw. */ result = wchar_to_utf8_array(argvw+1, argvw_len-1); result_len = argvw_len - 1; if (arrays_equal((const char **) result, result_len, args, args_len)) { printf("PASS %s\n", format_array(args, args_len)); return 1; } else { printf("FAIL got %s\n", format_array((const char **) result, result_len)); printf("expected %s\n", format_array(args, args_len)); return 0; } } int main(int argc, char *argv[]) { unsigned int num_tests, num_passed; unsigned int i; num_tests = 0; num_passed = 0; for (i = 0; i < sizeof(TESTS) / sizeof(*TESTS); i++) { num_tests++; if (run_test(TESTS[i])) num_passed++; } printf("%ld / %ld tests passed.\n", num_passed, num_tests); return num_passed == num_tests ? 0 : 1; }
{ "pile_set_name": "Github" }
/* Visual Studio-like style based on original C# coloring by Jason Diamond <[email protected]> */ .hljs { display: block; overflow-x: auto; padding: 0.5em; background: white; color: black; } .hljs-comment, .hljs-annotation, .hljs-template_comment, .diff .hljs-header, .hljs-chunk, .apache .hljs-cbracket { color: #008000; } .hljs-keyword, .hljs-id, .hljs-built_in,.css .smalltalk .hljs-class, .hljs-winutils, .bash .hljs-variable, .tex .hljs-command, .hljs-request, .hljs-status, .nginx .hljs-title, .xml .hljs-tag, .xml .hljs-tag .hljs-value { color: #00f; } .hljs-string, .hljs-title, .hljs-parent, .hljs-tag .hljs-value, .hljs-rules .hljs-value, .ruby .hljs-symbol, .ruby .hljs-symbol .hljs-string, .hljs-template_tag, .django .hljs-variable, .hljs-addition, .hljs-flow, .hljs-stream, .apache .hljs-tag, .hljs-date, .tex .hljs-formula, .coffeescript .hljs-attribute { color: #a31515; } .ruby .hljs-string, .hljs-decorator, .hljs-filter .hljs-argument, .hljs-localvars, .hljs-array, .hljs-attr_selector, .hljs-pseudo, .hljs-pi, .hljs-doctype, .hljs-deletion, .hljs-envvar, .hljs-shebang, .hljs-preprocessor, .hljs-pragma, .userType, .apache .hljs-sqbracket, .nginx .hljs-built_in, .tex .hljs-special, .hljs-prompt { color: #2b91af; } .hljs-phpdoc, .hljs-javadoc, .hljs-xmlDocTag { color: #808080; } .vhdl .hljs-typename { font-weight: bold; } .vhdl .hljs-string { color: #666666; } .vhdl .hljs-literal { color: #a31515; } .vhdl .hljs-attribute { color: #00b0e8; } .xml .hljs-attribute { color: #f00; }
{ "pile_set_name": "Github" }
<?php /** * Webiny Framework (http://www.webiny.com/framework) * * @copyright Copyright Webiny LTD */ namespace Webiny\Component\Entity; use Webiny\Component\StdLib\Exception\AbstractException; use Webiny\Component\StdLib\StdObject\StdObjectWrapper; /** * Exception class for the Entity component. * * @package Webiny\Component\Entity */ class EntityException extends AbstractException { const VALIDATION_FAILED = 101; const ENTITY_DELETION_RESTRICTED = 102; const NO_MATCHING_MANY2MANY_ATTRIBUTE_FOUND = 103; const ATTRIBUTE_NOT_FOUND = 104; const INVALID_MANY2MANY_VALUE = 105; const INVALID_ONE2MANY_VALUE = 106; protected $invalidAttributes = []; protected static $messages = [ 101 => "Validation of '%s' failed with '%s' errors.", 102 => "Entity is linked with other entities via '%s' attribute and can not be deleted.", 103 => "No matching Many2Many attribute was found between entities '%s' and '%s' for attribute '%s'.", 104 => "AttributeType '%s' was not found in '%s' entity.", 105 => "Many2Many attribute '%s' expects '%s', instance of '%s' given.", 106 => "One2Many attribute '%s' expects an instance of '%s', instance of '%s' given.", ]; public function setInvalidAttributes($attributes) { $this->invalidAttributes = StdObjectWrapper::toArray($attributes); return $this; } /** * Get array of invalid attributes and validation exceptions * Array structure: * * <code> * ['attrName' => ValidationException] * </code> * * @return array */ public function getInvalidAttributes() { return $this->invalidAttributes; } }
{ "pile_set_name": "Github" }
// // UIRefreshControl+Rx.swift // RxCocoa // // Created by Yosuke Ishikawa on 1/31/16. // Copyright © 2016 Krunoslav Zaher. All rights reserved. // #if os(iOS) import UIKit #if !RX_NO_MODULE import RxSwift #endif extension Reactive where Base: UIRefreshControl { /// Bindable sink for `beginRefreshing()`, `endRefreshing()` methods. @available(*, deprecated, renamed: "isRefreshing") public var refreshing: UIBindingObserver<Base, Bool> { return self.isRefreshing } /// Bindable sink for `beginRefreshing()`, `endRefreshing()` methods. public var isRefreshing: UIBindingObserver<Base, Bool> { return UIBindingObserver(UIElement: self.base) { refreshControl, refresh in if refresh { refreshControl.beginRefreshing() } else { refreshControl.endRefreshing() } } } } #endif
{ "pile_set_name": "Github" }
{ "images" : [ { "size" : "16x16", "idiom" : "mac", "filename" : "icon-10 (dragged).png", "scale" : "1x" }, { "size" : "16x16", "idiom" : "mac", "filename" : "icon-9 (dragged).png", "scale" : "2x" }, { "size" : "32x32", "idiom" : "mac", "filename" : "icon-8 (dragged).png", "scale" : "1x" }, { "size" : "32x32", "idiom" : "mac", "filename" : "icon-7 (dragged).png", "scale" : "2x" }, { "size" : "128x128", "idiom" : "mac", "filename" : "icon-6 (dragged).png", "scale" : "1x" }, { "size" : "128x128", "idiom" : "mac", "filename" : "icon-5 (dragged).png", "scale" : "2x" }, { "size" : "256x256", "idiom" : "mac", "filename" : "icon-4 (dragged).png", "scale" : "1x" }, { "size" : "256x256", "idiom" : "mac", "filename" : "icon-3 (dragged).png", "scale" : "2x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "icon-2 (dragged).png", "scale" : "1x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "icon-1 (dragged).png", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
// // AppDelegate.swift // StoryBoard教程第一季 // // Created by aiteyuan on 15/1/29. // Copyright (c) 2015年 黄成都. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
{ "pile_set_name": "Github" }
/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.as.remoting; import java.net.InetSocketAddress; import java.util.function.Consumer; import java.util.function.Supplier; import org.jboss.as.domain.management.SecurityRealm; import org.jboss.as.network.ManagedBinding; import org.jboss.as.network.NetworkInterfaceBinding; import org.jboss.as.network.SocketBindingManager; import org.jboss.remoting3.Endpoint; import org.wildfly.security.auth.server.SaslAuthenticationFactory; import org.xnio.OptionMap; import org.xnio.StreamConnection; import org.xnio.channels.AcceptingChannel; import javax.net.ssl.SSLContext; /** * {@link AbstractStreamServerService} that uses an injected network interface binding service. * * @author <a href="[email protected]">Kabir Khan</a> * @author <a href="mailto:[email protected]">Richard Opalka</a> */ final class InjectedNetworkBindingStreamServerService extends AbstractStreamServerService { private final Supplier<NetworkInterfaceBinding> interfaceBindingSupplier; private final int port; InjectedNetworkBindingStreamServerService( final Consumer<AcceptingChannel<StreamConnection>> streamServerConsumer, final Supplier<Endpoint> endpointSupplier, final Supplier<SecurityRealm> securityRealmSupplier, final Supplier<SaslAuthenticationFactory> saslAuthenticationFactorySupplier, final Supplier<SSLContext> sslContextSupplier, final Supplier<SocketBindingManager> socketBindingManagerSupplier, final Supplier<NetworkInterfaceBinding> interfaceBindingSupplier, final OptionMap connectorPropertiesOptionMap, int port) { super(streamServerConsumer, endpointSupplier, securityRealmSupplier, saslAuthenticationFactorySupplier, sslContextSupplier, socketBindingManagerSupplier, connectorPropertiesOptionMap); this.interfaceBindingSupplier = interfaceBindingSupplier; this.port = port; } @Override InetSocketAddress getSocketAddress() { return new InetSocketAddress(interfaceBindingSupplier.get().getAddress(), port); } @Override ManagedBinding registerSocketBinding(SocketBindingManager socketBindingManager) { InetSocketAddress address = new InetSocketAddress(interfaceBindingSupplier.get().getAddress(), port); ManagedBinding binding = ManagedBinding.Factory.createSimpleManagedBinding("management-native", address, null); socketBindingManager.getUnnamedRegistry().registerBinding(binding); return binding; } @Override void unregisterSocketBinding(ManagedBinding managedBinding, SocketBindingManager socketBindingManager) { socketBindingManager.getUnnamedRegistry().unregisterBinding(managedBinding); } }
{ "pile_set_name": "Github" }
# Copyright 2018-2019 The glTF-Blender-IO authors. # # 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. import bpy from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.io.com.gltf2_io_debug import print_console from io_scene_gltf2.blender.exp import gltf2_blender_gather_nodes from io_scene_gltf2.blender.exp import gltf2_blender_gather_animations from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached from io_scene_gltf2.blender.exp import gltf2_blender_generate_extras from io_scene_gltf2.blender.exp import gltf2_blender_export_keys def gather_gltf2(export_settings): """ Gather glTF properties from the current state of blender. :return: list of scene graphs to be added to the glTF export """ scenes = [] animations = [] # unfortunately animations in gltf2 are just as 'root' as scenes. active_scene = None for blender_scene in bpy.data.scenes: scenes.append(__gather_scene(blender_scene, export_settings)) if export_settings[gltf2_blender_export_keys.ANIMATIONS]: animations += __gather_animations(blender_scene, export_settings) if bpy.context.scene.name == blender_scene.name: active_scene = len(scenes) -1 return active_scene, scenes, animations @cached def __gather_scene(blender_scene, export_settings): scene = gltf2_io.Scene( extensions=None, extras=__gather_extras(blender_scene, export_settings), name=blender_scene.name, nodes=[] ) for blender_object in blender_scene.objects: if blender_object.parent is None: node = gltf2_blender_gather_nodes.gather_node(blender_object, blender_scene, export_settings) if node is not None: scene.nodes.append(node) return scene def __gather_animations(blender_scene, export_settings): animations = [] merged_tracks = {} for blender_object in blender_scene.objects: # First check if this object is exported or not. Do not export animation of not exported object obj_node = gltf2_blender_gather_nodes.gather_node(blender_object, blender_scene, export_settings) if obj_node is not None: animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(blender_object, merged_tracks, len(animations), export_settings) animations += animations_ if export_settings['gltf_nla_strips'] is False: # Fake an animation with all animations of the scene merged_tracks = {} merged_tracks['Animation'] = [] for idx, animation in enumerate(animations): merged_tracks['Animation'].append(idx) to_delete_idx = [] for merged_anim_track in merged_tracks.keys(): if len(merged_tracks[merged_anim_track]) < 2: continue base_animation_idx = None offset_sampler = 0 for idx, anim_idx in enumerate(merged_tracks[merged_anim_track]): if idx == 0: base_animation_idx = anim_idx animations[anim_idx].name = merged_anim_track already_animated = [] for channel in animations[anim_idx].channels: already_animated.append((channel.target.node, channel.target.path)) continue to_delete_idx.append(anim_idx) offset_sampler = len(animations[base_animation_idx].samplers) for sampler in animations[anim_idx].samplers: animations[base_animation_idx].samplers.append(sampler) for channel in animations[anim_idx].channels: if (channel.target.node, channel.target.path) in already_animated: print_console("WARNING", "Some strips have same channel animation ({}), on node {} !".format(channel.target.path, channel.target.node.name)) continue animations[base_animation_idx].channels.append(channel) animations[base_animation_idx].channels[-1].sampler = animations[base_animation_idx].channels[-1].sampler + offset_sampler already_animated.append((channel.target.node, channel.target.path)) new_animations = [] if len(to_delete_idx) != 0: for idx, animation in enumerate(animations): if idx in to_delete_idx: continue new_animations.append(animation) else: new_animations = animations return new_animations def __gather_extras(blender_object, export_settings): if export_settings[gltf2_blender_export_keys.EXTRAS]: return gltf2_blender_generate_extras.generate_extras(blender_object) return None
{ "pile_set_name": "Github" }
<% wrap_layout :inner do %> <% content_for :sidebar do %> <div class="docs-sidebar hidden-print affix-top" role="complementary"> <a href="#" class="subnav-toggle">(Expand/collapse all)</a> <ul class="nav docs-sidenav"> <li> <a href="/docs/providers/index.html">All Providers</a> </li> <li> <a href="/docs/providers/kafka/index.html">Kafka Provider</a> </li> <li> <a href="#">Provider Resources</a> <ul class="nav"> <li> <a href="/docs/providers/kafka/r/acl.html">kafka_acl</a> </li> <li> <a href="/docs/providers/kafka/r/topic.html">kafka_topic</a> </li> </ul> </li> </ul> </div> <% end %> <%= yield %> <% end %>
{ "pile_set_name": "Github" }
# pip3 install -U -r requirements.txt numpy opencv-python torch >= 1.2 matplotlib pycocotools tqdm tb-nightly future Pillow # Equivalent conda commands ---------------------------------------------------- # conda update -n base -c defaults conda # conda install -yc anaconda future numpy opencv matplotlib tqdm pillow # conda install -yc conda-forge scikit-image tensorboard pycocotools # conda install -yc spyder-ide spyder-line-profiler # conda install -yc pytorch pytorch torchvision
{ "pile_set_name": "Github" }
#![deny(warnings)] extern crate proc_macro; extern crate syn; #[macro_use] extern crate quote; use proc_macro::TokenStream; use syn::MetaItem::*; #[proc_macro_derive(IsDao)] pub fn is_dao(input: TokenStream) -> TokenStream { // Construct a string representation of the type definition let s = input.to_string(); // Parse the string representation let ast = syn::parse_macro_input(&s).unwrap(); // Build the impl let gen = impl_is_dao(&ast); // Return the generated impl gen.parse().unwrap() } fn impl_is_dao(ast: &syn::MacroInput) -> quote::Tokens { let name = &ast.ident; let fields:Vec<(&syn::Ident, &syn::Ty)> = match ast.body { syn::Body::Struct(ref data) => { match *data{ syn::VariantData::Struct(ref fields) => { fields.iter().map(|f| { let ident = f.ident.as_ref().unwrap(); let ty = &f.ty; (ident,ty) }).collect::<Vec<_>>() }, _ => panic!("tuples and unit are not covered") } }, syn::Body::Enum(_) => panic!("#[derive(NumFields)] can only be used with structs"), }; let from_fields:Vec<quote::Tokens> = fields.iter().map(|&(field,_ty)| { quote!{ #field: { let v = dao.get(stringify!(#field)).unwrap(); FromValue::from_type(v.to_owned()) }, } }).collect::<Vec<_>>(); let to_dao:Vec<quote::Tokens> = fields.iter().map(|&(field,_ty)| { quote!{ dao.insert(stringify!(#field).to_string(), self.#field.to_db_type()); } }).collect::<Vec<_>>(); quote! { impl IsDao for #name { fn from_dao(dao: &Dao) -> Self{ #name{ #(#from_fields)* } } fn to_dao(&self) -> Dao { let mut dao = Dao::new(); #(#to_dao)* dao } } } } #[proc_macro_derive(IsTable)] pub fn to_table_name(input: TokenStream) -> TokenStream { // Construct a string representation of the type definition let s = input.to_string(); // Parse the string representation let ast = syn::parse_macro_input(&s).unwrap(); // Build the impl let gen = impl_to_table_name(&ast); // Return the generated impl gen.parse().unwrap() } fn get_table_attr(attrs: &Vec<syn::Attribute>)->Option<String>{ for att in attrs{ println!("{:?}", att); match att.value{ Word(_) => continue, List(_,_) => continue, NameValue(ref name, ref value) => { if name == "table"{ match *value{ syn::Lit::Str(ref s,ref _style) => { return Some(s.to_owned()) } _ => continue } }else{continue} } }; } None } fn impl_to_table_name(ast: &syn::MacroInput) -> quote::Tokens { let name = &ast.ident; let attrs = &ast.attrs; let tbl = get_table_attr(attrs); let table_name = match tbl{ Some(tbl) => tbl, None => format!("{}",name).to_lowercase() }; let fields:Vec<&syn::Ident> = match ast.body { syn::Body::Struct(ref data) => { match *data{ syn::VariantData::Struct(ref fields) => { fields.iter().map(|f| { let ident = f.ident.as_ref().unwrap(); let _ty = &f.ty; ident }).collect::<Vec<_>>() }, _ => panic!("tuples and unit are not covered") } }, syn::Body::Enum(_) => panic!("#[derive(NumFields)] can only be used with structs"), }; let from_fields:Vec<quote::Tokens> = fields.iter().map(|field| { quote!{ ColumnName{ column: stringify!(#field).to_string(), table: Some(#table_name.to_string()), schema: None } } }).collect::<Vec<_>>(); quote! { impl IsTable for #name { fn table_name() -> TableName{ TableName{ schema: None, name: #table_name.to_string(), columns: vec![#(#from_fields),*], } } } } }
{ "pile_set_name": "Github" }
package org.protege.editor.owl.ui.view; import org.protege.editor.core.ProtegeProperties; import org.protege.editor.core.ui.RefreshableComponent; import org.protege.editor.core.ui.view.ViewComponentPlugin; import org.protege.editor.core.util.HandlerRegistration; import org.protege.editor.owl.model.event.EventType; import org.protege.editor.owl.model.event.OWLModelManagerChangeEvent; import org.protege.editor.owl.model.event.OWLModelManagerListener; import org.protege.editor.owl.model.selection.OWLSelectionModelListener; import org.protege.editor.owl.model.selection.SelectionDriver; import org.protege.editor.owl.model.selection.SelectionPlane; import org.protege.editor.owl.ui.renderer.OWLEntityRendererListener; import org.protege.editor.owl.ui.renderer.OWLModelManagerEntityRenderer; import org.protege.editor.owl.ui.renderer.RenderingEscapeUtils; import org.semanticweb.owlapi.model.*; import org.semanticweb.owlapi.util.EscapeUtils; import javax.swing.*; import java.awt.event.HierarchyEvent; import java.awt.event.HierarchyListener; import java.util.HashSet; import java.util.Optional; import java.util.Set; import static org.protege.editor.owl.ui.renderer.RenderingEscapeUtils.RenderingEscapeSetting.UNESCAPED_RENDERING; /** * Author: Matthew Horridge<br> * The University Of Manchester<br> * Medical Informatics Group<br> * Date: Apr 8, 2006<br><br> * [email protected]<br> * www.cs.man.ac.uk/~horridgm<br><br> * A view that has a notion of a selected <code>OWLObject</code> */ public abstract class AbstractOWLSelectionViewComponent extends AbstractOWLViewComponent implements RefreshableComponent { private OWLSelectionModelListener listener; private Set<OWLSelectionViewAction> registeredActions; private boolean initialUpdatePerformed; private OWLModelManagerListener modelManagerListener; private OWLObject lastDisplayedObject; private OWLEntityRendererListener entityRendererListener; private HierarchyListener hierarchyListener; private boolean needsRefresh; /** * The initialise method is called at the start of a * plugin instance life cycle. * This method is called to give the plugin a chance * to intitialise itself. All plugin initialisation * should be done in this method rather than the plugin * constructor, since the initialisation might need to * occur at a point after plugin instance creation, and * a each plugin must have a zero argument constructor. */ final public void initialiseOWLView() throws Exception { registeredActions = new HashSet<>(); listener = () -> { final OWLObject owlObject = getOWLWorkspace().getOWLSelectionModel().getSelectedObject(); if (owlObject instanceof OWLEntity){ if (canShowEntity((OWLEntity)owlObject)){ updateViewContentAndHeader(); } } }; entityRendererListener = (entity, renderer) -> { if (lastDisplayedObject != null) { if (lastDisplayedObject.equals(entity)) { updateHeader(lastDisplayedObject); } } }; hierarchyListener = e -> { if (needsRefresh && isShowing()) { updateViewContentAndHeader(); } }; modelManagerListener = event -> { if (event.isType(EventType.ENTITY_RENDERER_CHANGED)) { getOWLModelManager().getOWLEntityRenderer().addListener(entityRendererListener); } }; addHierarchyListener(hierarchyListener); getOWLModelManager().addListener(modelManagerListener); getOWLModelManager().getOWLEntityRenderer().addListener(entityRendererListener); getOWLWorkspace().getOWLSelectionModel().addListener(listener); initialiseView(); updateViewContentAndHeader(); if(this instanceof SelectionDriver) { getSelectionPlane().ifPresent(plane -> { HandlerRegistration registration = plane.registerSelectionDriver((SelectionDriver) this); addHandlerRegistration(registration); }); } } private Optional<SelectionPlane> getSelectionPlane() { return Optional.ofNullable((SelectionPlane) SwingUtilities.getAncestorOfClass(SelectionPlane.class, this)); } public void refreshComponent() { updateHeader(lastDisplayedObject); } /** * A convenience method that sets the specified entity to be the * selected entity in the <code>OWLSelectionModel</code>. */ protected void setGlobalSelection(OWLEntity owlEntity) { if (getView() != null) { if (getView().isSyncronizing()) { if(this instanceof SelectionDriver) { getSelectionPlane().ifPresent(d -> d.transmitSelection((SelectionDriver) this, owlEntity)); } else { getOWLWorkspace().getOWLSelectionModel().setSelectedEntity(owlEntity); } } } } protected void registerSelectionAction(OWLSelectionViewAction action) { registeredActions.add(action); } protected void addAction(OWLSelectionViewAction action, String group, String groupIndex) { registerSelectionAction(action); super.addAction(action, group, groupIndex); } public abstract void initialiseView() throws Exception; /** * This method is called at the end of a plugin * life cycle, when the plugin needs to be removed * from the system. Plugins should remove any listeners * that they setup and perform other cleanup, so that * the plugin can be garbage collected. */ public final void disposeOWLView() { registeredActions.clear(); if (listener != null) { getOWLWorkspace().getOWLSelectionModel().removeListener(listener); } removeHierarchyListener(hierarchyListener); getOWLModelManager().removeListener(modelManagerListener); getOWLModelManager().getOWLEntityRenderer().removeListener(entityRendererListener); disposeView(); } public abstract void disposeView(); protected void disableRegisteredActions() { for (OWLSelectionViewAction action : registeredActions) { action.setEnabled(false); } } protected void updateRegisteredActions() { for (OWLSelectionViewAction action : registeredActions) { action.updateState(); } } protected void updateViewContentAndHeader() { if (!isShowing()) { needsRefresh = true; return; } needsRefresh = false; if (isPinned() && initialUpdatePerformed) { return; } initialUpdatePerformed = true; if (isSynchronizing()){ lastDisplayedObject = updateView(); updateHeader(lastDisplayedObject); } } protected void updateHeader(OWLObject object) { // Set the label in the header to reflect the entity that the view // is displaying if (object != null) { updateRegisteredActions(); String rendering = getOWLModelManager().getDisabmiguatedRendering(object, UNESCAPED_RENDERING); getView().setHeaderText(rendering); } else { // Not displaying an entity, so disable all actions disableRegisteredActions(); getView().setHeaderText(""); } } /** * Request that the view is updated to display the current selection. * @return The OWLEntity that the view is displaying. This * list is typically used to generate the view header text to give the * user an indication of what the view is displaying. */ protected abstract OWLObject updateView(); protected boolean isOWLClassView() { return canNavigate(ProtegeProperties.CLASS_VIEW_CATEGORY); } protected boolean isOWLObjectPropertyView() { return canNavigate(ProtegeProperties.OBJECT_PROPERTY_VIEW_CATEGORY); } protected boolean isOWLDataPropertyView() { return canNavigate(ProtegeProperties.DATA_PROPERTY_VIEW_CATEGORY); } protected boolean isOWLIndividualView() { return canNavigate(ProtegeProperties.INDIVIDUAL_VIEW_CATEGORY); } protected boolean isOWLAnnotationPropertyView() { return canNavigate(ProtegeProperties.ANNOTATION_PROPERTY_VIEW_CATEGORY); } protected boolean isOWLDatatypeView() { return canNavigate(ProtegeProperties.DATATYPE_VIEW_CATEGORY); } // by default, asks the plugin whether the entity can be displayed private boolean canNavigate(String type){ ViewComponentPlugin plugin = getWorkspace().getViewManager().getViewComponentPlugin(getView().getId()); return plugin != null && plugin.getNavigates().contains(ProtegeProperties.getInstance().getProperty(type)); } public final boolean canShowEntity(OWLEntity owlEntity){ return owlEntity != null && new AcceptableEntityVisitor().canShowEntity(owlEntity); } class AcceptableEntityVisitor implements OWLEntityVisitor { boolean result; public boolean canShowEntity(OWLEntity owlEntity){ result = false; owlEntity.accept(this); return result; } public void visit(OWLClass owlClass) { result = isOWLClassView(); } public void visit(OWLObjectProperty owlObjectProperty) { result = isOWLObjectPropertyView(); } public void visit(OWLDataProperty owlDataProperty) { result = isOWLDataPropertyView(); } public void visit(OWLNamedIndividual owlIndividual) { result = isOWLIndividualView(); } public void visit(OWLDatatype owlDatatype) { result = isOWLDatatypeView(); } public void visit(OWLAnnotationProperty owlAnnotationProperty) { result = isOWLAnnotationPropertyView(); } } }
{ "pile_set_name": "Github" }
class ActionDealDamage extends Action; var() editcombotype(enumScriptLabels) Name target; var() float damageAmount; // execute latent function Variable execute() { local Actor a; Super.execute(); ForEach parentScript.actorLabel(class'Actor', a, target) { a.TakeDamage(damageAmount, None, vect(0.0, 0.0, 0.0), vect(0.0, 0.0, 0.0), class'GenericDamageType'); } return None; } // editorDisplayString function editorDisplayString(out string s) { s = "Deal " $ propertyDisplayString('damageAmount') $ " points of damage to " $ propertyDisplayString('target'); } defaultproperties { returnType = None actionDisplayName = "Deal Damage" actionHelp = "Deals damage to target actors" category = "Actor" }
{ "pile_set_name": "Github" }
/* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. */ mat-list-item { border-bottom: 1px solid #d9d9d9; height: auto!important; padding: 5px!important; } .mat-list-text h3{ font-size: 0.85em; color: #000000; } .mat-list-text span{ font-size: 0.8em; color: #999999; } .item-custom { padding: 15px 0 15px 0; } .no-directions-alert { font-style: italic; font-size: 0.9em; padding: 0 0 0 10px; } ::ng-deep .mat-tab-label, ::ng-deep.mat-tab-label-active{ min-width: 100px!important; padding: 0 10px!important; } ::ng-deep .mat-tab-body-content { overflow: hidden!important; }
{ "pile_set_name": "Github" }
{ "author": { "name": "Mikeal Rogers", "email": "[email protected]", "url": "http://www.futurealoof.com" }, "name": "aws-sign2", "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", "version": "0.5.0", "repository": { "url": "https://github.com/mikeal/aws-sign" }, "main": "index.js", "dependencies": {}, "devDependencies": {}, "optionalDependencies": {}, "engines": { "node": "*" }, "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/mikeal/aws-sign/issues" }, "homepage": "https://github.com/mikeal/aws-sign", "_id": "[email protected]", "_from": "aws-sign2@~0.5.0" }
{ "pile_set_name": "Github" }
package de.metas.dlm.model.interceptor; import org.adempiere.ad.modelvalidator.AbstractModuleInterceptor; import de.metas.dlm.IDLMService; import de.metas.dlm.swingui.PreferenceCustomizer; import de.metas.util.Services; /* * #%L * metasfresh-dlm * %% * Copyright (C) 2016 metas GmbH * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-2.0.html>. * #L% */ /** * DLM SwingUI module activator. * * This class will be loaded only if running with {@link org.compiere.Adempiere.RunMode#SWING_CLIENT} run mode. * * NOTE: for this it's important to keep the name (incl. package name!) in sync with {@link de.metas.dlm.model.interceptor.Main} and also to keep the suffix {@code _SwingUI}. * * @author metas-dev <[email protected]> */ public class Main_SwingUI extends AbstractModuleInterceptor { @Override public void onUserLogin(final int AD_Org_ID, final int AD_Role_ID, final int AD_User_ID) { // gh #1411: only add the connection customizer settings to the preferences window if it was enabled. final IDLMService dlmService = Services.get(IDLMService.class); if (dlmService.isConnectionCustomizerEnabled(AD_User_ID)) { PreferenceCustomizer.customizePrefernces(); // gh #975 } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IDEDidComputeMac32BitWarning</key> <true/> </dict> </plist>
{ "pile_set_name": "Github" }
/** * This code is a version of ORB from OpenCV but * modified by ORB_SLAM2 project to use an OcTree on * keypoint detection. This code is licensed under GPLv3 and BSD licenses. * If you cannot comply to those licenses, please set WITH_ORB_OCTREE=OFF * when building RTAB-Map so that it is not included in the compiled binary. */ /** * This file is part of ORB-SLAM2. * * Copyright (C) 2014-2016 Raúl Mur-Artal <raulmur at unizar dot es> (University of Zaragoza) * For more information see <https://github.com/raulmur/ORB_SLAM2> * * ORB-SLAM2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ORB-SLAM2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ORB-SLAM2. If not, see <http://www.gnu.org/licenses/>. */ #ifndef RTABMAP_ORBEXTRACTOR_H #define RTABMAP_ORBEXTRACTOR_H #include <vector> #include <list> #include <opencv2/core/core_c.h> namespace rtabmap { class ExtractorNode { public: ExtractorNode():bNoMore(false){} void DivideNode(ExtractorNode &n1, ExtractorNode &n2, ExtractorNode &n3, ExtractorNode &n4); std::vector<cv::KeyPoint> vKeys; cv::Point2i UL, UR, BL, BR; std::list<ExtractorNode>::iterator lit; bool bNoMore; }; class ORBextractor { public: enum {HARRIS_SCORE=0, FAST_SCORE=1 }; ORBextractor(int nfeatures, float scaleFactor, int nlevels, int iniThFAST, int minThFAST); ~ORBextractor(){} // Compute the ORB features and descriptors on an image. // ORB are dispersed on the image using an octree. // Mask is ignored in the current implementation. void operator()( cv::InputArray image, cv::InputArray mask, std::vector<cv::KeyPoint>& keypoints, cv::OutputArray descriptors); int inline GetLevels(){ return nlevels;} float inline GetScaleFactor(){ return scaleFactor;} std::vector<float> inline GetScaleFactors(){ return mvScaleFactor; } std::vector<float> inline GetInverseScaleFactors(){ return mvInvScaleFactor; } std::vector<float> inline GetScaleSigmaSquares(){ return mvLevelSigma2; } std::vector<float> inline GetInverseScaleSigmaSquares(){ return mvInvLevelSigma2; } std::vector<cv::Mat> mvImagePyramid; protected: void ComputePyramid(cv::Mat image); void ComputeKeyPointsOctTree(std::vector<std::vector<cv::KeyPoint> >& allKeypoints); std::vector<cv::KeyPoint> DistributeOctTree(const std::vector<cv::KeyPoint>& vToDistributeKeys, const int &minX, const int &maxX, const int &minY, const int &maxY, const int &nFeatures, const int &level); void ComputeKeyPointsOld(std::vector<std::vector<cv::KeyPoint> >& allKeypoints); std::vector<cv::Point> pattern; int nfeatures; double scaleFactor; int nlevels; int iniThFAST; int minThFAST; std::vector<int> mnFeaturesPerLevel; std::vector<int> umax; std::vector<float> mvScaleFactor; std::vector<float> mvInvScaleFactor; std::vector<float> mvLevelSigma2; std::vector<float> mvInvLevelSigma2; }; } //namespace rtabmap #endif
{ "pile_set_name": "Github" }
const onlytests = []; const tests = []; // In all tests, the canvas is 600 by 600 px. // tests should NOT call ctx.surface.flush() // flush is done by benchmark.js function randomColorTwo(CanvasKit, i, j) { c = [1, 1, 1, 1]; c[i] = Math.random(); c[j] = Math.random(); return CanvasKit.Color4f(...c); } function randomColor(CanvasKit) { return CanvasKit.Color4f(Math.random(), Math.random(), Math.random(), Math.random()); } function starPath(CanvasKit, X=128, Y=128, R=116) { const p = new CanvasKit.SkPath(); p.moveTo(X + R, Y); for (let i = 1; i < 8; i++) { let a = 2.6927937 * i; p.lineTo(X + R * Math.cos(a), Y + R * Math.sin(a)); } p.close(); return p; } tests.push({ description: 'Draw 10K colored rect clips', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); }, test: function(CanvasKit, ctx) { // Draw a lot of colored squares. for (let i=0; i<10000; i++) { const x = Math.random()*550; const y = Math.random()*550; ctx.canvas.save(); ctx.canvas.clipRect(CanvasKit.LTRBRect(x, y, x+50, y+50), CanvasKit.ClipOp.Intersect, false); ctx.canvas.drawColor(randomColorTwo(CanvasKit, 0, 1), CanvasKit.BlendMode.SrcOver); ctx.canvas.restore(); } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'canvas_drawColor', }); tests.push({ description: 'Draw 10K colored ellipses', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.paint.setAntiAlias(true); ctx.paint.setStyle(CanvasKit.PaintStyle.Fill); }, test: function(CanvasKit, ctx) { for (let i=0; i<10000; i++) { const x = Math.random()*550; const y = Math.random()*550; ctx.paint.setColor(randomColorTwo(CanvasKit, 1, 2)); ctx.canvas.drawOval(CanvasKit.LTRBRect(x, y, x+50, y+50), ctx.paint); } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); }, perfKey: 'canvas_drawOval', }); tests.push({ description: 'Draw 10K colored roundRects', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.paint.setAntiAlias(true); ctx.paint.setStyle(CanvasKit.PaintStyle.Fill); }, test: function(CanvasKit, ctx) { for (let i=0; i<10000; i++) { const x = Math.random()*550; const y = Math.random()*550; ctx.paint.setColor(randomColorTwo(CanvasKit, 0, 2)); const rr = CanvasKit.RRectXY(CanvasKit.LTRBRect(x, y, x+50, y+50), 10, 10,); ctx.canvas.drawRRect(rr, ctx.paint); } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); }, perfKey: 'canvas_drawRRect', }); tests.push({ description: 'Draw 10K colored rects', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.paint.setAntiAlias(true); ctx.paint.setStyle(CanvasKit.PaintStyle.Fill); }, test: function(CanvasKit, ctx) { for (let i=0; i<10000; i++) { const x = Math.random()*550; const y = Math.random()*550; ctx.paint.setColor(randomColorTwo(CanvasKit, 1, 2)); ctx.canvas.drawRect(CanvasKit.LTRBRect(x, y, x+50, y+50), ctx.paint); } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); }, perfKey: 'canvas_drawRect', }); tests.push({ description: "Draw 10K colored rects with malloc'd rect", setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.paint.setAntiAlias(true); ctx.paint.setStyle(CanvasKit.PaintStyle.Fill); ctx.rect = CanvasKit.Malloc(Float32Array, 4); }, test: function(CanvasKit, ctx) { for (let i=0; i<10000; i++) { ctx.paint.setColor(randomColorTwo(CanvasKit, 1, 2)); const ta = ctx.rect.toTypedArray(); ta[0] = Math.random()*550; // x ta[1] = Math.random()*550; // y ta[2] = ta[0] + 50; ta[3] = ta[1] + 50; ctx.canvas.drawRect(ta, ctx.paint); } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); CanvasKit.Free(ctx.rect); }, perfKey: 'canvas_drawRect_malloc', }); tests.push({ description: 'Draw 10K colored rects using 4 float API', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.paint.setAntiAlias(true); ctx.paint.setStyle(CanvasKit.PaintStyle.Fill); }, test: function(CanvasKit, ctx) { for (let i=0; i<10000; i++) { const x = Math.random()*550; const y = Math.random()*550; ctx.paint.setColor(randomColorTwo(CanvasKit, 1, 2)); ctx.canvas.drawRect4f(x, y, x+50, y+50, ctx.paint); } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); }, perfKey: 'canvas_drawRect4f', }); tests.push({ description: 'Compute tonal colors', setup: function(CanvasKit, ctx) {}, test: function(CanvasKit, ctx) { for (let i = 0; i < 10; i++) { const input = { ambient: randomColor(CanvasKit), spot: randomColor(CanvasKit), }; const out = CanvasKit.computeTonalColors(input); if (out.spot[2] > 10 || out.ambient[3] > 10) { // Something to make sure v8 can't optimize away the return value throw 'not possible'; } } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'computeTonalColors', }); tests.push({ description: 'Get and set the color to a paint', setup: function(CanvasKit, ctx) { ctx.paint = new CanvasKit.SkPaint(); }, test: function(CanvasKit, ctx) { for (let i = 0; i < 10; i++) { ctx.paint.setColor(randomColor(CanvasKit)); const color = ctx.paint.getColor(); if (color[3] > 4) { // Something to make sure v8 can't optimize away the return value throw 'not possible'; } } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); }, perfKey: 'paint_setColor_getColor', }); tests.push({ description: 'Set the color to a paint by components', setup: function(CanvasKit, ctx) { ctx.paint = new CanvasKit.SkPaint(); }, test: function(CanvasKit, ctx) { const r = Math.random(); const g = Math.random(); const b = Math.random(); const a = Math.random(); for (let i = 0; i < 10000; i++) { ctx.paint.setColorComponents(r, g, b, a); } }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); }, perfKey: 'paint_setColorComponents', }); tests.push({ description: 'Draw a shadow with tonal colors', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.input = { ambient: CanvasKit.Color4f(0.2, 0.1, 0.3, 0.5), spot: CanvasKit.Color4f(0.8, 0.8, 0.9, 0.9), }; ctx.lightRadius = 30; ctx.flags = 0; ctx.lightPos = [250,150,300]; ctx.zPlaneParams = [0,0,1]; ctx.path = starPath(CanvasKit); }, test: function(CanvasKit, ctx) { const out = CanvasKit.computeTonalColors(ctx.input); ctx.canvas.drawShadow(ctx.path, ctx.zPlaneParams, ctx.lightPos, ctx.lightRadius, out.ambient, out.spot, ctx.flags); }, teardown: function(CanvasKit, ctx) {}, perfKey: 'canvas_drawShadow', }); tests.push({ description: 'Draw a gradient with an array of 10K colors', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); }, test: function(CanvasKit, ctx) { ctx.canvas.clear(CanvasKit.WHITE); const num = 10000; colors = Array(num); positions = Array(num); // Create an array of colors spaced evenly along the 0..1 range of positions. for (let i=0; i<num; i++) { colors[i] = randomColorTwo(CanvasKit, 2, 3); positions[i] = i/num; } // make a gradient from those colors const shader = CanvasKit.SkShader.MakeRadialGradient( [300, 300], 50, // center, radius colors, positions, CanvasKit.TileMode.Mirror, ); // Fill the canvas using the gradient shader. const paint = new CanvasKit.SkPaint(); paint.setStyle(CanvasKit.PaintStyle.Fill); paint.setShader(shader); ctx.canvas.drawPaint(paint); shader.delete(); paint.delete(); }, teardown: function(CanvasKit, ctx) {}, perfKey: 'canvas_drawHugeGradient', }); tests.push({ description: 'Draw a png image', setup: async function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.img = CanvasKit.MakeImageFromEncoded(ctx.files['test_512x512.png']); ctx.frame = 0; }, test: function(CanvasKit, ctx) { ctx.canvas.clear(CanvasKit.WHITE); // Make the image to move so you can see visually that the test is running. ctx.canvas.drawImage(ctx.img, ctx.frame, ctx.frame, ctx.paint); ctx.frame++; }, teardown: function(CanvasKit, ctx) { ctx.img.delete(); ctx.paint.delete(); }, perfKey: 'canvas_drawPngImage', }); function htmlImageElementToDataURL(htmlImageElement) { const canvas = document.createElement('canvas'); canvas.height = htmlImageElement.height; canvas.width = htmlImageElement.width; const ctx = canvas.getContext('2d') ctx.drawImage(htmlImageElement, 0, 0); return canvas.toDataURL(); } // This for loop generates two perf cases for each test image. One uses browser APIs // to decode an image, and the other uses codecs included in the CanvasKit wasm to decode an // image. wasm codec Image decoding is faster (50 microseconds vs 20000 microseconds), but // including codecs in wasm increases the size of the CanvasKit wasm binary. for (const testImageFilename of ['test_64x64.png', 'test_512x512.png', 'test_1500x959.jpg']) { const htmlImageElement = new Image(); htmlImageElementLoadPromise = new Promise((resolve) => htmlImageElement.addEventListener('load', resolve)); // Create a data url of the image so that load and decode time can be measured // while ignoring the time of getting the image from disk / the network. imageDataURLPromise = htmlImageElementLoadPromise.then(() => htmlImageElementToDataURL(htmlImageElement)); htmlImageElement.src = `/static/assets/${testImageFilename}`; tests.push({ description: 'Decode an image using HTMLImageElement and Canvas2D', setup: async function(CanvasKit, ctx) { ctx.imageDataURL = await imageDataURLPromise; }, test: async function(CanvasKit, ctx) { const image = new Image(); // Testing showed that waiting for the load event is faster than waiting for // image.decode(). // Despite the name, both of them would decode the image, it was loaded in setup. // HTMLImageElement.decode() reference: // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decode const promise = new Promise((resolve) => image.addEventListener('load', resolve)); image.src = ctx.imageDataURL; await promise; const img = await CanvasKit.MakeImageFromCanvasImageSource(image); img.delete(); }, teardown: function(CanvasKit, ctx) {}, perfKey: `canvas_${testImageFilename}_HTMLImageElementDecoding`, }); tests.push({ description: 'Decode an image using codecs in wasm', setup: function(CanvasKit, ctx) {}, test: function(CanvasKit, ctx) { const img = CanvasKit.MakeImageFromEncoded(ctx.files[testImageFilename]); img.delete(); }, teardown: function(CanvasKit, ctx) {}, perfKey: '`canvas_${testImageFilename}_wasmImageDecoding`', }); } // 3x3 matrix ops tests.push({ description: 'Multiply 3x3 matrices together', setup: function(CanvasKit, ctx) { ctx.first = CanvasKit.SkMatrix.rotated(Math.PI/2, 10, 20); ctx.second = CanvasKit.SkMatrix.scaled(1, 2, 3, 4); }, test: function(CanvasKit, ctx) { ctx.result = CanvasKit.SkMatrix.multiply(ctx.first, ctx.second); if (ctx.result.length === 18) { throw 'this is here to keep the result from being optimized away'; } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'skmatrix_multiply', }); tests.push({ description: 'Transform a point using a matrix (mapPoint)', setup: function(CanvasKit, ctx) { ctx.matr = CanvasKit.SkMatrix.multiply( CanvasKit.SkMatrix.rotated(Math.PI/2, 10, 20), CanvasKit.SkMatrix.scaled(1, 2, 3, 4), ); // make an arbitrary, but interesting matrix }, test: function(CanvasKit, ctx) { for (let i = 0; i < 30; i++) { const pt = CanvasKit.SkMatrix.mapPoints(ctx.matr, [i, i]); if (pt.length === 18) { throw 'this is here to keep pt from being optimized away'; } } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'skmatrix_transformPoint', }); tests.push({ description: 'Invert a 3x3 matrix', setup: function(CanvasKit, ctx) { ctx.matr = CanvasKit.SkMatrix.multiply( CanvasKit.SkMatrix.rotated(Math.PI/2, 10, 20), CanvasKit.SkMatrix.scaled(1, 2, 3, 4), ); }, test: function(CanvasKit, ctx) { ctx.result = CanvasKit.SkMatrix.invert(ctx.matr); if (ctx.result.length === 18) { throw 'this is here to keep the result from being optimized away'; } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'skmatrix_invert', }); tests.push({ description: 'Create a shader from a 3x3 matrix', setup: function(CanvasKit, ctx) { ctx.matr = CanvasKit.SkMatrix.multiply( CanvasKit.SkMatrix.rotated(Math.PI/2, 10, 20), CanvasKit.SkMatrix.scaled(1, 2, 3, 4), ); }, test: function(CanvasKit, ctx) { const shader = CanvasKit.SkShader.MakeSweepGradient( 100, 100, [CanvasKit.GREEN, CanvasKit.BLUE], [0.0, 1.0], CanvasKit.TileMode.Clamp, ctx.matr); shader.delete(); }, teardown: function(CanvasKit, ctx) {}, perfKey: 'skmatrix_makeShader', }); tests.push({ description: 'Concat 3x3 matrix on a canvas', setup: function(CanvasKit, ctx) { ctx.canvas = new CanvasKit.SkCanvas(); ctx.matr = CanvasKit.SkMatrix.multiply( CanvasKit.SkMatrix.rotated(Math.PI/2, 10, 20), CanvasKit.SkMatrix.scaled(1, 2, 3, 4), ); }, test: function(CanvasKit, ctx) { ctx.canvas.concat(ctx.matr); }, teardown: function(CanvasKit, ctx) { ctx.canvas.delete(); }, perfKey: 'skmatrix_concat', }); // 4x4 matrix operations tests.push({ description: 'Multiply 4x4 matrices together', setup: function(CanvasKit, ctx) { ctx.first = CanvasKit.SkM44.rotated([10, 20], Math.PI/2); ctx.second = CanvasKit.SkM44.scaled([1, 2, 3]); }, test: function(CanvasKit, ctx) { ctx.result = CanvasKit.SkM44.multiply(ctx.first, ctx.second); if (ctx.result.length === 18) { throw 'this is here to keep the result from being optimized away'; } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'skm44_multiply', }); tests.push({ description: 'Invert a 4x4 matrix', setup: function(CanvasKit, ctx) { ctx.matr = CanvasKit.SkM44.multiply( CanvasKit.SkM44.rotated([10, 20], Math.PI/2), CanvasKit.SkM44.scaled([1, 2, 3]), ); }, test: function(CanvasKit, ctx) { ctx.result = CanvasKit.SkM44.invert(ctx.matr); if (ctx.result.length === 18) { throw 'this is here to keep the result from being optimized away'; } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'skm44_invert', }); tests.push({ description: 'Concat 4x4 matrix on a canvas', setup: function(CanvasKit, ctx) { ctx.canvas = new CanvasKit.SkCanvas(); ctx.matr = CanvasKit.SkM44.multiply( CanvasKit.SkM44.rotated([10, 20], Math.PI/2), CanvasKit.SkM44.scaled([1, 2, 3]), ); }, test: function(CanvasKit, ctx) { ctx.canvas.concat(ctx.matr); }, teardown: function(CanvasKit, ctx) { ctx.canvas.delete(); }, perfKey: 'skm44_concat', }); // DOMMatrix operations tests.push({ description: 'Multiply DOM matrices together', setup: function(CanvasKit, ctx) { ctx.first = new DOMMatrix().translate(10, 20).rotate(90).translate(-10, -20); ctx.second = new DOMMatrix().translate(3, 4).scale(1, 2).translate(-3, -4); }, test: function(CanvasKit, ctx) { const result = ctx.first.multiply(ctx.second); if (result.length === 18) { throw 'this is here to keep the result from being optimized away'; } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'dommatrix_multiply', }); tests.push({ description: 'Transform a point using a matrix (transformPoint)', setup: function(CanvasKit, ctx) { ctx.matr = new DOMMatrix().translate(10, 20).rotate(90).translate(-10, -20) .multiply(new DOMMatrix().translate(3, 4).scale(1, 2).translate(-3, -4)); ctx.reusablePt = new DOMPoint(0, 0) }, test: function(CanvasKit, ctx) { for (let i = 0; i < 30; i++) { ctx.reusablePt.X = i; ctx.reusablePt.Y = i; const pt = ctx.matr.transformPoint(ctx.reusablePt); if (pt.length === 18) { throw 'this is here to keep pt from being optimized away'; } } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'dommatrix_transformPoint', }); tests.push({ description: 'Invert a DOM matrix', setup: function(CanvasKit, ctx) { ctx.matr = new DOMMatrix().translate(10, 20).rotate(90).translate(-10, -20) .multiply(new DOMMatrix().translate(3, 4).scale(1, 2).translate(-3, -4)); }, test: function(CanvasKit, ctx) { const inverted = ctx.matr.inverse(); if (inverted.length === 18) { throw 'this is here to keep the result from being optimized away'; } }, teardown: function(CanvasKit, ctx) {}, perfKey: 'dommatrix_invert', }); tests.push({ description: 'make a shader from a DOMMatrix', setup: function(CanvasKit, ctx) { ctx.matr = new DOMMatrix().translate(10, 20).rotate(90).translate(-10, -20) .multiply(new DOMMatrix().translate(3, 4).scale(1, 2).translate(-3, -4)); }, test: function(CanvasKit, ctx) { const shader = CanvasKit.SkShader.MakeSweepGradient( 100, 100, [CanvasKit.GREEN, CanvasKit.BLUE], [0.0, 1.0], CanvasKit.TileMode.Clamp, ctx.matr); shader.delete(); }, teardown: function(CanvasKit, ctx) {}, perfKey: 'dommatrix_makeShader', }); // Tests the layout and drawing of a paragraph with hundreds of words. // In the second variant, the colors change every frame // In the third variant, the font size cycles between three sizes. // In the fourth variant, the layout width changes. // in the fifth variant, all of those properties change at the same time. for (const variant of ['static', 'color_changing', 'size_changing', 'layout_changing', 'everything']) { tests.push({ description: `Layout and draw a ${variant} paragraph`, setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.fontMgr = CanvasKit.SkFontMgr.FromData([ctx.files['Roboto-Regular.ttf']]); ctx.paraStyle = new CanvasKit.ParagraphStyle({ textStyle: { color: CanvasKit.WHITE, fontFamilies: ['Roboto'], fontSize: 11, }, textAlign: CanvasKit.TextAlign.Left, }); ctx.frame = 0; ctx.text = "annap sap sa ladipidapidi rapadip sam dim dap dim dap do raka dip da da badip badip badipidipidipadisuten din dab do ".repeat(40); }, test: function(CanvasKit, ctx) { ctx.canvas.clear(CanvasKit.BLACK); const builder = CanvasKit.ParagraphBuilder.Make(ctx.paraStyle, ctx.fontMgr); let pos = 0; let color = CanvasKit.WHITE; while (pos < ctx.text.length) { let size = 11; if (variant === 'size_changing' || variant === 'everything') { // the bigger this modulo, the more work it takes to fill the glyph cache size += ctx.frame % 4; } if (variant === 'color_changing' || variant === 'everything') { color = randomColorTwo(CanvasKit, 0, 1); } builder.pushStyle(CanvasKit.TextStyle({ color: color, fontFamilies: ['Roboto'], fontSize: size, fontStyle: { weight: CanvasKit.FontWeight.Bold, }, })); const len = Math.floor(Math.random()*5+2); builder.addText(ctx.text.slice(pos, pos+len)); builder.pop(); pos += len; } const paragraph = builder.build(); let w = 0; const base_width = 520; const varying_width_modulo = 70; if (variant === 'layout_changing' || variant === 'everything') { w = ctx.frame % varying_width_modulo; } paragraph.layout(base_width + w); // width in pixels to use when wrapping text ctx.canvas.drawParagraph(paragraph, 10, 10); ctx.frame++; builder.delete(); paragraph.delete(); }, teardown: function(CanvasKit, ctx) { ctx.fontMgr.delete(); }, perfKey: 'canvas_drawParagraph_'+variant, }); } tests.push({ description: 'Draw a path with a blur mask', setup: function(CanvasKit, ctx) { ctx.canvas = ctx.surface.getCanvas(); ctx.paint = new CanvasKit.SkPaint(); ctx.paint.setAntiAlias(true); ctx.paint.setStyle(CanvasKit.PaintStyle.Fill); ctx.paint.setColor(CanvasKit.Color4f(0.1, 0.7, 0.0, 1.0)); ctx.path = starPath(CanvasKit); ctx.frame = 0; }, test: function(CanvasKit, ctx) { const sigma = 0.1 + (ctx.frame/10); const blurMask = CanvasKit.SkMaskFilter.MakeBlur( CanvasKit.BlurStyle.Normal, sigma, true); ctx.paint.setMaskFilter(blurMask); ctx.canvas.drawPath(ctx.path, ctx.paint); blurMask.delete(); ctx.frame++; }, teardown: function(CanvasKit, ctx) { ctx.paint.delete(); ctx.path.delete(); }, perfKey: 'canvas_blur_mask_filter', });
{ "pile_set_name": "Github" }
class Clair < Formula desc "Vulnerability Static Analysis for Containers" homepage "https://github.com/quay/clair" url "https://github.com/quay/clair/archive/v2.1.4.tar.gz" sha256 "444e109091ddc49e00277e38ddf9456a53243ab70f2560ab927f4d35b53555f4" license "Apache-2.0" bottle do cellar :any_skip_relocation sha256 "d310d5c7a3596a17612fd5b56d6c321129ecfae40d4fa7dc5032056c863b4dc3" => :catalina sha256 "8b48f7520edfa1b74124b848de69802f127d476968a7c5471bd6174a43fc9899" => :mojave sha256 "6ea27e3eed1bbf53401a81d55d138e1f808a9cfb52ca857316b1c371258b9c34" => :high_sierra end depends_on "go" => :build depends_on "rpm" depends_on "xz" def install system "go", "build", *std_go_args, "./cmd/clair" (etc/"clair").install "config.example.yaml" => "config.yaml" end test do cp etc/"clair/config.yaml", testpath output = shell_output("#{bin}/clair -config=config.yaml", 1) # requires a Postgres database assert_match "pgsql: could not open database", output end end
{ "pile_set_name": "Github" }
module Webui module Packages class FilesController < Packages::MainController before_action :set_project before_action :set_package after_action :verify_authorized def new authorize @package, :update? end def create authorize @package, :update? file = params[:file] file_url = params[:file_url] filename = params[:filename] errors = [] begin if file.present? # We are getting an uploaded file filename = file.original_filename if filename.blank? @package.save_file(file: file, filename: filename, comment: params[:comment]) elsif file_url.present? # we have a remote file URI, so we have to download and save it services = @package.services # detects automatically git://, src.rpm formats services.addDownloadURL(file_url, filename) errors << "Failed to add file from URL '#{file_url}'" unless services.save elsif filename.present? # No file is provided so we just create an empty new file (touch) @package.save_file(filename: filename) else errors << 'No file or URI given' end rescue APIError => e errors << e.message rescue Backend::Error => e errors << Xmlhash::XMLHash.new(error: e.summary)[:error] rescue StandardError => e errors << e.message end if errors.empty? message = "The file '#{filename}' has been successfully saved." # We have to check if it's an AJAX request or not if request.xhr? flash.now[:success] = message else redirect_to(package_show_path(project: @project, package: @package), success: message) return end else message = "Error while creating '#{filename}' file: #{errors.compact.join("\n")}." # We have to check if it's an AJAX request or not if request.xhr? flash.now[:error] = message status = 400 else redirect_back(fallback_location: root_path, error: message) return end end status ||= 200 render layout: false, status: status, partial: 'layouts/webui/flash', object: flash end end end end
{ "pile_set_name": "Github" }
#!/usr/bin/env perl # Copyright 2018 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # This program reads a file containing function prototypes # (like syscall_aix.go) and generates system call bodies. # The prototypes are marked by lines beginning with "//sys" # and read like func declarations if //sys is replaced by func, but: # * The parameter lists must give a name for each argument. # This includes return parameters. # * The parameter lists must give a type for each argument: # the (x, y, z int) shorthand is not allowed. # * If the return parameter is an error number, it must be named err. # * If go func name needs to be different than its libc name, # * or the function is not in libc, name could be specified # * at the end, after "=" sign, like # //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt use strict; my $cmdline = "mksyscall_aix_ppc.pl " . join(' ', @ARGV); my $errors = 0; my $_32bit = ""; my $tags = ""; # build tags my $aix = 0; my $solaris = 0; binmode STDOUT; if($ARGV[0] eq "-b32") { $_32bit = "big-endian"; shift; } elsif($ARGV[0] eq "-l32") { $_32bit = "little-endian"; shift; } if($ARGV[0] eq "-aix") { $aix = 1; shift; } if($ARGV[0] eq "-tags") { shift; $tags = $ARGV[0]; shift; } if($ARGV[0] =~ /^-/) { print STDERR "usage: mksyscall_aix.pl [-b32 | -l32] [-tags x,y] [file ...]\n"; exit 1; } sub parseparamlist($) { my ($list) = @_; $list =~ s/^\s*//; $list =~ s/\s*$//; if($list eq "") { return (); } return split(/\s*,\s*/, $list); } sub parseparam($) { my ($p) = @_; if($p !~ /^(\S*) (\S*)$/) { print STDERR "$ARGV:$.: malformed parameter: $p\n"; $errors = 1; return ("xx", "int"); } return ($1, $2); } my $package = ""; my $text = ""; my $c_extern = "/*\n#include <stdint.h>\n#include <stddef.h>\n"; my @vars = (); while(<>) { chomp; s/\s+/ /g; s/^\s+//; s/\s+$//; $package = $1 if !$package && /^package (\S+)$/; my $nonblock = /^\/\/sysnb /; next if !/^\/\/sys / && !$nonblock; # Line must be of the form # func Open(path string, mode int, perm int) (fd int, err error) # Split into name, in params, out params. if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) { print STDERR "$ARGV:$.: malformed //sys declaration\n"; $errors = 1; next; } my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6); # Split argument lists on comma. my @in = parseparamlist($in); my @out = parseparamlist($out); $in = join(', ', @in); $out = join(', ', @out); # Try in vain to keep people from editing this file. # The theory is that they jump into the middle of the file # without reading the header. $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; # Check if value return, err return available my $errvar = ""; my $retvar = ""; my $rettype = ""; foreach my $p (@out) { my ($name, $type) = parseparam($p); if($type eq "error") { $errvar = $name; } else { $retvar = $name; $rettype = $type; } } # System call name. #if($func ne "fcntl") { if($sysname eq "") { $sysname = "$func"; } $sysname =~ s/([a-z])([A-Z])/${1}_$2/g; $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase. my $C_rettype = ""; if($rettype eq "unsafe.Pointer") { $C_rettype = "uintptr_t"; } elsif($rettype eq "uintptr") { $C_rettype = "uintptr_t"; } elsif($rettype =~ /^_/) { $C_rettype = "uintptr_t"; } elsif($rettype eq "int") { $C_rettype = "int"; } elsif($rettype eq "int32") { $C_rettype = "int"; } elsif($rettype eq "int64") { $C_rettype = "long long"; } elsif($rettype eq "uint32") { $C_rettype = "unsigned int"; } elsif($rettype eq "uint64") { $C_rettype = "unsigned long long"; } else { $C_rettype = "int"; } if($sysname eq "exit") { $C_rettype = "void"; } # Change types to c my @c_in = (); foreach my $p (@in) { my ($name, $type) = parseparam($p); if($type =~ /^\*/) { push @c_in, "uintptr_t"; } elsif($type eq "string") { push @c_in, "uintptr_t"; } elsif($type =~ /^\[\](.*)/) { push @c_in, "uintptr_t", "size_t"; } elsif($type eq "unsafe.Pointer") { push @c_in, "uintptr_t"; } elsif($type eq "uintptr") { push @c_in, "uintptr_t"; } elsif($type =~ /^_/) { push @c_in, "uintptr_t"; } elsif($type eq "int") { push @c_in, "int"; } elsif($type eq "int32") { push @c_in, "int"; } elsif($type eq "int64") { push @c_in, "long long"; } elsif($type eq "uint32") { push @c_in, "unsigned int"; } elsif($type eq "uint64") { push @c_in, "unsigned long long"; } else { push @c_in, "int"; } } if ($func ne "fcntl" && $func ne "FcntlInt" && $func ne "readlen" && $func ne "writelen") { # Imports of system calls from libc $c_extern .= "$C_rettype $sysname"; my $c_in = join(', ', @c_in); $c_extern .= "($c_in);\n"; } # So file name. if($aix) { if($modname eq "") { $modname = "libc.a/shr_64.o"; } else { print STDERR "$func: only syscall using libc are available\n"; $errors = 1; next; } } my $strconvfunc = "C.CString"; my $strconvtype = "*byte"; # Go function header. if($out ne "") { $out = " ($out)"; } if($text ne "") { $text .= "\n" } $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out ; # Prepare arguments to call. my @args = (); my $n = 0; my $arg_n = 0; foreach my $p (@in) { my ($name, $type) = parseparam($p); if($type =~ /^\*/) { push @args, "C.uintptr_t(uintptr(unsafe.Pointer($name)))"; } elsif($type eq "string" && $errvar ne "") { $text .= "\t_p$n := uintptr(unsafe.Pointer($strconvfunc($name)))\n"; push @args, "C.uintptr_t(_p$n)"; $n++; } elsif($type eq "string") { print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; $text .= "\t_p$n := uintptr(unsafe.Pointer($strconvfunc($name)))\n"; push @args, "C.uintptr_t(_p$n)"; $n++; } elsif($type =~ /^\[\](.*)/) { # Convert slice into pointer, length. # Have to be careful not to take address of &a[0] if len == 0: # pass nil in that case. $text .= "\tvar _p$n *$1\n"; $text .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n"; push @args, "C.uintptr_t(uintptr(unsafe.Pointer(_p$n)))"; $n++; $text .= "\tvar _p$n int\n"; $text .= "\t_p$n = len($name)\n"; push @args, "C.size_t(_p$n)"; $n++; } elsif($type eq "int64" && $_32bit ne "") { if($_32bit eq "big-endian") { push @args, "uintptr($name >> 32)", "uintptr($name)"; } else { push @args, "uintptr($name)", "uintptr($name >> 32)"; } $n++; } elsif($type eq "bool") { $text .= "\tvar _p$n uint32\n"; $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n"; push @args, "_p$n"; $n++; } elsif($type =~ /^_/) { push @args, "C.uintptr_t(uintptr($name))"; } elsif($type eq "unsafe.Pointer") { push @args, "C.uintptr_t(uintptr($name))"; } elsif($type eq "int") { if (($arg_n == 2) && (($func eq "readlen") || ($func eq "writelen"))) { push @args, "C.size_t($name)"; } elsif ($arg_n == 0 && $func eq "fcntl") { push @args, "C.uintptr_t($name)"; } elsif (($arg_n == 2) && (($func eq "fcntl") || ($func eq "FcntlInt"))) { push @args, "C.uintptr_t($name)"; } else { push @args, "C.int($name)"; } } elsif($type eq "int32") { push @args, "C.int($name)"; } elsif($type eq "int64") { push @args, "C.longlong($name)"; } elsif($type eq "uint32") { push @args, "C.uint($name)"; } elsif($type eq "uint64") { push @args, "C.ulonglong($name)"; } elsif($type eq "uintptr") { push @args, "C.uintptr_t($name)"; } else { push @args, "C.int($name)"; } $arg_n++; } my $nargs = @args; # Determine which form to use; pad args with zeros. if ($nonblock) { } my $args = join(', ', @args); my $call = ""; if ($sysname eq "exit") { if ($errvar ne "") { $call .= "er :="; } else { $call .= ""; } } elsif ($errvar ne "") { $call .= "r0,er :="; } elsif ($retvar ne "") { $call .= "r0,_ :="; } else { $call .= "" } $call .= "C.$sysname($args)"; # Assign return values. my $body = ""; my $failexpr = ""; for(my $i=0; $i<@out; $i++) { my $p = $out[$i]; my ($name, $type) = parseparam($p); my $reg = ""; if($name eq "err") { $reg = "e1"; } else { $reg = "r0"; } if($reg ne "e1" ) { $body .= "\t$name = $type($reg)\n"; } } # verify return if ($sysname ne "exit" && $errvar ne "") { if ($C_rettype =~ /^uintptr/) { $body .= "\tif \(uintptr\(r0\) ==\^uintptr\(0\) && er != nil\) {\n"; $body .= "\t\t$errvar = er\n"; $body .= "\t}\n"; } else { $body .= "\tif \(r0 ==-1 && er != nil\) {\n"; $body .= "\t\t$errvar = er\n"; $body .= "\t}\n"; } } elsif ($errvar ne "") { $body .= "\tif \(er != nil\) {\n"; $body .= "\t\t$errvar = er\n"; $body .= "\t}\n"; } $text .= "\t$call\n"; $text .= $body; $text .= "\treturn\n"; $text .= "}\n"; } if($errors) { exit 1; } print <<EOF; // $cmdline // Code generated by the command above; see README.md. DO NOT EDIT. // +build $tags package $package $c_extern */ import "C" import ( "unsafe" ) EOF print "import \"golang.org/x/sys/unix\"\n" if $package ne "unix"; chomp($_=<<EOF); $text EOF print $_; exit 0;
{ "pile_set_name": "Github" }
import json import random import pysparkling import torch from .decoder.instance_scorer import InstanceScorer from . import show DATA_FILE = ('outputs/resnet101block5-pif-paf-edge401-190412-151013.pkl' '.decodertraindata-edge641-samples0.json') def plot_training_data(train_data, val_data, entry=0, entryname=None): train_x, train_y = train_data val_x, val_y = val_data with show.canvas() as ax: ax.hist([xx[entry] for xx in train_x[train_y[:, 0] == 1]], bins=50, alpha=0.3, density=True, color='navy', label='train true') ax.hist([xx[entry] for xx in train_x[train_y[:, 0] == 0]], bins=50, alpha=0.3, density=True, color='orange', label='train false') ax.hist([xx[entry] for xx in val_x[val_y[:, 0] == 1]], histtype='step', bins=50, density=True, color='navy', label='val true') ax.hist([xx[entry] for xx in val_x[val_y[:, 0] == 0]], histtype='step', bins=50, density=True, color='orange', label='val false') if entryname: ax.set_xlabel(entryname) ax.legend() def train_val_split_score(data, train_fraction=0.6, balance=True): xy_list = data.map(lambda d: ([d['score']], [float(d['target'])])).collect() if balance: n_true = sum(1 for x, y in xy_list if y[0] == 1.0) n_false = sum(1 for x, y in xy_list if y[0] == 0.0) p_true = min(1.0, n_false / n_true) p_false = min(1.0, n_true / n_false) xy_list = [(x, y) for x, y in xy_list if random.random() < (p_true if y[0] == 1.0 else p_false)] n_train = int(train_fraction * len(xy_list)) return ( (torch.tensor([x for x, _ in xy_list[:n_train]]), torch.tensor([y for _, y in xy_list[:n_train]])), (torch.tensor([x for x, _ in xy_list[n_train:]]), torch.tensor([y for _, y in xy_list[n_train:]])), ) def train_val_split_keypointscores(data, train_fraction=0.6): xy_list = ( data .map(lambda d: ([d['score']] + [xyv[2] for xyv in d['keypoints']] + d['joint_scales'], [float(d['target'])])) .collect() ) n_train = int(train_fraction * len(xy_list)) return ( (torch.tensor([x for x, _ in xy_list[:n_train]]), torch.tensor([y for _, y in xy_list[:n_train]])), (torch.tensor([x for x, _ in xy_list[n_train:]]), torch.tensor([y for _, y in xy_list[n_train:]])), ) def train_epoch(model, loader, optimizer): epoch_loss = 0.0 for x, y in loader: optimizer.zero_grad() y_hat = model(x) loss = torch.nn.functional.binary_cross_entropy(y_hat, y) epoch_loss += float(loss.item()) loss.backward() optimizer.step() return epoch_loss / len(loader) def val_epoch(model, loader): epoch_loss = 0.0 with torch.no_grad(): for x, y in loader: y_hat = model(x) loss = torch.nn.functional.binary_cross_entropy(y_hat, y) epoch_loss += float(loss.item()) return epoch_loss / len(loader) def main(): sc = pysparkling.Context() data = sc.textFile(DATA_FILE).map(json.loads).cache() train_data_score, val_data_score = train_val_split_score(data) plot_training_data(train_data_score, val_data_score, entryname='score') train_data, val_data = train_val_split_keypointscores(data) model = InstanceScorer() train_dataset = torch.utils.data.TensorDataset(*train_data) train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=256, shuffle=True) val_dataset = torch.utils.data.TensorDataset(*val_data) val_loader = torch.utils.data.DataLoader(val_dataset, batch_size=256, shuffle=False) optimizer = torch.optim.SGD(model.parameters(), lr=1e-3, momentum=0.9) for epoch_i in range(100): train_loss = train_epoch(model, train_loader, optimizer) val_loss = val_epoch(model, val_loader) print(epoch_i, train_loss, val_loss) with torch.no_grad(): post_train_data = (model(train_data[0]), train_data[1]) post_val_data = (model(val_data[0]), val_data[1]) plot_training_data(post_train_data, post_val_data, entryname='optimized score') torch.save(model, 'instance_scorer.pkl') if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
package operationalinsights // Copyright (c) Microsoft and contributors. All rights reserved. // // 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. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) // LinkedServicesClient is the operational Insights Client type LinkedServicesClient struct { BaseClient } // NewLinkedServicesClient creates an instance of the LinkedServicesClient client. func NewLinkedServicesClient(subscriptionID string) LinkedServicesClient { return NewLinkedServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewLinkedServicesClientWithBaseURI creates an instance of the LinkedServicesClient client using a custom endpoint. // Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewLinkedServicesClientWithBaseURI(baseURI string, subscriptionID string) LinkedServicesClient { return LinkedServicesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create or update a linked service. // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. // workspaceName - name of the Log Analytics Workspace that will contain the linkedServices resource // linkedServiceName - name of the linkedServices resource // parameters - the parameters required to create or update a linked service. func (client LinkedServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService) (result LinkedService, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LinkedServiceProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.LinkedServiceProperties.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("operationalinsights.LinkedServicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, linkedServiceName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client LinkedServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService) (*http.Request, error) { pathParameters := map[string]interface{}{ "linkedServiceName": autorest.Encode("path", linkedServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client LinkedServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client LinkedServicesClient) CreateOrUpdateResponder(resp *http.Response) (result LinkedService, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete deletes a linked service instance. // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. // workspaceName - name of the Log Analytics Workspace that contains the linkedServices resource // linkedServiceName - name of the linked service. func (client LinkedServicesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.Delete") defer func() { sc := -1 if result.Response != nil { sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("operationalinsights.LinkedServicesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, linkedServiceName) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. func (client LinkedServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "linkedServiceName": autorest.Encode("path", linkedServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client LinkedServicesClient) DeleteSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client LinkedServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // Get gets a linked service instance. // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. // workspaceName - name of the Log Analytics Workspace that contains the linkedServices resource // linkedServiceName - name of the linked service. func (client LinkedServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result LinkedService, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("operationalinsights.LinkedServicesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, linkedServiceName) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client LinkedServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "linkedServiceName": autorest.Encode("path", linkedServiceName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client LinkedServicesClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client LinkedServicesClient) GetResponder(resp *http.Response) (result LinkedService, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByWorkspace gets the linked services instances in a workspace. // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. // workspaceName - name of the Log Analytics Workspace that contains the linked services. func (client LinkedServicesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result LinkedServiceListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.ListByWorkspace") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("operationalinsights.LinkedServicesClient", "ListByWorkspace", err.Error()) } req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace", nil, "Failure preparing request") return } resp, err := client.ListByWorkspaceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace", resp, "Failure sending request") return } result, err = client.ListByWorkspaceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace", resp, "Failure responding to request") } return } // ListByWorkspacePreparer prepares the ListByWorkspace request. func (client LinkedServicesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByWorkspaceSender sends the ListByWorkspace request. The method will close the // http.Response Body if it receives an error. func (client LinkedServicesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always // closes the http.Response Body. func (client LinkedServicesClient) ListByWorkspaceResponder(resp *http.Response) (result LinkedServiceListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!114 &-9046611798479816016 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 15e0374501f39d54eb30235764636e0e, type: 3} m_Name: Planet Ouverture m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 8136993665081925336} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.65 m_ClipIn: 0 m_Asset: {fileID: 8178033680129618112} m_Duration: 1.5166666666680002 m_TimeScale: 1 m_ParentTrack: {fileID: -9046611798479816016} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: ARUI-Planet-Ouverture m_Markers: m_Objects: [] --- !u!114 &-9004207468765632270 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (8) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4783832356411169232} m_Children: [] m_Clips: - m_Version: 1 m_Start: 0.6166666666666667 m_ClipIn: 0 m_Asset: {fileID: -2198564815534201740} m_Duration: 4.550000000000001 m_TimeScale: 1 m_ParentTrack: {fileID: -9004207468765632270} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &-9000172995622598367 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &-8545076137062533335 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 48853ae485fa386428341ac1ea122570, type: 3} m_Name: ControlPlayableAsset m_EditorClassIdentifier: sourceGameObject: exposedName: b9e29408b7915024da3b2e0739a383d6 defaultValue: {fileID: 0} prefabGameObject: {fileID: 0} updateParticle: 1 particleRandomSeed: 8207 updateDirector: 1 updateITimeControl: 1 searchHierarchy: 1 active: 1 postPlayback: 2 --- !u!114 &-8488975105447670555 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d21dcc2386d650c4597f3633c75a1f98, type: 3} m_Name: Animation Track m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4783832356411169232} m_Children: [] m_Clips: [] m_Markers: m_Objects: [] m_InfiniteClipPreExtrapolation: 1 m_InfiniteClipPostExtrapolation: 1 m_InfiniteClipOffsetPosition: {x: 0, y: 0, z: 0} m_InfiniteClipOffsetEulerAngles: {x: -0, y: 0, z: 0} m_InfiniteClipTimeOffset: 0 m_InfiniteClipRemoveOffset: 0 m_InfiniteClipApplyFootIK: 1 mInfiniteClipLoop: 0 m_MatchTargetFields: 63 m_Position: {x: 0, y: 0, z: 0} m_EulerAngles: {x: 0, y: 0, z: 0} m_AvatarMask: {fileID: 0} m_ApplyAvatarMask: 1 m_TrackOffset: 0 m_InfiniteClip: {fileID: 1222595853041762813} m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1} m_Rotation: {x: 0, y: 0, z: 0, w: 1} m_ApplyOffsets: 0 --- !u!114 &-7778979968715593700 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: ENDEX - Inhabitable m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: -7074843995397847032} - {fileID: 5712230391202370118} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &-7761112412762710428 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 15e0374501f39d54eb30235764636e0e, type: 3} m_Name: Planet Ouverture m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4268881588063035429} m_Children: [] m_Clips: - m_Version: 1 m_Start: 3.0833333333333335 m_ClipIn: 0 m_Asset: {fileID: 4965299879507414730} m_Duration: 1.5166666666679998 m_TimeScale: 1 m_ParentTrack: {fileID: -7761112412762710428} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: ARUI-Planet-Ouverture m_Markers: m_Objects: [] --- !u!114 &-7074843995397847032 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (2) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -7778979968715593700} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.4 m_ClipIn: 0 m_Asset: {fileID: -9000172995622598367} m_Duration: 5.1 m_TimeScale: 1 m_ParentTrack: {fileID: -7074843995397847032} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &-6424220613989501127 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (4) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -1738274317691592606} m_Children: [] m_Clips: - m_Version: 1 m_Start: 2.3333333333333335 m_ClipIn: 0 m_Asset: {fileID: 1939074613593682538} m_Duration: 3.8666666666666663 m_TimeScale: 1 m_ParentTrack: {fileID: -6424220613989501127} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &-6349543820349708053 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (7) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 8136993665081925336} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.65 m_ClipIn: 0 m_Asset: {fileID: 6719764240001799943} m_Duration: 4.849999999999998 m_TimeScale: 1 m_ParentTrack: {fileID: -6349543820349708053} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &-6116810688618412696 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (1) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -249739801011480333} m_Children: [] m_Clips: - m_Version: 1 m_Start: 0 m_ClipIn: 0 m_Asset: {fileID: -5233615035199855639} m_Duration: 5.166666666666667 m_TimeScale: 1 m_ParentTrack: {fileID: -6116810688618412696} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &-6030766291990254605 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 15e0374501f39d54eb30235764636e0e, type: 3} m_Name: Planet Ouverture m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 8547488202701244938} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.6666666666666674 m_ClipIn: 0 m_Asset: {fileID: 8448631576589797237} m_Duration: 1.516666666668 m_TimeScale: 1 m_ParentTrack: {fileID: -6030766291990254605} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: ARUI-Planet-Ouverture m_Markers: m_Objects: [] --- !u!114 &-5377480320652254031 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 48853ae485fa386428341ac1ea122570, type: 3} m_Name: ControlPlayableAsset m_EditorClassIdentifier: sourceGameObject: exposedName: fa39f2a6a2ed2264189a83b501ae2a38 defaultValue: {fileID: 0} prefabGameObject: {fileID: 0} updateParticle: 1 particleRandomSeed: 8344 updateDirector: 1 updateITimeControl: 1 searchHierarchy: 1 active: 1 postPlayback: 2 --- !u!114 &-5333435884007577063 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &-5233615035199855639 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &-4931509578002802562 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 2a16748d9461eae46a725db9776d5390, type: 3} m_Name: Markers m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: [] m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &-4783832356411169232 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: Sun m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: -9004207468765632270} - {fileID: -8488975105447670555} - {fileID: 5795938446375633588} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &-4276188729828789569 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: UX3-17 - Barren Ice m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: 696640963593093012} - {fileID: 7813227247032803116} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &-4268881588063035429 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: JUF01 - Hollow Dead m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: 4305409321382535264} - {fileID: -7761112412762710428} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &-4022265325504925792 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &-3972936612806963134 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &-2198564815534201740 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!74 &-2169182366491405472 AnimationClip: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Recorded (3) serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 m_UseHighQualityCurve: 1 m_RotationCurves: [] m_CompressedRotationCurves: [] m_EulerCurves: [] m_PositionCurves: [] m_ScaleCurves: [] m_FloatCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.51666665 value: 1 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: float.SmokeOpacity path: classID: 2083052967 script: {fileID: 0} - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.8833333 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1.3833333 value: 1 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: float.DeployAsteroids path: classID: 2083052967 script: {fileID: 0} m_PPtrCurves: [] m_SampleRate: 60 m_WrapMode: 0 m_Bounds: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: genericBindings: - serializedVersion: 2 path: 0 attribute: 3700289651 script: {fileID: 0} typeID: 2083052967 customType: 38 isPPtrCurve: 0 - serializedVersion: 2 path: 0 attribute: 85109898 script: {fileID: 0} typeID: 2083052967 customType: 38 isPPtrCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 m_StopTime: 1.3833333 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 m_LoopBlendPositionXZ: 0 m_KeepOriginalOrientation: 0 m_KeepOriginalPositionY: 1 m_KeepOriginalPositionXZ: 0 m_HeightFromFeet: 0 m_Mirror: 0 m_EditorCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.51666665 value: 1 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: float.SmokeOpacity path: classID: 2083052967 script: {fileID: 0} - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.8833333 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1.3833333 value: 1 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: float.DeployAsteroids path: classID: 2083052967 script: {fileID: 0} m_EulerEditorCurves: [] m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_Events: [] --- !u!114 &-1871778886167170135 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 11648ccae12f83545b1655323aa96c6c, type: 3} m_Name: Ship AI VO m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.65 m_ClipIn: 0 m_Asset: {fileID: 1661622579753007635} m_Duration: 1.3333333333333335 m_TimeScale: 1 m_ParentTrack: {fileID: -1871778886167170135} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: SHIP_VO_20_select target m_Markers: m_Objects: [] --- !u!114 &-1738274317691592606 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: ZZXN1 - Barren Earth m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: -6424220613989501127} - {fileID: 8989000213787986946} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &-249739801011480333 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: General m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: 1310362124312602810} - {fileID: 5798385787922777707} - {fileID: -6116810688618412696} - {fileID: 6243384820228949448} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: bfda56da833e2384a9677cd3c976a436, type: 3} m_Name: SolarSystemFadeInTimeline m_EditorClassIdentifier: m_Version: 0 m_Tracks: - {fileID: 1054248114151227126} - {fileID: -249739801011480333} - {fileID: -4783832356411169232} - {fileID: -7778979968715593700} - {fileID: -4268881588063035429} - {fileID: -1738274317691592606} - {fileID: 8547488202701244938} - {fileID: -4276188729828789569} - {fileID: 8136993665081925336} - {fileID: -1871778886167170135} m_FixedDuration: 5.016666666666667 m_EditorSettings: m_Framerate: 60 m_DurationMode: 1 m_MarkerTrack: {fileID: -4931509578002802562} --- !u!114 &696640963593093012 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (6) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4276188729828789569} m_Children: [] m_Clips: - m_Version: 1 m_Start: 2.816666666666667 m_ClipIn: 0 m_Asset: {fileID: -4022265325504925792} m_Duration: 3.683333333333329 m_TimeScale: 1 m_ParentTrack: {fileID: 696640963593093012} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &733700553385114856 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &889022650376349026 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 48853ae485fa386428341ac1ea122570, type: 3} m_Name: ControlPlayableAsset m_EditorClassIdentifier: sourceGameObject: exposedName: 2a8efc552ab6e0841ba99c37bc8955c3 defaultValue: {fileID: 0} prefabGameObject: {fileID: 0} updateParticle: 1 particleRandomSeed: 9733 updateDirector: 1 updateITimeControl: 1 searchHierarchy: 1 active: 1 postPlayback: 2 --- !u!114 &1054248114151227126 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d21dcc2386d650c4597f3633c75a1f98, type: 3} m_Name: Animation Track m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: [] m_Clips: [] m_Markers: m_Objects: [] m_InfiniteClipPreExtrapolation: 0 m_InfiniteClipPostExtrapolation: 0 m_InfiniteClipOffsetPosition: {x: 0, y: 0, z: 0} m_InfiniteClipOffsetEulerAngles: {x: 0, y: 0, z: 0} m_InfiniteClipTimeOffset: 0 m_InfiniteClipRemoveOffset: 0 m_InfiniteClipApplyFootIK: 1 mInfiniteClipLoop: 0 m_MatchTargetFields: 63 m_Position: {x: 0, y: 0, z: 0} m_EulerAngles: {x: 0, y: 0, z: 0} m_AvatarMask: {fileID: 0} m_ApplyAvatarMask: 1 m_TrackOffset: 0 m_InfiniteClip: {fileID: 0} m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1} m_Rotation: {x: 0, y: 0, z: 0, w: 1} m_ApplyOffsets: 0 --- !u!74 &1222595853041762813 AnimationClip: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Recorded (2) serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 m_UseHighQualityCurve: 1 m_RotationCurves: [] m_CompressedRotationCurves: [] m_EulerCurves: [] m_PositionCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: {x: 0, y: -0.6, z: 0} inSlope: {x: 0, y: 3.2114518, z: 0} outSlope: {x: 0, y: 3.2114518, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.18907137, z: 0.33333334} - serializedVersion: 3 time: 0.76666665 value: {x: 0, y: -0.2348989, z: 0} inSlope: {x: 0, y: 1.7314404, z: 0} outSlope: {x: 0, y: 1.7314404, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 1.2333333 value: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 path: m_ScaleCurves: [] m_FloatCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.76666665 value: 0.6 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1.2166667 value: 0.3 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: float.StarSize path: classID: 2083052967 script: {fileID: 0} m_PPtrCurves: [] m_SampleRate: 60 m_WrapMode: 0 m_Bounds: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: genericBindings: - serializedVersion: 2 path: 0 attribute: 1 script: {fileID: 0} typeID: 4 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 0 attribute: 2426463340 script: {fileID: 0} typeID: 2083052967 customType: 38 isPPtrCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 m_StopTime: 1.2333333 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 m_LoopBlendPositionXZ: 0 m_KeepOriginalOrientation: 0 m_KeepOriginalPositionY: 1 m_KeepOriginalPositionXZ: 0 m_HeightFromFeet: 0 m_Mirror: 0 m_EditorCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.76666665 value: 0.6 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1.2166667 value: 0.3 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: float.StarSize path: classID: 2083052967 script: {fileID: 0} - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.76666665 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: m_LocalPosition.x path: classID: 4 script: {fileID: 0} - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: -0.6 inSlope: 3.2114518 outSlope: 3.2114518 tangentMode: 0 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.18907137 - serializedVersion: 3 time: 1.2333333 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: m_LocalPosition.y path: classID: 4 script: {fileID: 0} - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.76666665 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: m_LocalPosition.z path: classID: 4 script: {fileID: 0} m_EulerEditorCurves: [] m_HasGenericRootTransform: 1 m_HasMotionFloatCurves: 0 m_Events: [] --- !u!114 &1310362124312602810 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d21dcc2386d650c4597f3633c75a1f98, type: 3} m_Name: Animation Track (1) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -249739801011480333} m_Children: [] m_Clips: [] m_Markers: m_Objects: [] m_InfiniteClipPreExtrapolation: 1 m_InfiniteClipPostExtrapolation: 1 m_InfiniteClipOffsetPosition: {x: 0, y: 0, z: 0} m_InfiniteClipOffsetEulerAngles: {x: 0, y: 0, z: 0} m_InfiniteClipTimeOffset: 0 m_InfiniteClipRemoveOffset: 0 m_InfiniteClipApplyFootIK: 1 mInfiniteClipLoop: 0 m_MatchTargetFields: 63 m_Position: {x: 0, y: 0, z: 0} m_EulerAngles: {x: 0, y: 0, z: 0} m_AvatarMask: {fileID: 0} m_ApplyAvatarMask: 1 m_TrackOffset: 0 m_InfiniteClip: {fileID: 8197540523042625037} m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1} m_Rotation: {x: 0, y: 0, z: 0, w: 1} m_ApplyOffsets: 0 --- !u!114 &1661622579753007635 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 7030f893af0007647b550d28f14f89d5, type: 3} m_Name: PlayCueClip m_EditorClassIdentifier: template: Cue: {fileID: 11400000, guid: 4cbad9f97fa528747940eb617508cf71, type: 2} --- !u!114 &1939074613593682538 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!74 &2828290113552264091 AnimationClip: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Recorded (1) serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 m_UseHighQualityCurve: 1 m_RotationCurves: [] m_CompressedRotationCurves: [] m_EulerCurves: [] m_PositionCurves: [] m_ScaleCurves: [] m_FloatCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.78333336 value: 60 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1.2166667 value: 32 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: displayLightIntensity path: classID: 114 script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_PPtrCurves: [] m_SampleRate: 60 m_WrapMode: 0 m_Bounds: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: genericBindings: - serializedVersion: 2 path: 0 attribute: 3531187776 script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 m_StopTime: 1.2166667 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 m_LoopBlendPositionXZ: 0 m_KeepOriginalOrientation: 0 m_KeepOriginalPositionY: 1 m_KeepOriginalPositionXZ: 0 m_HeightFromFeet: 0 m_Mirror: 0 m_EditorCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0.6166667 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.78333336 value: 60 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1.2166667 value: 32 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: displayLightIntensity path: classID: 114 script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_EulerEditorCurves: [] m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_Events: [] --- !u!114 &4305409321382535264 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (3) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4268881588063035429} m_Children: [] m_Clips: - m_Version: 1 m_Start: 3.0833333333333335 m_ClipIn: 0 m_Asset: {fileID: -5333435884007577063} m_Duration: 4.300000000000001 m_TimeScale: 1 m_ParentTrack: {fileID: 4305409321382535264} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &4965299879507414730 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 48853ae485fa386428341ac1ea122570, type: 3} m_Name: ControlPlayableAsset m_EditorClassIdentifier: sourceGameObject: exposedName: cd7666f0ae44c804b93cbae3c3007031 defaultValue: {fileID: 0} prefabGameObject: {fileID: 0} updateParticle: 1 particleRandomSeed: 2438 updateDirector: 1 updateITimeControl: 1 searchHierarchy: 1 active: 1 postPlayback: 2 --- !u!114 &5712230391202370118 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 15e0374501f39d54eb30235764636e0e, type: 3} m_Name: Planet Ouverture m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -7778979968715593700} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.4 m_ClipIn: 0 m_Asset: {fileID: -8545076137062533335} m_Duration: 1.5166666666680002 m_TimeScale: 1 m_ParentTrack: {fileID: 5712230391202370118} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: ARUI-Planet-Ouverture m_Markers: m_Objects: [] --- !u!114 &5795938446375633588 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d21dcc2386d650c4597f3633c75a1f98, type: 3} m_Name: Animation Track (1) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4783832356411169232} m_Children: [] m_Clips: [] m_Markers: m_Objects: [] m_InfiniteClipPreExtrapolation: 1 m_InfiniteClipPostExtrapolation: 1 m_InfiniteClipOffsetPosition: {x: 0, y: 0, z: 0} m_InfiniteClipOffsetEulerAngles: {x: 0, y: 0, z: 0} m_InfiniteClipTimeOffset: 0 m_InfiniteClipRemoveOffset: 0 m_InfiniteClipApplyFootIK: 1 mInfiniteClipLoop: 0 m_MatchTargetFields: 63 m_Position: {x: 0, y: 0, z: 0} m_EulerAngles: {x: 0, y: 0, z: 0} m_AvatarMask: {fileID: 0} m_ApplyAvatarMask: 1 m_TrackOffset: 0 m_InfiniteClip: {fileID: 2828290113552264091} m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1} m_Rotation: {x: 0, y: 0, z: 0, w: 1} m_ApplyOffsets: 0 --- !u!114 &5798385787922777707 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (9) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -249739801011480333} m_Children: [] m_Clips: - m_Version: 1 m_Start: 0 m_ClipIn: 0 m_Asset: {fileID: 733700553385114856} m_Duration: 5.166666666666667 m_TimeScale: 1 m_ParentTrack: {fileID: 5798385787922777707} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &6036547964693075452 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 21bf7f712d84d26478ebe6a299f21738, type: 3} m_Name: Activation Track (5) m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 8547488202701244938} m_Children: [] m_Clips: - m_Version: 1 m_Start: 1.6666666666666674 m_ClipIn: 0 m_Asset: {fileID: -3972936612806963134} m_Duration: 4.533333333333332 m_TimeScale: 1 m_ParentTrack: {fileID: 6036547964693075452} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: Active m_Markers: m_Objects: [] m_PostPlaybackState: 3 --- !u!114 &6243384820228949448 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d21dcc2386d650c4597f3633c75a1f98, type: 3} m_Name: Animation Track m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -249739801011480333} m_Children: [] m_Clips: [] m_Markers: m_Objects: [] m_InfiniteClipPreExtrapolation: 1 m_InfiniteClipPostExtrapolation: 1 m_InfiniteClipOffsetPosition: {x: 0, y: 0, z: 0} m_InfiniteClipOffsetEulerAngles: {x: 0, y: 0, z: 0} m_InfiniteClipTimeOffset: 0 m_InfiniteClipRemoveOffset: 0 m_InfiniteClipApplyFootIK: 1 mInfiniteClipLoop: 0 m_MatchTargetFields: 63 m_Position: {x: 0, y: 0, z: 0} m_EulerAngles: {x: 0, y: 0, z: 0} m_AvatarMask: {fileID: 0} m_ApplyAvatarMask: 1 m_TrackOffset: 0 m_InfiniteClip: {fileID: -2169182366491405472} m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1} m_Rotation: {x: 0, y: 0, z: 0, w: 1} m_ApplyOffsets: 0 --- !u!114 &6719764240001799943 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3} m_Name: ActivationPlayableAsset m_EditorClassIdentifier: --- !u!114 &7813227247032803116 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 15e0374501f39d54eb30235764636e0e, type: 3} m_Name: Planet Ouverture m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -4276188729828789569} m_Children: [] m_Clips: - m_Version: 1 m_Start: 2.816666666666667 m_ClipIn: 0 m_Asset: {fileID: -5377480320652254031} m_Duration: 1.5166666666680002 m_TimeScale: 1 m_ParentTrack: {fileID: 7813227247032803116} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: ARUI-Planet-Ouverture m_Markers: m_Objects: [] --- !u!114 &8136993665081925336 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: EX138 - Gas Giant m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: -6349543820349708053} - {fileID: -9046611798479816016} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &8178033680129618112 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 48853ae485fa386428341ac1ea122570, type: 3} m_Name: ControlPlayableAsset m_EditorClassIdentifier: sourceGameObject: exposedName: 778eea32923a47748bdf0189d9b68692 defaultValue: {fileID: 0} prefabGameObject: {fileID: 0} updateParticle: 1 particleRandomSeed: 9619 updateDirector: 1 updateITimeControl: 1 searchHierarchy: 1 active: 1 postPlayback: 2 --- !u!74 &8197540523042625037 AnimationClip: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Recorded serializedVersion: 6 m_Legacy: 0 m_Compressed: 0 m_UseHighQualityCurve: 1 m_RotationCurves: [] m_CompressedRotationCurves: [] m_EulerCurves: [] m_PositionCurves: [] m_ScaleCurves: [] m_FloatCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1 value: 400 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: displayLightIntensity path: classID: 114 script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_PPtrCurves: [] m_SampleRate: 60 m_WrapMode: 0 m_Bounds: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: genericBindings: - serializedVersion: 2 path: 0 attribute: 3531187776 script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 m_StopTime: 1 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 m_LoopBlendPositionXZ: 0 m_KeepOriginalOrientation: 0 m_KeepOriginalPositionY: 1 m_KeepOriginalPositionXZ: 0 m_HeightFromFeet: 0 m_Mirror: 0 m_EditorCurves: - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1 value: 400 inSlope: 0 outSlope: 0 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 attribute: displayLightIntensity path: classID: 114 script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_EulerEditorCurves: [] m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_Events: [] --- !u!114 &8448631576589797237 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 48853ae485fa386428341ac1ea122570, type: 3} m_Name: ControlPlayableAsset m_EditorClassIdentifier: sourceGameObject: exposedName: 45062d232f60ff8498148c54e9f1f6a9 defaultValue: {fileID: 0} prefabGameObject: {fileID: 0} updateParticle: 1 particleRandomSeed: 9743 updateDirector: 1 updateITimeControl: 1 searchHierarchy: 1 active: 1 postPlayback: 2 --- !u!114 &8547488202701244938 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0fc6f5187a81dc47999eefade6f0935, type: 3} m_Name: K-1378 - Dead Ice m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: 11400000} m_Children: - {fileID: 6036547964693075452} - {fileID: -6030766291990254605} m_Clips: [] m_Markers: m_Objects: [] --- !u!114 &8989000213787986946 MonoBehaviour: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 15e0374501f39d54eb30235764636e0e, type: 3} m_Name: 'Planet Ouverture ' m_EditorClassIdentifier: m_Version: 3 m_AnimClip: {fileID: 0} m_Locked: 0 m_Muted: 0 m_CustomPlayableFullTypename: m_Curves: {fileID: 0} m_Parent: {fileID: -1738274317691592606} m_Children: [] m_Clips: - m_Version: 1 m_Start: 2.3333333333333335 m_ClipIn: 0 m_Asset: {fileID: 889022650376349026} m_Duration: 1.5333333333346668 m_TimeScale: 1 m_ParentTrack: {fileID: 8989000213787986946} m_EaseInDuration: 0 m_EaseOutDuration: 0 m_BlendInDuration: 0 m_BlendOutDuration: 0 m_MixInCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 value: 0 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 m_BlendInCurveMode: 0 m_BlendOutCurveMode: 0 m_ExposedParameterNames: [] m_AnimationCurves: {fileID: 0} m_Recordable: 0 m_PostExtrapolationMode: 0 m_PreExtrapolationMode: 0 m_PostExtrapolationTime: 0 m_PreExtrapolationTime: 0 m_DisplayName: ARUI-Planet-Ouverture m_Markers: m_Objects: []
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" language="groovy" pageWidth="612" pageHeight="935" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.2100000000000088"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="namars" class="java.lang.String"/> <parameter name="alamatrs" class="java.lang.String"/> <parameter name="kotars" class="java.lang.String"/> <parameter name="propinsirs" class="java.lang.String"/> <parameter name="kontakrs" class="java.lang.String"/> <parameter name="emailrs" class="java.lang.String"/> <parameter name="logo" class="java.io.InputStream"/> <queryString> <![CDATA[select pasien.no_rkm_medis, pasien.nm_pasien, pasien.no_ktp, pasien.jk, pasien.tmp_lahir, pasien.tgl_lahir,pasien.nm_ibu, concat(pasien.alamat,', ',kelurahan.nm_kel,', ',kecamatan.nm_kec,', ',kabupaten.nm_kab) as alamat, pasien.gol_darah, pasien.pekerjaan, pasien.stts_nikah,pasien.agama,pasien.tgl_daftar,pasien.no_tlp,pasien.umur, pasien.pnd, pasien.keluarga, pasien.namakeluarga,penjab.png_jawab,pasien.pekerjaanpj, concat(pasien.alamatpj,', ',pasien.kelurahanpj,', ',pasien.kecamatanpj,', ',pasien.kabupatenpj) as alamatpj from pasien inner join kelurahan inner join kecamatan inner join kabupaten inner join penjab on pasien.kd_pj=penjab.kd_pj and pasien.kd_kel=kelurahan.kd_kel and pasien.kd_kec=kecamatan.kd_kec and pasien.kd_kab=kabupaten.kd_kab]]> </queryString> <field name="no_rkm_medis" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="nm_pasien" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="no_ktp" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="jk" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="tmp_lahir" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="tgl_lahir" class="java.sql.Date"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="nm_ibu" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="alamat" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="gol_darah" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="pekerjaan" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="stts_nikah" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="agama" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="tgl_daftar" class="java.sql.Date"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="no_tlp" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="umur" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="pnd" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="keluarga" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="namakeluarga" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="png_jawab" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="pekerjaanpj" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="alamatpj" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <background> <band/> </background> <title> <band height="895"> <textField> <reportElement mode="Transparent" x="211" y="217" width="338" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{nm_pasien}]]></textFieldExpression> </textField> <line> <reportElement x="42" y="74" width="508" height="1"/> <graphicElement> <pen lineWidth="1.75" lineStyle="Double"/> </graphicElement> </line> <staticText> <reportElement x="48" y="217" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Nama Lengkap]]></text> </staticText> <image scaleImage="FillFrame" onErrorType="Blank"> <reportElement x="48" y="18" width="51" height="51"/> <imageExpression class="java.io.InputStream"><![CDATA[$P{logo}]]></imageExpression> </image> <textField> <reportElement x="112" y="56" width="439" height="14"/> <textElement lineSpacing="Single"> <font fontName="Tahoma" size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["E-mail : "+$P{emailrs}]]></textFieldExpression> </textField> <textField> <reportElement x="112" y="45" width="439" height="14"/> <textElement lineSpacing="Single"> <font fontName="Tahoma" size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{kontakrs}]]></textFieldExpression> </textField> <textField> <reportElement x="112" y="18" width="439" height="17"/> <textElement lineSpacing="Single"> <font fontName="Tahoma" size="14"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{namars}]]></textFieldExpression> </textField> <textField> <reportElement x="112" y="34" width="439" height="14"/> <textElement lineSpacing="Single"> <font fontName="Tahoma" size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{alamatrs}+", "+$P{kotars}+", "+$P{propinsirs}]]></textFieldExpression> </textField> <staticText> <reportElement x="42" y="82" width="509" height="18"/> <textElement textAlignment="Center" verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="12" isBold="true"/> </textElement> <text><![CDATA[RINGKASAN MASUK - KELUAR PASIEN]]></text> </staticText> <staticText> <reportElement x="204" y="217" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="204" y="157" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="48" y="157" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[No. Rekam Medis]]></text> </staticText> <staticText> <reportElement x="204" y="236" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="48" y="236" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Umur]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="236" width="86" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{umur}]]></textFieldExpression> </textField> <textField> <reportElement mode="Transparent" x="436" y="236" width="113" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{jk}.replaceAll("L","Lk").replaceAll("P","Pr")]]></textFieldExpression> </textField> <staticText> <reportElement x="429" y="236" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="352" y="236" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Jenis Kelamin]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="369" width="340" height="40"/> <textElement verticalAlignment="Top" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{alamat}+" "+$F{no_tlp}]]></textFieldExpression> </textField> <staticText> <reportElement x="204" y="369" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="48" y="369" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Alamat Lengkap & Telepon]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="350" width="287" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{png_jawab}]]></textFieldExpression> </textField> <staticText> <reportElement x="204" y="350" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="48" y="350" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Asuransi / Instansi]]></text> </staticText> <staticText> <reportElement x="48" y="121" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Kamar]]></text> </staticText> <staticText> <reportElement x="204" y="121" width="345" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................................. Pindah : .............................]]></text> </staticText> <staticText> <reportElement x="48" y="139" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Tanggal Masuk]]></text> </staticText> <staticText> <reportElement x="204" y="139" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField pattern="dd/MM/yyyy"> <reportElement mode="Transparent" x="211" y="139" width="287" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression> </textField> <componentElement> <reportElement x="211" y="157" width="200" height="27"/> <jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="Code128" drawText="false" checksumRequired="false" barHeight="50"> <jr:codeExpression><![CDATA[$F{no_rkm_medis}]]></jr:codeExpression> </jr:barbecue> </componentElement> <staticText> <reportElement x="48" y="255" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Tempat Tanggal Lahir]]></text> </staticText> <staticText> <reportElement x="204" y="255" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="255" width="141" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{tmp_lahir}]]></textFieldExpression> </textField> <textField pattern="dd/MM/yyyy"> <reportElement mode="Transparent" x="352" y="255" width="141" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[$F{tgl_lahir}]]></textFieldExpression> </textField> <staticText> <reportElement x="204" y="274" width="148" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ......................................]]></text> </staticText> <staticText> <reportElement x="48" y="274" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Nama Suami/Ayah]]></text> </staticText> <staticText> <reportElement x="352" y="274" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Nama Ibu]]></text> </staticText> <staticText> <reportElement x="429" y="274" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField> <reportElement mode="Transparent" x="436" y="274" width="113" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{nm_ibu}]]></textFieldExpression> </textField> <staticText> <reportElement x="429" y="293" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField> <reportElement mode="Transparent" x="436" y="293" width="113" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{keluarga}]]></textFieldExpression> </textField> <staticText> <reportElement x="48" y="293" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Nama Penanggung Jawab]]></text> </staticText> <staticText> <reportElement x="352" y="293" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Hubungan]]></text> </staticText> <staticText> <reportElement x="204" y="293" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="293" width="141" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{namakeluarga}]]></textFieldExpression> </textField> <staticText> <reportElement x="48" y="312" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Agama]]></text> </staticText> <staticText> <reportElement x="429" y="312" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField> <reportElement mode="Transparent" x="436" y="312" width="113" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{stts_nikah}]]></textFieldExpression> </textField> <staticText> <reportElement x="204" y="312" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="352" y="312" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Status Kawin]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="312" width="141" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{agama}]]></textFieldExpression> </textField> <staticText> <reportElement x="48" y="331" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Pekerjaan]]></text> </staticText> <staticText> <reportElement x="204" y="331" width="5" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[:]]></text> </staticText> <textField> <reportElement mode="Transparent" x="211" y="331" width="287" height="14"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="11" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{pekerjaan}]]></textFieldExpression> </textField> <staticText> <reportElement x="204" y="420" width="347" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ..................................................................................................]]></text> </staticText> <staticText> <reportElement x="48" y="420" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Anamnesa Umum]]></text> </staticText> <staticText> <reportElement x="204" y="439" width="347" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ..................................................................................................]]></text> </staticText> <staticText> <reportElement x="48" y="466" width="156" height="18"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="12" isBold="true"/> </textElement> <text><![CDATA[PEMERIKSAAN KHUSUS]]></text> </staticText> <staticText> <reportElement x="204" y="466" width="160" height="18"/> <textElement verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Tahoma" size="12" isBold="true"/> </textElement> <text><![CDATA[:]]></text> </staticText> <staticText> <reportElement x="48" y="497" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Keadaan Umum]]></text> </staticText> <staticText> <reportElement x="204" y="497" width="148" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ......................................]]></text> </staticText> <staticText> <reportElement x="352" y="497" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Kesadaran]]></text> </staticText> <staticText> <reportElement x="429" y="497" width="122" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="48" y="516" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Tanda Vital]]></text> </staticText> <staticText> <reportElement x="204" y="516" width="14" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ]]></text> </staticText> <staticText> <reportElement x="352" y="516" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[TB]]></text> </staticText> <staticText> <reportElement x="429" y="516" width="122" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="218" y="516" width="40" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[BB]]></text> </staticText> <staticText> <reportElement x="258" y="516" width="94" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: .......................]]></text> </staticText> <staticText> <reportElement x="258" y="536" width="94" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: .......................]]></text> </staticText> <staticText> <reportElement x="352" y="536" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Temp.]]></text> </staticText> <staticText> <reportElement x="218" y="536" width="40" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[TD]]></text> </staticText> <staticText> <reportElement x="429" y="536" width="122" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="258" y="556" width="94" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: .......................]]></text> </staticText> <staticText> <reportElement x="218" y="556" width="40" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Nadi]]></text> </staticText> <staticText> <reportElement x="352" y="556" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Respirasi]]></text> </staticText> <staticText> <reportElement x="429" y="556" width="122" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="48" y="576" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Lain-lain / Keterangan]]></text> </staticText> <staticText> <reportElement x="204" y="576" width="347" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: .................................................................................................]]></text> </staticText> <staticText> <reportElement x="204" y="612" width="347" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: 1. ..............................................................................................]]></text> </staticText> <staticText> <reportElement x="48" y="612" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Dokter yang merawat]]></text> </staticText> <staticText> <reportElement x="204" y="632" width="347" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: 2. ..............................................................................................]]></text> </staticText> <staticText> <reportElement x="48" y="666" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Diagnosa Awal]]></text> </staticText> <staticText> <reportElement x="204" y="666" width="148" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ......................................]]></text> </staticText> <staticText> <reportElement x="352" y="666" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Kode]]></text> </staticText> <staticText> <reportElement x="429" y="666" width="121" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="352" y="686" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Kode]]></text> </staticText> <staticText> <reportElement x="48" y="686" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Diagnosa Utama]]></text> </staticText> <staticText> <reportElement x="204" y="686" width="148" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ......................................]]></text> </staticText> <staticText> <reportElement x="429" y="686" width="121" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="48" y="706" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Diagnosa Tambahan]]></text> </staticText> <staticText> <reportElement x="352" y="706" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Kode]]></text> </staticText> <staticText> <reportElement x="204" y="706" width="148" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ......................................]]></text> </staticText> <staticText> <reportElement x="429" y="706" width="121" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="352" y="727" width="77" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Kode]]></text> </staticText> <staticText> <reportElement x="204" y="727" width="148" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ......................................]]></text> </staticText> <staticText> <reportElement x="48" y="727" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Operasi / Tindakan]]></text> </staticText> <staticText> <reportElement x="429" y="727" width="121" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: ................................]]></text> </staticText> <staticText> <reportElement x="48" y="747" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Tanggal Pulang]]></text> </staticText> <staticText> <reportElement x="204" y="747" width="345" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: .................................................................................................]]></text> </staticText> <staticText> <reportElement x="48" y="767" width="156" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[Hasil]]></text> </staticText> <staticText> <reportElement x="204" y="767" width="345" height="14"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Tahoma" size="11"/> </textElement> <text><![CDATA[: Sembuh / Dirujuk / Meninggal < 48 jam / Meninggal > 48 jam]]></text> </staticText> <textField> <reportElement mode="Transparent" x="228" y="184" width="183" height="29"/> <textElement verticalAlignment="Top" lineSpacing="Single"> <font fontName="Tahoma" size="23" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{no_rkm_medis}]]></textFieldExpression> </textField> </band> </title> </jasperReport>
{ "pile_set_name": "Github" }
'use strict'; if (!require('./is-implemented')()) { Object.defineProperty(require('es5-ext/global'), 'Symbol', { value: require('./polyfill'), configurable: true, enumerable: false, writable: true }); }
{ "pile_set_name": "Github" }
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import {SecurityException} from '../exception/security_exception'; import * as PrimitiveSet from '../internal/primitive_set'; import {PrimitiveWrapper} from '../internal/primitive_wrapper'; import * as Bytes from '../subtle/bytes'; import * as Validators from '../subtle/validators'; import {PublicKeySign} from './internal/public_key_sign'; /** * @final */ class WrappedPublicKeySign extends PublicKeySign { // The constructor should be @private, but it is not supported by Closure // (see https://github.com/google/closure-compiler/issues/2761). constructor(private readonly primitiveSet: PrimitiveSet.PrimitiveSet<PublicKeySign>) { super(); } static newPublicKeySign( primitiveSet: PrimitiveSet.PrimitiveSet<PublicKeySign>): PublicKeySign { if (!primitiveSet) { throw new SecurityException('Primitive set has to be non-null.'); } if (!primitiveSet.getPrimary()) { throw new SecurityException('Primary has to be non-null.'); } return new WrappedPublicKeySign(primitiveSet); } /** @override */ async sign(data: Uint8Array) { Validators.requireUint8Array(data); const primary = this.primitiveSet.getPrimary(); if (!primary) { throw new SecurityException('Primary not set.'); } const primitive = primary.getPrimitive(); const signature = await primitive.sign(data); const keyId = primary.getIdentifier(); return Bytes.concat(keyId, signature); } } export class PublicKeySignWrapper implements PrimitiveWrapper<PublicKeySign> { /** * @override */ wrap(primitiveSet: PrimitiveSet.PrimitiveSet<PublicKeySign>) { return WrappedPublicKeySign.newPublicKeySign(primitiveSet); } /** * @override */ getPrimitiveType() { return PublicKeySign; } }
{ "pile_set_name": "Github" }
============== Viewing Issues ============== Get-JiraIssue is the primary tool for getting information about existing issues in JIRA - whether you're looking for a single issue or all issues matching a certain criteria. * :ref:`Get Issue` * :ref:`Search Issues` .. _Get Issue: Getting a Specific Issue ======================== If you know exactly what issue you're looking for, there are two ways to return information about it using Get-JiraIssue. Issue Key --------- The simplest way to get info about an issue is using the issue's key. This is quite straightforward: .. code:: PowerShell Get-JiraIssue -Key 'TEST-1' Issue ID -------- JIRA issues also contain an internal ID number. This ID is not exposed in the Web interface, but you can also use it to reference an issue. .. code:: PowerShell Get-JiraIssue 10016 You probably won't use this method very much, but it's available. .. _Search Issues: Searching For Issues ==================== To search for an issue in JIRA, you'll need to dip into `JIRA Query Language`_ a little bit. JQL is a structured query language used to search for issues in JIRA that match a given criteria, but it uses a very different syntax from SQL. One of the easiest ways to build a JQL query is to use the search functions in JIRA's Web interface, then click the "Advanced" button to switch your search query from interactive buttons to a long string. This will show you the raw JQL for your current search, which can be copied and pasted directly into the -Query parameter here. .. code:: PowerShell # Issues created in the last week Get-JiraIssue -Query "created >= -7d" # Issues created by replicaJunction in the last week Get-JiraIssue -Query "created >= -7d AND reporter in (replicaJunction)" For more information on using JQL, see Atlassian's article on `JIRA Query Language`_. Paging Through a Search ----------------------- By default, when you use JQL to pull data from JIRA, it will return all issues that match the given criteria. If you use a query that returns a large number of issues (for example, "all issues created after January 1, 2000"), this can take quite some time. You can use the -StartIndex and -MaxResults parameters to "page" through all search results in smaller chunks. .. code:: PowerShell # This is a pretty generic query that will probably return a lot of issues. $query = 'created >= 2000-01-01' # Return the first 50 search results... Get-JiraIssue -Query $query -MaxResults 50 # ...and the next 25 after that. Get-JiraIssue -Query $query -MaxResults 25 -StartIndex 50 .. _JIRA Query Language: https://confluence.atlassian.com/jiracoreserver072/advanced-searching-829092661.html
{ "pile_set_name": "Github" }
<script> $(document).ready(function () { var table = table_main("#node_table"); $("#all").click(function () { //select all button $('.selectedId').prop('checked', !$('.selectedId').prop('checked')); var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length); $('#select-count').text($('.selectedId').filter(":checked").length); $('#selectall').prop("checked", check); disable_buttons('#selectall'); }); var pageselect = localStorage.getItem('page-select') || '30'; $("#pageselect").val(pageselect); $("#batch-spam").bind('click', function (e) { //batch spam batch_nav("batch_spam"); }); $("#batch-publish").bind('click', function (e) { //batch publish batch_nav("batch_publish"); }); $("#batch-ban").bind('click', function (e) { //batch ban batch_nav("batch_ban"); }); $("#batch-unban").bind('click', function (e) { //batch unban batch_nav("batch_unban"); }); $("#delete-batch").bind('click', function (e) { // batch delete batch_nav("batch_delete"); }); $('#pageselect').change(function () { pagination("#pageselect", "/spam2/filter/"); }); $('#spammed').on('click', function () { //spam filter search_table("spammed", "/spam2/filter/"); }); $('#unmoderated').on('click', function () { // unmoderated filter search_table("unmoderated", "/spam2/filter/"); }); $('#published').on('click', function () { // published filter search_table("published", "/spam2/filter/"); }); $('#reset_all').on('click', function () { // reset all filter search_table("all", "/spam2/filter/"); }); $('#created').on('click', function () { // Created_at filter search_table("created", "/spam2/filter/"); }); }); </script> <div class="card" id="table-card"> <div class="bg-light navbar navbar-expand"> <ul class="nav navbar-expand navbar-nav-scroll"> <li class="nav-item"> <a class="btn nav-link text-secondary" data-toggle="tooltip" data-placement="top" title="Selected per page"> Selected <span id="select-count" class="badge badge-dark">0</span></a> </li> <li class="nav-item"> <a id="reset_all" class="btn nav-link <% if params[:type] == "all" %> active<% else %> text-secondary<% end %>"><i class="fa fa-arrow-circle-o-up <% if params[:type] == "all" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="Latest updated Nodes"></i> New Activity </a> </li> <% if params[:type] != "wiki" %> <li class="nav-item"> <a id="created" class="btn nav-link <% if params[:type] == "created" %> active <% else %> text-secondary <% end %>"><i class="fa fa-list-ol <% if params[:type] == "created" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="Order as per their creation time "></i> Recent </a> </li> <li class="nav-item"> <a id="spammed" class="btn nav-link <% if params[:type] == "spammed" %> active <% else %> text-secondary <% end %>"> <i class="fa fa-ban <% if params[:type] == "spammed" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="Filter all Spammed Nodes "></i> Spammed <span class="badge badge-dark"><%= Node.where(status: 0).length %></span></a> </li> <li class="nav-item"> <a id="unmoderated" class="btn nav-link <% if params[:type] == "unmoderated" %> active <% else %> text-secondary <% end %>"> <i class="fa fa-exclamation-circle <% if params[:type] == "unmoderated" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="Filter all unmoderated Nodes"></i> Unmoderated</a> </li> <li class="nav-item"> <a id="published" class="btn nav-link <% if params[:type] == "published" %> active <% else %> text-secondary <% end %>"> <i class="fa fa-check-circle <% if params[:type] == "published" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="Filter all Published Nodes"></i> Published</a> </li> <% end %> </ul> </div> <div class="card-body" style="overflow-x:hidden;"> <% unless @nodes.empty? %> <div class="my-0 text-secondary small "><%= page_entries_info(@nodes) %>s</div> <% end %> <table id="node_table" class="nowrap table table-hover" style="width:100%; text-align:left"> <thead style="text-align:left;"> <tr> <th><input type="checkbox" id="selectall"/></th> <th>Title</th> <th>Author</th> <th>Status</th> <th><% if params[:type] == "created"%>Created at <% else %> Updated at <% end %></th> <th>Action</th> </tr> </thead> <tbody> <% @nodes.each do |node| %> <tr id="n<%= node.id %>"> <td><input class="selectedId" value="<%= node.nid %>" type="checkbox" /></td> <td> <i class="fa fa-file text-secondary"></i> <a href="javascript:void(0);" class="text-dark font-weight-bold" id="node-hover" data-toggle="modal" data-target="#ninfo<%= node.id %>"><%= node.title.truncate(15) %></a><br /> <span class="text-secondary small"><%= node.type.capitalize %> | <% if params[:type] == "created"%><%= time_ago_in_words(node.updated_at) %><% else %><%= time_ago_in_words(node.created_at) %><% end %> ago</span> </td> <td> <a href="/profile/<%= node.author&.name %>" class="text-info"><%= node.author&.name.truncate(15) %> </a><br> <span class="text-secondary small"><%= Node.where(uid: node.author&.id).count %> Nodes<span> <%= node.author&.new_contributor%> </td> <td> <% if node.status == 1 %><span class="badge badge-success"><i class="fa fa-check-circle text-white"></i> Published</span><% elsif node.status == 0 %><span class="badge badge-danger"><i class="fa fa-ban text-white"></i> Spammed</span><% elsif node.status == 4 %><span class="badge badge-primary"><i class="fa fa-circle text-white"></i> Unmoderated</span><% end %> </td> <td> <span class="text-dark"><% if params[:type] == "created" %><%= time_ago_in_words(node.created_at) %> <% else %><%= time_ago_in_words(node.updated_at) %> <% end %> ago</span> </td> <td> <a class="btn btn-xs border-curve font-weight-bold btn<% if node.status != 1 %>-success<% else %>-secondary disabled<% end %> publish" data-remote="true" href="/moderate/publish/<%= node.id %>" ><i class="fa fa-check-circle fa-white"></i> Publish post</a> <a class="btn btn-xs border-curve font-weight-bold btn<% if node.status != 0 %>-danger<% else %>-secondary disabled<% end %> spam" data-remote="true" href="/moderate/spam/<%= node.id %>"><i class="fa fa-ban fa-white"></i> Spam post</a> <a class="btn btn-xs border-curve font-weight-bold btn-secondary ban a<%= node.author.id %>" <% if node.author.status == 0 %>style="display:none;"<% end %> data-remote="true" href="/ban/<%= node.author.id %>">Ban user</a> <a class="btn btn-xs border-curve font-weight-bold btn-secondary unban a-unban<%= node.author.id %>" <% if node.author.status == 1 %>style="display:none;"<% end %> data-remote="true" href="/unban/<%= node.author.id %>">Unban user</a> <%= link_to "/notes/delete/#{node.id}", data: { confirm: "Are you sure you want to delete #{node.path}?" }, :remote => true, :class => "btn border-curve btn-sm font-weight-bold btn-light delete" do %> <i class="fa fa-trash text-dark"></i> <% end %> <script> $('#n<%= node.id %> .delete').bind('ajax:success', function(e){ $('#n<%= node.id %>').fadeOut() notyNotification('relax', 3000, 'danger', 'topRight', 'Node deleted'); }); $('#n<%= node.id %> .publish').bind('ajax:success', function(e){ $('#n<%= node.id %>').hide() notyNotification('relax', 3000, 'success', 'topRight', 'Node published'); }); $('#n<%= node.id %> .spam').bind('ajax:success', function(e){ $('#n<%= node.id %>').hide() notyNotification('relax', 3000, 'danger', 'topRight', 'Node spammed'); }); $('.a<%= node.author.id %>.ban').bind('ajax:success', function(e){ $('.a<%= node.author.id %>').hide() // ban toggle $('.a-unban<%= node.author.id %>').show() notyNotification('relax', 3000, 'danger', 'topRight', 'Author banned'); }); $('.a-unban<%= node.author.id %>.unban').bind('ajax:success', function(e){ $('.a-unban<%= node.author.id %>').hide() $('.a<%= node.author.id %>').show() notyNotification('relax', 3000, 'success', 'topRight', 'Author unbanned'); }); </script> </td> </tr> <div class="modal fade" id="ninfo<%= node.id %>"> <div class="modal-dialog" > <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title"><a href="<%= node.path %>"><%= node.title %></a></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span>&times;</span> </button> </div> <div class="modal-body"> <% if node.tags.length>0 %> <div class="mb-2"> <% node.tags.limit(4).each do |tag| %> <%= link_to tag.name, tag_path(tag.name), class: 'badge badge-primary' %> <% end %> </div> <% end %> <%= node.body %> </div> <div class="modal-footer"> <%= time_ago_in_words(node.created_at) %> ago </div> </div> </div> </div> <% end %> </tbody> </table> </div> </div> </div> <div class="page-table"> <div class="float-right"> <%= will_paginate @nodes, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated || @nodes.empty? %> </div> <div class="float-left text-secondary"> <% unless @nodes.empty? %> Page number <%= @nodes.current_page %> of <%= @nodes.total_pages %> total Pages <% end %> </div> </div>
{ "pile_set_name": "Github" }
var expect = require('expect.js'); var request = require('request'); var fixtures = require('./fixtures'); describe('DEL plural', function () { before(fixtures.vegetable.init); beforeEach(fixtures.vegetable.create); after(fixtures.vegetable.deinit); it('should delete all documents in addressed collection', function (done) { var options = { url: 'http://localhost:8012/api/vegetables/', json: true }; request.del(options, function (err, response, body) { if (err) return done(err); expect(response.statusCode).to.be(200); // Check that the correct number were deleted. expect(body).to.be(8); done(); }); }); it('should invoke "remove" middleware', function (done) { var options = { url: 'http://localhost:8012/api/vegetables/', json: true }; fixtures.vegetable.removeCount = 0; request.del(options, function (error, response, body) { if (error) return done(error); expect(fixtures.vegetable).to.have.property('removeCount', 8); done(); }); }); });
{ "pile_set_name": "Github" }
// // Prefix header for all source files of the 'Camera' target in the 'Camera' project // #ifdef __OBJC__ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #endif
{ "pile_set_name": "Github" }
/** * @author David Gossow - [email protected] */ /** * The main interactive marker object. * * @constructor * @param options - object with following keys: * * * handle - the ROS3D.InteractiveMarkerHandle for this marker * * camera - the main camera associated with the viewer for this marker * * path (optional) - the base path to any meshes that will be loaded * * loader (optional) - the Collada loader to use (e.g., an instance of ROS3D.COLLADA_LOADER) */ ROS3D.InteractiveMarker = function(options) { THREE.Object3D.call(this); var that = this; options = options || {}; var handle = options.handle; this.name = handle.name; var camera = options.camera; var path = options.path || '/'; var loader = options.loader; this.dragging = false; // set the initial pose this.onServerSetPose({ pose : handle.pose }); // information on where the drag started this.dragStart = { position : new THREE.Vector3(), orientation : new THREE.Quaternion(), positionWorld : new THREE.Vector3(), orientationWorld : new THREE.Quaternion(), event3d : {} }; // add each control message handle.controls.forEach(function(controlMessage) { that.add(new ROS3D.InteractiveMarkerControl({ parent : that, handle : handle, message : controlMessage, camera : camera, path : path, loader : loader })); }); // check for any menus if (handle.menuEntries.length > 0) { this.menu = new ROS3D.InteractiveMarkerMenu({ menuEntries : handle.menuEntries, menuFontSize : handle.menuFontSize }); // forward menu select events this.menu.addEventListener('menu-select', function(event) { that.dispatchEvent(event); }); } }; ROS3D.InteractiveMarker.prototype.__proto__ = THREE.Object3D.prototype; /** * Show the interactive marker menu associated with this marker. * * @param control - the control to use * @param event - the event that caused this */ ROS3D.InteractiveMarker.prototype.showMenu = function(control, event) { if (this.menu) { this.menu.show(control, event); } }; /** * Move the axis based on the given event information. * * @param control - the control to use * @param origAxis - the origin of the axis * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.moveAxis = function(control, origAxis, event3d) { if (this.dragging) { var currentControlOri = control.currentControlOri; var axis = origAxis.clone().applyQuaternion(currentControlOri); // get move axis in world coords var originWorld = this.dragStart.event3d.intersection.point; var axisWorld = axis.clone().applyQuaternion(this.dragStart.orientationWorld.clone()); var axisRay = new THREE.Ray(originWorld, axisWorld); // find closest point to mouse on axis var t = ROS3D.closestAxisPoint(axisRay, event3d.camera, event3d.mousePos); // offset from drag start position var p = new THREE.Vector3(); p.addVectors(this.dragStart.position, axis.clone().applyQuaternion(this.dragStart.orientation) .multiplyScalar(t)); this.setPosition(control, p); event3d.stopPropagation(); } }; /** * Move with respect to the plane based on the contorl and event. * * @param control - the control to use * @param origNormal - the normal of the origin * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.move3d = function(control, origNormal, event3d) { // by default, move in a plane if (this.dragging) { if(control.isShift){ // this doesn't work // // use the camera position and the marker position to determine the axis // var newAxis = control.camera.position.clone(); // newAxis.sub(this.position); // // now mimic same steps constructor uses to create origAxis // var controlOri = new THREE.Quaternion(newAxis.x, newAxis.y, // newAxis.z, 1); // controlOri.normalize(); // var controlAxis = new THREE.Vector3(1, 0, 0); // controlAxis.applyQuaternion(controlOri); // origAxis = controlAxis; }else{ // we want to use the origin plane that is closest to the camera var cameraVector = control.camera.getWorldDirection(); var x = Math.abs(cameraVector.x); var y = Math.abs(cameraVector.y); var z = Math.abs(cameraVector.z); var controlOri = new THREE.Quaternion(1, 0, 0, 1); if(y > x && y > z){ // orientation for the control controlOri = new THREE.Quaternion(0, 0, 1, 1); }else if(z > x && z > y){ // orientation for the control controlOri = new THREE.Quaternion(0, 1, 0, 1); } controlOri.normalize(); // transform x axis into local frame origNormal = new THREE.Vector3(1, 0, 0); origNormal.applyQuaternion(controlOri); this.movePlane(control, origNormal, event3d); } } }; /** * Move with respect to the plane based on the contorl and event. * * @param control - the control to use * @param origNormal - the normal of the origin * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.movePlane = function(control, origNormal, event3d) { if (this.dragging) { var currentControlOri = control.currentControlOri; var normal = origNormal.clone().applyQuaternion(currentControlOri); // get plane params in world coords var originWorld = this.dragStart.event3d.intersection.point; var normalWorld = normal.clone().applyQuaternion(this.dragStart.orientationWorld); // intersect mouse ray with plane var intersection = ROS3D.intersectPlane(event3d.mouseRay, originWorld, normalWorld); // offset from drag start position var p = new THREE.Vector3(); p.subVectors(intersection, originWorld); p.add(this.dragStart.positionWorld); this.setPosition(control, p); event3d.stopPropagation(); } }; /** * Rotate based on the control and event given. * * @param control - the control to use * @param origOrientation - the orientation of the origin * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.rotateAxis = function(control, origOrientation, event3d) { if (this.dragging) { control.updateMatrixWorld(); var currentControlOri = control.currentControlOri; var orientation = currentControlOri.clone().multiply(origOrientation.clone()); var normal = (new THREE.Vector3(1, 0, 0)).applyQuaternion(orientation); // get plane params in world coords var originWorld = this.dragStart.event3d.intersection.point; var normalWorld = normal.applyQuaternion(this.dragStart.orientationWorld); // intersect mouse ray with plane var intersection = ROS3D.intersectPlane(event3d.mouseRay, originWorld, normalWorld); // offset local origin to lie on intersection plane var normalRay = new THREE.Ray(this.dragStart.positionWorld, normalWorld); var rotOrigin = ROS3D.intersectPlane(normalRay, originWorld, normalWorld); // rotates from world to plane coords var orientationWorld = this.dragStart.orientationWorld.clone().multiply(orientation); var orientationWorldInv = orientationWorld.clone().inverse(); // rotate original and current intersection into local coords intersection.sub(rotOrigin); intersection.applyQuaternion(orientationWorldInv); var origIntersection = this.dragStart.event3d.intersection.point.clone(); origIntersection.sub(rotOrigin); origIntersection.applyQuaternion(orientationWorldInv); // compute relative 2d angle var a1 = Math.atan2(intersection.y, intersection.z); var a2 = Math.atan2(origIntersection.y, origIntersection.z); var a = a2 - a1; var rot = new THREE.Quaternion(); rot.setFromAxisAngle(normal, a); // rotate this.setOrientation(control, rot.multiply(this.dragStart.orientationWorld)); // offset from drag start position event3d.stopPropagation(); } }; /** * Dispatch the given event type. * * @param type - the type of event * @param control - the control to use */ ROS3D.InteractiveMarker.prototype.feedbackEvent = function(type, control) { this.dispatchEvent({ type : type, position : this.position.clone(), orientation : this.quaternion.clone(), controlName : control.name }); }; /** * Start a drag action. * * @param control - the control to use * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.startDrag = function(control, event3d) { if (event3d.domEvent.button === 0) { event3d.stopPropagation(); this.dragging = true; this.updateMatrixWorld(true); var scale = new THREE.Vector3(); this.matrixWorld .decompose(this.dragStart.positionWorld, this.dragStart.orientationWorld, scale); this.dragStart.position = this.position.clone(); this.dragStart.orientation = this.quaternion.clone(); this.dragStart.event3d = event3d; this.feedbackEvent('user-mousedown', control); } }; /** * Stop a drag action. * * @param control - the control to use * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.stopDrag = function(control, event3d) { if (event3d.domEvent.button === 0) { event3d.stopPropagation(); this.dragging = false; this.dragStart.event3d = {}; this.onServerSetPose(this.bufferedPoseEvent); this.bufferedPoseEvent = undefined; this.feedbackEvent('user-mouseup', control); } }; /** * Handle a button click. * * @param control - the control to use * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.buttonClick = function(control, event3d) { event3d.stopPropagation(); this.feedbackEvent('user-button-click', control); }; /** * Handle a user pose change for the position. * * @param control - the control to use * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.setPosition = function(control, position) { this.position.copy(position); this.feedbackEvent('user-pose-change', control); }; /** * Handle a user pose change for the orientation. * * @param control - the control to use * @param event3d - the event that caused this */ ROS3D.InteractiveMarker.prototype.setOrientation = function(control, orientation) { orientation.normalize(); this.quaternion.copy(orientation); this.feedbackEvent('user-pose-change', control); }; /** * Update the marker based when the pose is set from the server. * * @param event - the event that caused this */ ROS3D.InteractiveMarker.prototype.onServerSetPose = function(event) { if (event !== undefined) { // don't update while dragging if (this.dragging) { this.bufferedPoseEvent = event; } else { var pose = event.pose; this.position.copy(pose.position); this.quaternion.copy(pose.orientation); this.updateMatrixWorld(true); } } }; /** * Free memory of elements in this marker. */ ROS3D.InteractiveMarker.prototype.dispose = function() { var that = this; this.children.forEach(function(intMarkerControl) { intMarkerControl.children.forEach(function(marker) { marker.dispose(); intMarkerControl.remove(marker); }); that.remove(intMarkerControl); }); }; Object.assign(ROS3D.InteractiveMarker.prototype, THREE.EventDispatcher.prototype);
{ "pile_set_name": "Github" }
/** * @file * CKEditor button and group configuration user interface. */ (function($, Drupal, drupalSettings, _) { Drupal.ckeditor = Drupal.ckeditor || {}; /** * Sets config behaviour and creates config views for the CKEditor toolbar. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches admin behaviour to the CKEditor buttons. * @prop {Drupal~behaviorDetach} detach * Detaches admin behaviour from the CKEditor buttons on 'unload'. */ Drupal.behaviors.ckeditorAdmin = { attach(context) { // Process the CKEditor configuration fragment once. const $configurationForm = $(context) .find('.ckeditor-toolbar-configuration') .once('ckeditor-configuration'); if ($configurationForm.length) { const $textarea = $configurationForm // Hide the textarea that contains the serialized representation of the // CKEditor configuration. .find('.js-form-item-editor-settings-toolbar-button-groups') .hide() // Return the textarea child node from this expression. .find('textarea'); // The HTML for the CKEditor configuration is assembled on the server // and sent to the client as a serialized DOM fragment. $configurationForm.append(drupalSettings.ckeditor.toolbarAdmin); // Create a configuration model. Drupal.ckeditor.models.Model = new Drupal.ckeditor.Model({ $textarea, activeEditorConfig: JSON.parse($textarea.val()), hiddenEditorConfig: drupalSettings.ckeditor.hiddenCKEditorConfig, }); // Create the configuration Views. const viewDefaults = { model: Drupal.ckeditor.models.Model, el: $('.ckeditor-toolbar-configuration'), }; Drupal.ckeditor.views = { controller: new Drupal.ckeditor.ControllerView(viewDefaults), visualView: new Drupal.ckeditor.VisualView(viewDefaults), keyboardView: new Drupal.ckeditor.KeyboardView(viewDefaults), auralView: new Drupal.ckeditor.AuralView(viewDefaults), }; } }, detach(context, settings, trigger) { // Early-return if the trigger for detachment is something else than // unload. if (trigger !== 'unload') { return; } // We're detaching because CKEditor as text editor has been disabled; this // really means that all CKEditor toolbar buttons have been removed. // Hence,all editor features will be removed, so any reactions from // filters will be undone. const $configurationForm = $(context) .find('.ckeditor-toolbar-configuration') .findOnce('ckeditor-configuration'); if ( $configurationForm.length && Drupal.ckeditor.models && Drupal.ckeditor.models.Model ) { const config = Drupal.ckeditor.models.Model.toJSON().activeEditorConfig; const buttons = Drupal.ckeditor.views.controller.getButtonList(config); const $activeToolbar = $('.ckeditor-toolbar-configuration').find( '.ckeditor-toolbar-active', ); for (let i = 0; i < buttons.length; i++) { $activeToolbar.trigger('CKEditorToolbarChanged', [ 'removed', buttons[i], ]); } } }, }; /** * CKEditor configuration UI methods of Backbone objects. * * @namespace */ Drupal.ckeditor = { /** * A hash of View instances. * * @type {object} */ views: {}, /** * A hash of Model instances. * * @type {object} */ models: {}, /** * Translates changes in CKEditor config DOM structure to the config model. * * If the button is moved within an existing group, the DOM structure is * simply translated to a configuration model. If the button is moved into a * new group placeholder, then a process is launched to name that group * before the button move is translated into configuration. * * @param {Backbone.View} view * The Backbone View that invoked this function. * @param {jQuery} $button * A jQuery set that contains an li element that wraps a button element. * @param {function} callback * A callback to invoke after the button group naming modal dialog has * been closed. * */ registerButtonMove(view, $button, callback) { const $group = $button.closest('.ckeditor-toolbar-group'); // If dropped in a placeholder button group, the user must name it. if ($group.hasClass('placeholder')) { if (view.isProcessing) { return; } view.isProcessing = true; Drupal.ckeditor.openGroupNameDialog(view, $group, callback); } else { view.model.set('isDirty', true); callback(true); } }, /** * Translates changes in CKEditor config DOM structure to the config model. * * Each row has a placeholder group at the end of the row. A user may not * move an existing button group past the placeholder group at the end of a * row. * * @param {Backbone.View} view * The Backbone View that invoked this function. * @param {jQuery} $group * A jQuery set that contains an li element that wraps a group of buttons. */ registerGroupMove(view, $group) { // Remove placeholder classes if necessary. let $row = $group.closest('.ckeditor-row'); if ($row.hasClass('placeholder')) { $row.removeClass('placeholder'); } // If there are any rows with just a placeholder group, mark the row as a // placeholder. $row .parent() .children() .each(function() { $row = $(this); if ( $row.find('.ckeditor-toolbar-group').not('.placeholder').length === 0 ) { $row.addClass('placeholder'); } }); view.model.set('isDirty', true); }, /** * Opens a dialog with a form for changing the title of a button group. * * @param {Backbone.View} view * The Backbone View that invoked this function. * @param {jQuery} $group * A jQuery set that contains an li element that wraps a group of buttons. * @param {function} callback * A callback to invoke after the button group naming modal dialog has * been closed. */ openGroupNameDialog(view, $group, callback) { callback = callback || function() {}; /** * Validates the string provided as a button group title. * * @param {HTMLElement} form * The form DOM element that contains the input with the new button * group title string. * * @return {bool} * Returns true when an error exists, otherwise returns false. */ function validateForm(form) { if (form.elements[0].value.length === 0) { const $form = $(form); if (!$form.hasClass('errors')) { $form .addClass('errors') .find('input') .addClass('error') .attr('aria-invalid', 'true'); $( `<div class="description" >${Drupal.t( 'Please provide a name for the button group.', )}</div>`, ).insertAfter(form.elements[0]); } return true; } return false; } /** * Attempts to close the dialog; Validates user input. * * @param {string} action * The dialog action chosen by the user: 'apply' or 'cancel'. * @param {HTMLElement} form * The form DOM element that contains the input with the new button * group title string. */ function closeDialog(action, form) { /** * Closes the dialog when the user cancels or supplies valid data. */ function shutdown() { // eslint-disable-next-line no-use-before-define dialog.close(action); // The processing marker can be deleted since the dialog has been // closed. delete view.isProcessing; } /** * Applies a string as the name of a CKEditor button group. * * @param {jQuery} $group * A jQuery set that contains an li element that wraps a group of * buttons. * @param {string} name * The new name of the CKEditor button group. */ function namePlaceholderGroup($group, name) { // If it's currently still a placeholder, then that means we're // creating a new group, and we must do some extra work. if ($group.hasClass('placeholder')) { // Remove all whitespace from the name, lowercase it and ensure // HTML-safe encoding, then use this as the group ID for CKEditor // configuration UI accessibility purposes only. const groupID = `ckeditor-toolbar-group-aria-label-for-${Drupal.checkPlain( name.toLowerCase().replace(/\s/g, '-'), )}`; $group // Update the group container. .removeAttr('aria-label') .attr('data-drupal-ckeditor-type', 'group') .attr('tabindex', 0) // Update the group heading. .children('.ckeditor-toolbar-group-name') .attr('id', groupID) .end() // Update the group items. .children('.ckeditor-toolbar-group-buttons') .attr('aria-labelledby', groupID); } $group .attr('data-drupal-ckeditor-toolbar-group-name', name) .children('.ckeditor-toolbar-group-name') .text(name); } // Invoke a user-provided callback and indicate failure. if (action === 'cancel') { shutdown(); callback(false, $group); return; } // Validate that a group name was provided. if (form && validateForm(form)) { return; } // React to application of a valid group name. if (action === 'apply') { shutdown(); // Apply the provided name to the button group label. namePlaceholderGroup( $group, Drupal.checkPlain(form.elements[0].value), ); // Remove placeholder classes so that new placeholders will be // inserted. $group .closest('.ckeditor-row.placeholder') .addBack() .removeClass('placeholder'); // Invoke a user-provided callback and indicate success. callback(true, $group); // Signal that the active toolbar DOM structure has changed. view.model.set('isDirty', true); } } // Create a Drupal dialog that will get a button group name from the user. const $ckeditorButtonGroupNameForm = $( Drupal.theme('ckeditorButtonGroupNameForm'), ); const dialog = Drupal.dialog($ckeditorButtonGroupNameForm.get(0), { title: Drupal.t('Button group name'), dialogClass: 'ckeditor-name-toolbar-group', resizable: false, buttons: [ { text: Drupal.t('Apply'), click() { closeDialog('apply', this); }, primary: true, }, { text: Drupal.t('Cancel'), click() { closeDialog('cancel'); }, }, ], open() { const form = this; const $form = $(this); const $widget = $form.parent(); $widget.find('.ui-dialog-titlebar-close').remove(); // Set a click handler on the input and button in the form. $widget.on('keypress.ckeditor', 'input, button', event => { // React to enter key press. if (event.keyCode === 13) { const $target = $(event.currentTarget); const data = $target.data('ui-button'); let action = 'apply'; // Assume 'apply', but take into account that the user might have // pressed the enter key on the dialog buttons. if (data && data.options && data.options.label) { action = data.options.label.toLowerCase(); } closeDialog(action, form); event.stopPropagation(); event.stopImmediatePropagation(); event.preventDefault(); } }); // Announce to the user that a modal dialog is open. let text = Drupal.t( 'Editing the name of the new button group in a dialog.', ); if ( typeof $group.attr('data-drupal-ckeditor-toolbar-group-name') !== 'undefined' ) { text = Drupal.t( 'Editing the name of the "@groupName" button group in a dialog.', { '@groupName': $group.attr( 'data-drupal-ckeditor-toolbar-group-name', ), }, ); } Drupal.announce(text); }, close(event) { // Automatically destroy the DOM element that was used for the dialog. $(event.target).remove(); }, }); // A modal dialog is used because the user must provide a button group // name or cancel the button placement before taking any other action. dialog.showModal(); $( document .querySelector('.ckeditor-name-toolbar-group') .querySelector('input'), ) // When editing, set the "group name" input in the form to the current // value. .attr('value', $group.attr('data-drupal-ckeditor-toolbar-group-name')) // Focus on the "group name" input in the form. .trigger('focus'); }, }; /** * Automatically shows/hides settings of buttons-only CKEditor plugins. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches show/hide behaviour to Plugin Settings buttons. */ Drupal.behaviors.ckeditorAdminButtonPluginSettings = { attach(context) { const $context = $(context); const $ckeditorPluginSettings = $context .find('#ckeditor-plugin-settings') .once('ckeditor-plugin-settings'); if ($ckeditorPluginSettings.length) { // Hide all button-dependent plugin settings initially. $ckeditorPluginSettings .find('[data-ckeditor-buttons]') .each(function() { const $this = $(this); if ($this.data('verticalTab')) { $this.data('verticalTab').tabHide(); } else { // On very narrow viewports, Vertical Tabs are disabled. $this.hide(); } $this.data('ckeditorButtonPluginSettingsActiveButtons', []); }); // Whenever a button is added or removed, check if we should show or // hide the corresponding plugin settings. (Note that upon // initialization, each button that already is part of the toolbar still // is considered "added", hence it also works correctly for buttons that // were added previously.) $context .find('.ckeditor-toolbar-active') .off('CKEditorToolbarChanged.ckeditorAdminPluginSettings') .on( 'CKEditorToolbarChanged.ckeditorAdminPluginSettings', (event, action, button) => { const $pluginSettings = $ckeditorPluginSettings.find( `[data-ckeditor-buttons~=${button}]`, ); // No settings for this button. if ($pluginSettings.length === 0) { return; } const verticalTab = $pluginSettings.data('verticalTab'); const activeButtons = $pluginSettings.data( 'ckeditorButtonPluginSettingsActiveButtons', ); if (action === 'added') { activeButtons.push(button); // Show this plugin's settings if >=1 of its buttons are active. if (verticalTab) { verticalTab.tabShow(); } else { // On very narrow viewports, Vertical Tabs remain fieldsets. $pluginSettings.show(); } } else { // Remove this button from the list of active buttons. activeButtons.splice(activeButtons.indexOf(button), 1); // Show this plugin's settings 0 of its buttons are active. if (activeButtons.length === 0) { if (verticalTab) { verticalTab.tabHide(); } else { // On very narrow viewports, Vertical Tabs are disabled. $pluginSettings.hide(); } } } $pluginSettings.data( 'ckeditorButtonPluginSettingsActiveButtons', activeButtons, ); }, ); } }, }; /** * Themes a blank CKEditor row. * * @return {string} * A HTML string for a CKEditor row. */ Drupal.theme.ckeditorRow = function() { return '<li class="ckeditor-row placeholder" role="group"><ul class="ckeditor-toolbar-groups clearfix"></ul></li>'; }; /** * Themes a blank CKEditor button group. * * @return {string} * A HTML string for a CKEditor button group. */ Drupal.theme.ckeditorToolbarGroup = function() { let group = ''; group += `<li class="ckeditor-toolbar-group placeholder" role="presentation" aria-label="${Drupal.t( 'Place a button to create a new button group.', )}">`; group += `<h3 class="ckeditor-toolbar-group-name">${Drupal.t( 'New group', )}</h3>`; group += '<ul class="ckeditor-buttons ckeditor-toolbar-group-buttons" role="toolbar" data-drupal-ckeditor-button-sorting="target"></ul>'; group += '</li>'; return group; }; /** * Themes a form for changing the title of a CKEditor button group. * * @return {string} * A HTML string for the form for the title of a CKEditor button group. */ Drupal.theme.ckeditorButtonGroupNameForm = function() { return '<form><input name="group-name" required="required"></form>'; }; /** * Themes a button that will toggle the button group names in active config. * * @return {string} * A HTML string for the button to toggle group names. */ Drupal.theme.ckeditorButtonGroupNamesToggle = function() { return '<button class="link ckeditor-groupnames-toggle" aria-pressed="false"></button>'; }; /** * Themes a button that will prompt the user to name a new button group. * * @return {string} * A HTML string for the button to create a name for a new button group. */ Drupal.theme.ckeditorNewButtonGroup = function() { return `<li class="ckeditor-add-new-group"><button aria-label="${Drupal.t( 'Add a CKEditor button group to the end of this row.', )}">${Drupal.t('Add group')}</button></li>`; }; })(jQuery, Drupal, drupalSettings, _);
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "ic_bm_medicine.pdf" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
// // detail/win_iocp_io_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_DETAIL_WIN_IOCP_IO_SERVICE_HPP #define BOOST_ASIO_DETAIL_WIN_IOCP_IO_SERVICE_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #if defined(BOOST_ASIO_HAS_IOCP) #include <boost/asio/io_service.hpp> #include <boost/asio/detail/call_stack.hpp> #include <boost/asio/detail/limits.hpp> #include <boost/asio/detail/mutex.hpp> #include <boost/asio/detail/op_queue.hpp> #include <boost/asio/detail/scoped_ptr.hpp> #include <boost/asio/detail/socket_types.hpp> #include <boost/asio/detail/thread.hpp> #include <boost/asio/detail/timer_queue_base.hpp> #include <boost/asio/detail/timer_queue_set.hpp> #include <boost/asio/detail/wait_op.hpp> #include <boost/asio/detail/win_iocp_operation.hpp> #include <boost/asio/detail/win_iocp_thread_info.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { namespace detail { class wait_op; class win_iocp_io_service : public boost::asio::detail::service_base<win_iocp_io_service> { public: // Constructor. Specifies a concurrency hint that is passed through to the // underlying I/O completion port. BOOST_ASIO_DECL win_iocp_io_service(boost::asio::io_service& io_service, size_t concurrency_hint = 0); // Destroy all user-defined handler objects owned by the service. BOOST_ASIO_DECL void shutdown_service(); // Initialise the task. Nothing to do here. void init_task() { } // Register a handle with the IO completion port. BOOST_ASIO_DECL boost::system::error_code register_handle( HANDLE handle, boost::system::error_code& ec); // Run the event loop until stopped or no more work. BOOST_ASIO_DECL size_t run(boost::system::error_code& ec); // Run until stopped or one operation is performed. BOOST_ASIO_DECL size_t run_one(boost::system::error_code& ec); // Poll for operations without blocking. BOOST_ASIO_DECL size_t poll(boost::system::error_code& ec); // Poll for one operation without blocking. BOOST_ASIO_DECL size_t poll_one(boost::system::error_code& ec); // Stop the event processing loop. BOOST_ASIO_DECL void stop(); // Determine whether the io_service is stopped. bool stopped() const { return ::InterlockedExchangeAdd(&stopped_, 0) != 0; } // Reset in preparation for a subsequent run invocation. void reset() { ::InterlockedExchange(&stopped_, 0); } // Notify that some work has started. void work_started() { ::InterlockedIncrement(&outstanding_work_); } // Notify that some work has finished. void work_finished() { if (::InterlockedDecrement(&outstanding_work_) == 0) stop(); } // Return whether a handler can be dispatched immediately. bool can_dispatch() { return thread_call_stack::contains(this) != 0; } // Request invocation of the given handler. template <typename Handler> void dispatch(Handler& handler); // Request invocation of the given handler and return immediately. template <typename Handler> void post(Handler& handler); // Request invocation of the given operation and return immediately. Assumes // that work_started() has not yet been called for the operation. void post_immediate_completion(win_iocp_operation* op, bool) { work_started(); post_deferred_completion(op); } // Request invocation of the given operation and return immediately. Assumes // that work_started() was previously called for the operation. BOOST_ASIO_DECL void post_deferred_completion(win_iocp_operation* op); // Request invocation of the given operation and return immediately. Assumes // that work_started() was previously called for the operations. BOOST_ASIO_DECL void post_deferred_completions( op_queue<win_iocp_operation>& ops); // Request invocation of the given operation using the thread-private queue // and return immediately. Assumes that work_started() has not yet been // called for the operation. void post_private_immediate_completion(win_iocp_operation* op) { post_immediate_completion(op, false); } // Request invocation of the given operation using the thread-private queue // and return immediately. Assumes that work_started() was previously called // for the operation. void post_private_deferred_completion(win_iocp_operation* op) { post_deferred_completion(op); } // Process unfinished operations as part of a shutdown_service operation. // Assumes that work_started() was previously called for the operations. BOOST_ASIO_DECL void abandon_operations(op_queue<operation>& ops); // Called after starting an overlapped I/O operation that did not complete // immediately. The caller must have already called work_started() prior to // starting the operation. BOOST_ASIO_DECL void on_pending(win_iocp_operation* op); // Called after starting an overlapped I/O operation that completed // immediately. The caller must have already called work_started() prior to // starting the operation. BOOST_ASIO_DECL void on_completion(win_iocp_operation* op, DWORD last_error = 0, DWORD bytes_transferred = 0); // Called after starting an overlapped I/O operation that completed // immediately. The caller must have already called work_started() prior to // starting the operation. BOOST_ASIO_DECL void on_completion(win_iocp_operation* op, const boost::system::error_code& ec, DWORD bytes_transferred = 0); // Add a new timer queue to the service. template <typename Time_Traits> void add_timer_queue(timer_queue<Time_Traits>& timer_queue); // Remove a timer queue from the service. template <typename Time_Traits> void remove_timer_queue(timer_queue<Time_Traits>& timer_queue); // Schedule a new operation in the given timer queue to expire at the // specified absolute time. template <typename Time_Traits> void schedule_timer(timer_queue<Time_Traits>& queue, const typename Time_Traits::time_type& time, typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op); // Cancel the timer associated with the given token. Returns the number of // handlers that have been posted or dispatched. template <typename Time_Traits> std::size_t cancel_timer(timer_queue<Time_Traits>& queue, typename timer_queue<Time_Traits>::per_timer_data& timer, std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)()); private: #if defined(WINVER) && (WINVER < 0x0500) typedef DWORD dword_ptr_t; typedef ULONG ulong_ptr_t; #else // defined(WINVER) && (WINVER < 0x0500) typedef DWORD_PTR dword_ptr_t; typedef ULONG_PTR ulong_ptr_t; #endif // defined(WINVER) && (WINVER < 0x0500) // Dequeues at most one operation from the I/O completion port, and then // executes it. Returns the number of operations that were dequeued (i.e. // either 0 or 1). BOOST_ASIO_DECL size_t do_one(bool block, boost::system::error_code& ec); // Helper to calculate the GetQueuedCompletionStatus timeout. BOOST_ASIO_DECL static DWORD get_gqcs_timeout(); // Helper function to add a new timer queue. BOOST_ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); // Helper function to remove a timer queue. BOOST_ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); // Called to recalculate and update the timeout. BOOST_ASIO_DECL void update_timeout(); // Helper class to call work_finished() on block exit. struct work_finished_on_block_exit; // Helper class for managing a HANDLE. struct auto_handle { HANDLE handle; auto_handle() : handle(0) {} ~auto_handle() { if (handle) ::CloseHandle(handle); } }; // The IO completion port used for queueing operations. auto_handle iocp_; // The count of unfinished work. long outstanding_work_; // Flag to indicate whether the event loop has been stopped. mutable long stopped_; // Flag to indicate whether there is an in-flight stop event. Every event // posted using PostQueuedCompletionStatus consumes non-paged pool, so to // avoid exhausting this resouce we limit the number of outstanding events. long stop_event_posted_; // Flag to indicate whether the service has been shut down. long shutdown_; enum { // Timeout to use with GetQueuedCompletionStatus on older versions of // Windows. Some versions of windows have a "bug" where a call to // GetQueuedCompletionStatus can appear stuck even though there are events // waiting on the queue. Using a timeout helps to work around the issue. default_gqcs_timeout = 500, // Maximum waitable timer timeout, in milliseconds. max_timeout_msec = 5 * 60 * 1000, // Maximum waitable timer timeout, in microseconds. max_timeout_usec = max_timeout_msec * 1000, // Completion key value used to wake up a thread to dispatch timers or // completed operations. wake_for_dispatch = 1, // Completion key value to indicate that an operation has posted with the // original last_error and bytes_transferred values stored in the fields of // the OVERLAPPED structure. overlapped_contains_result = 2 }; // Timeout to use with GetQueuedCompletionStatus. const DWORD gqcs_timeout_; // Function object for processing timeouts in a background thread. struct timer_thread_function; friend struct timer_thread_function; // Background thread used for processing timeouts. scoped_ptr<thread> timer_thread_; // A waitable timer object used for waiting for timeouts. auto_handle waitable_timer_; // Non-zero if timers or completed operations need to be dispatched. long dispatch_required_; // Mutex for protecting access to the timer queues and completed operations. mutex dispatch_mutex_; // The timer queues. timer_queue_set timer_queues_; // The operations that are ready to dispatch. op_queue<win_iocp_operation> completed_ops_; // Per-thread call stack to track the state of each thread in the io_service. typedef call_stack<win_iocp_io_service, win_iocp_thread_info> thread_call_stack; }; } // namespace detail } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/detail/impl/win_iocp_io_service.hpp> #if defined(BOOST_ASIO_HEADER_ONLY) # include <boost/asio/detail/impl/win_iocp_io_service.ipp> #endif // defined(BOOST_ASIO_HEADER_ONLY) #endif // defined(BOOST_ASIO_HAS_IOCP) #endif // BOOST_ASIO_DETAIL_WIN_IOCP_IO_SERVICE_HPP
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>akka-java-examples</artifactId> <groupId>org.royrusso</groupId> <version>0.1-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>event-bus</artifactId> <version>0.1-SNAPSHOT</version> <packaging>pom</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <jdk.version>1.7</jdk.version> <scala.version>2.10.3</scala.version> <akka.version>2.3.1</akka.version> <spring.version>4.0.2.RELEASE</spring.version> </properties> <dependencies> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-actor_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-persistence-experimental_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-cluster_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-slf4j_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.1.1</version> </dependency> </dependencies> <build> <finalName>akka-event-bus</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> </configuration> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////////////////////////// /// \file traits.hpp /// Contains definitions for child\<\>, child_c\<\>, left\<\>, /// right\<\>, tag_of\<\>, and the helper functions child(), child_c(), /// value(), left() and right(). // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005 #define BOOST_PROTO_ARG_TRAITS_HPP_EAN_04_01_2005 #include <boost/config.hpp> #include <boost/detail/workaround.hpp> #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/repetition/repeat_from_to.hpp> #include <boost/preprocessor/facilities/intercept.hpp> #include <boost/preprocessor/arithmetic/sub.hpp> #include <boost/static_assert.hpp> #include <boost/mpl/bool.hpp> #include <boost/proto/detail/template_arity.hpp> #include <boost/type_traits/is_pod.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/add_const.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/args.hpp> #include <boost/proto/domain.hpp> #include <boost/proto/transform/pass_through.hpp> #if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 ) #pragma warning(push) #pragma warning(disable: 4180) // warning C4180: qualifier applied to function type has no meaning; ignored #endif namespace boost { namespace proto { namespace detail { template<typename T, typename Void = void> struct if_vararg {}; template<typename T> struct if_vararg<T, typename T::proto_is_vararg_> : T {}; template<typename T, typename Void = void> struct is_callable2_ : mpl::false_ {}; template<typename T> struct is_callable2_<T, typename T::proto_is_callable_> : mpl::true_ {}; template<typename T BOOST_PROTO_TEMPLATE_ARITY_PARAM(long Arity = boost::proto::detail::template_arity<T>::value)> struct is_callable_ : is_callable2_<T> {}; } /// \brief Boolean metafunction which detects whether a type is /// a callable function object type or not. /// /// <tt>is_callable\<\></tt> is used by the <tt>when\<\></tt> transform /// to determine whether a function type <tt>R(A1,A2,...AN)</tt> is a /// callable transform or an object transform. (The former are evaluated /// using <tt>call\<\></tt> and the later with <tt>make\<\></tt>.) If /// <tt>is_callable\<R\>::value</tt> is \c true, the function type is /// a callable transform; otherwise, it is an object transform. /// /// Unless specialized for a type \c T, <tt>is_callable\<T\>::value</tt> /// is computed as follows: /// /// \li If \c T is a template type <tt>X\<Y0,Y1,...YN\></tt>, where all \c Yx /// are types for \c x in <tt>[0,N]</tt>, <tt>is_callable\<T\>::value</tt> /// is <tt>is_same\<YN, proto::callable\>::value</tt>. /// \li If \c T has a nested type \c proto_is_callable_ that is a typedef /// for \c void, <tt>is_callable\<T\>::value</tt> is \c true. (Note: this is /// the case for any type that derives from \c proto::callable.) /// \li Otherwise, <tt>is_callable\<T\>::value</tt> is \c false. template<typename T> struct is_callable : proto::detail::is_callable_<T> {}; /// INTERNAL ONLY /// template<> struct is_callable<proto::_> : mpl::true_ {}; /// INTERNAL ONLY /// template<> struct is_callable<proto::callable> : mpl::false_ {}; /// INTERNAL ONLY /// template<typename PrimitiveTransform, typename X> struct is_callable<proto::transform<PrimitiveTransform, X> > : mpl::false_ {}; #if BOOST_WORKAROUND(__GNUC__, == 3) || (__GNUC__ == 4 && __GNUC_MINOR__ == 0) // work around GCC bug template<typename Tag, typename Args, long N> struct is_callable<proto::expr<Tag, Args, N> > : mpl::false_ {}; // work around GCC bug template<typename Tag, typename Args, long N> struct is_callable<proto::basic_expr<Tag, Args, N> > : mpl::false_ {}; #endif namespace detail { template<typename T, typename Void /*= void*/> struct is_transform_ : mpl::false_ {}; template<typename T> struct is_transform_<T, typename T::proto_is_transform_> : mpl::true_ {}; } /// \brief Boolean metafunction which detects whether a type is /// a PrimitiveTransform type or not. /// /// <tt>is_transform\<\></tt> is used by the <tt>call\<\></tt> transform /// to determine whether the function types <tt>R()</tt>, <tt>R(A1)</tt>, /// and <tt>R(A1, A2)</tt> should be passed the expression, state and data /// parameters (as needed). /// /// Unless specialized for a type \c T, <tt>is_transform\<T\>::value</tt> /// is computed as follows: /// /// \li If \c T has a nested type \c proto_is_transform_ that is a typedef /// for \c void, <tt>is_transform\<T\>::value</tt> is \c true. (Note: this is /// the case for any type that derives from an instantiation of \c proto::transform.) /// \li Otherwise, <tt>is_transform\<T\>::value</tt> is \c false. template<typename T> struct is_transform : proto::detail::is_transform_<T> {}; namespace detail { template<typename T, typename Void /*= void*/> struct is_aggregate_ : is_pod<T> {}; template<typename Tag, typename Args, long N> struct is_aggregate_<proto::expr<Tag, Args, N>, void> : mpl::true_ {}; template<typename Tag, typename Args, long N> struct is_aggregate_<proto::basic_expr<Tag, Args, N>, void> : mpl::true_ {}; template<typename T> struct is_aggregate_<T, typename T::proto_is_aggregate_> : mpl::true_ {}; } /// \brief A Boolean metafunction that indicates whether a type requires /// aggregate initialization. /// /// <tt>is_aggregate\<\></tt> is used by the <tt>make\<\></tt> transform /// to determine how to construct an object of some type \c T, given some /// initialization arguments <tt>a0,a1,...aN</tt>. /// If <tt>is_aggregate\<T\>::value</tt> is \c true, then an object of /// type T will be initialized as <tt>T t = {a0,a1,...aN};</tt>. Otherwise, /// it will be initialized as <tt>T t(a0,a1,...aN)</tt>. template<typename T> struct is_aggregate : proto::detail::is_aggregate_<T> {}; /// \brief A Boolean metafunction that indicates whether a given /// type \c T is a Proto expression type. /// /// If \c T has a nested type \c proto_is_expr_ that is a typedef /// for \c void, <tt>is_expr\<T\>::value</tt> is \c true. (Note, this /// is the case for <tt>proto::expr\<\></tt>, any type that is derived /// from <tt>proto::extends\<\></tt> or that uses the /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise, /// <tt>is_expr\<T\>::value</tt> is \c false. template<typename T, typename Void /* = void*/> struct is_expr : mpl::false_ {}; /// \brief A Boolean metafunction that indicates whether a given /// type \c T is a Proto expression type. /// /// If \c T has a nested type \c proto_is_expr_ that is a typedef /// for \c void, <tt>is_expr\<T\>::value</tt> is \c true. (Note, this /// is the case for <tt>proto::expr\<\></tt>, any type that is derived /// from <tt>proto::extends\<\></tt> or that uses the /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise, /// <tt>is_expr\<T\>::value</tt> is \c false. template<typename T> struct is_expr<T, typename T::proto_is_expr_> : mpl::true_ {}; template<typename T> struct is_expr<T &, void> : is_expr<T> {}; /// \brief A metafunction that returns the tag type of a /// Proto expression. template<typename Expr> struct tag_of { typedef typename Expr::proto_tag type; }; template<typename Expr> struct tag_of<Expr &> { typedef typename Expr::proto_tag type; }; /// \brief A metafunction that returns the arity of a /// Proto expression. template<typename Expr> struct arity_of : Expr::proto_arity {}; template<typename Expr> struct arity_of<Expr &> : Expr::proto_arity {}; namespace result_of { /// \brief A metafunction that computes the return type of the \c as_expr() /// function. template<typename T, typename Domain /*= default_domain*/> struct as_expr { typedef typename Domain::template as_expr<T>::result_type type; }; /// \brief A metafunction that computes the return type of the \c as_child() /// function. template<typename T, typename Domain /*= default_domain*/> struct as_child { typedef typename Domain::template as_child<T>::result_type type; }; /// \brief A metafunction that returns the type of the Nth child /// of a Proto expression, where N is an MPL Integral Constant. /// /// <tt>result_of::child\<Expr, N\></tt> is equivalent to /// <tt>result_of::child_c\<Expr, N::value\></tt>. template<typename Expr, typename N /* = mpl::long_<0>*/> struct child : child_c<Expr, N::value> {}; /// \brief A metafunction that returns the type of the value /// of a terminal Proto expression. /// template<typename Expr> struct value { /// Verify that we are actually operating on a terminal BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c); /// The raw type of the Nth child as it is stored within /// \c Expr. This may be a value or a reference typedef typename Expr::proto_child0 value_type; /// The "value" type of the child, suitable for storage by value, /// computed as follows: /// \li <tt>T const(&)[N]</tt> becomes <tt>T[N]</tt> /// \li <tt>T[N]</tt> becomes <tt>T[N]</tt> /// \li <tt>T(&)[N]</tt> becomes <tt>T[N]</tt> /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt> /// \li <tt>T const &</tt> becomes <tt>T</tt> /// \li <tt>T &</tt> becomes <tt>T</tt> /// \li <tt>T</tt> becomes <tt>T</tt> typedef typename detail::term_traits<typename Expr::proto_child0>::value_type type; }; template<typename Expr> struct value<Expr &> { /// Verify that we are actually operating on a terminal BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c); /// The raw type of the Nth child as it is stored within /// \c Expr. This may be a value or a reference typedef typename Expr::proto_child0 value_type; /// The "reference" type of the child, suitable for storage by /// reference, computed as follows: /// \li <tt>T const(&)[N]</tt> becomes <tt>T const(&)[N]</tt> /// \li <tt>T[N]</tt> becomes <tt>T(&)[N]</tt> /// \li <tt>T(&)[N]</tt> becomes <tt>T(&)[N]</tt> /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt> /// \li <tt>T const &</tt> becomes <tt>T const &</tt> /// \li <tt>T &</tt> becomes <tt>T &</tt> /// \li <tt>T</tt> becomes <tt>T &</tt> typedef typename detail::term_traits<typename Expr::proto_child0>::reference type; }; template<typename Expr> struct value<Expr const &> { /// Verify that we are actually operating on a terminal BOOST_STATIC_ASSERT(0 == Expr::proto_arity_c); /// The raw type of the Nth child as it is stored within /// \c Expr. This may be a value or a reference typedef typename Expr::proto_child0 value_type; /// The "const reference" type of the child, suitable for storage by /// const reference, computed as follows: /// \li <tt>T const(&)[N]</tt> becomes <tt>T const(&)[N]</tt> /// \li <tt>T[N]</tt> becomes <tt>T const(&)[N]</tt> /// \li <tt>T(&)[N]</tt> becomes <tt>T(&)[N]</tt> /// \li <tt>R(&)(A0,...)</tt> becomes <tt>R(&)(A0,...)</tt> /// \li <tt>T const &</tt> becomes <tt>T const &</tt> /// \li <tt>T &</tt> becomes <tt>T &</tt> /// \li <tt>T</tt> becomes <tt>T const &</tt> typedef typename detail::term_traits<typename Expr::proto_child0>::const_reference type; }; /// \brief A metafunction that returns the type of the left child /// of a binary Proto expression. /// /// <tt>result_of::left\<Expr\></tt> is equivalent to /// <tt>result_of::child_c\<Expr, 0\></tt>. template<typename Expr> struct left : child_c<Expr, 0> {}; /// \brief A metafunction that returns the type of the right child /// of a binary Proto expression. /// /// <tt>result_of::right\<Expr\></tt> is equivalent to /// <tt>result_of::child_c\<Expr, 1\></tt>. template<typename Expr> struct right : child_c<Expr, 1> {}; } // namespace result_of /// \brief A metafunction for generating terminal expression types, /// a grammar element for matching terminal expressions, and a /// PrimitiveTransform that returns the current expression unchanged. template<typename T> struct terminal : proto::transform<terminal<T>, int> { typedef proto::expr<proto::tag::terminal, term<T>, 0> type; typedef proto::basic_expr<proto::tag::terminal, term<T>, 0> proto_grammar; template<typename Expr, typename State, typename Data> struct impl : transform_impl<Expr, State, Data> { typedef Expr result_type; /// \param e The current expression /// \pre <tt>matches\<Expr, terminal\<T\> \>::value</tt> is \c true. /// \return \c e /// \throw nothrow #ifdef BOOST_PROTO_STRICT_RESULT_OF result_type #else typename impl::expr_param #endif operator ()( typename impl::expr_param e , typename impl::state_param , typename impl::data_param ) const { return e; } }; /// INTERNAL ONLY typedef proto::tag::terminal proto_tag; /// INTERNAL ONLY typedef T proto_child0; }; /// \brief A metafunction for generating ternary conditional expression types, /// a grammar element for matching ternary conditional expressions, and a /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt> /// transform. template<typename T, typename U, typename V> struct if_else_ : proto::transform<if_else_<T, U, V>, int> { typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type; typedef proto::basic_expr<proto::tag::if_else_, list3<T, U, V>, 3> proto_grammar; template<typename Expr, typename State, typename Data> struct impl : detail::pass_through_impl<if_else_, Expr, State, Data> {}; /// INTERNAL ONLY typedef proto::tag::if_else_ proto_tag; /// INTERNAL ONLY typedef T proto_child0; /// INTERNAL ONLY typedef U proto_child1; /// INTERNAL ONLY typedef V proto_child2; }; /// \brief A metafunction for generating nullary expression types with a /// specified tag type, /// a grammar element for matching nullary expressions, and a /// PrimitiveTransform that returns the current expression unchanged. /// /// Use <tt>nullary_expr\<_, _\></tt> as a grammar element to match any /// nullary expression. template<typename Tag, typename T> struct nullary_expr : proto::transform<nullary_expr<Tag, T>, int> { typedef proto::expr<Tag, term<T>, 0> type; typedef proto::basic_expr<Tag, term<T>, 0> proto_grammar; template<typename Expr, typename State, typename Data> struct impl : transform_impl<Expr, State, Data> { typedef Expr result_type; /// \param e The current expression /// \pre <tt>matches\<Expr, nullary_expr\<Tag, T\> \>::value</tt> is \c true. /// \return \c e /// \throw nothrow #ifdef BOOST_PROTO_STRICT_RESULT_OF result_type #else typename impl::expr_param #endif operator ()( typename impl::expr_param e , typename impl::state_param , typename impl::data_param ) const { return e; } }; /// INTERNAL ONLY typedef Tag proto_tag; /// INTERNAL ONLY typedef T proto_child0; }; /// \brief A metafunction for generating unary expression types with a /// specified tag type, /// a grammar element for matching unary expressions, and a /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt> /// transform. /// /// Use <tt>unary_expr\<_, _\></tt> as a grammar element to match any /// unary expression. template<typename Tag, typename T> struct unary_expr : proto::transform<unary_expr<Tag, T>, int> { typedef proto::expr<Tag, list1<T>, 1> type; typedef proto::basic_expr<Tag, list1<T>, 1> proto_grammar; template<typename Expr, typename State, typename Data> struct impl : detail::pass_through_impl<unary_expr, Expr, State, Data> {}; /// INTERNAL ONLY typedef Tag proto_tag; /// INTERNAL ONLY typedef T proto_child0; }; /// \brief A metafunction for generating binary expression types with a /// specified tag type, /// a grammar element for matching binary expressions, and a /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt> /// transform. /// /// Use <tt>binary_expr\<_, _, _\></tt> as a grammar element to match any /// binary expression. template<typename Tag, typename T, typename U> struct binary_expr : proto::transform<binary_expr<Tag, T, U>, int> { typedef proto::expr<Tag, list2<T, U>, 2> type; typedef proto::basic_expr<Tag, list2<T, U>, 2> proto_grammar; template<typename Expr, typename State, typename Data> struct impl : detail::pass_through_impl<binary_expr, Expr, State, Data> {}; /// INTERNAL ONLY typedef Tag proto_tag; /// INTERNAL ONLY typedef T proto_child0; /// INTERNAL ONLY typedef U proto_child1; }; #define BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(Op) \ template<typename T> \ struct Op \ : proto::transform<Op<T>, int> \ { \ typedef proto::expr<proto::tag::Op, list1<T>, 1> type; \ typedef proto::basic_expr<proto::tag::Op, list1<T>, 1> proto_grammar; \ \ template<typename Expr, typename State, typename Data> \ struct impl \ : detail::pass_through_impl<Op, Expr, State, Data> \ {}; \ \ typedef proto::tag::Op proto_tag; \ typedef T proto_child0; \ }; \ /**/ #define BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(Op) \ template<typename T, typename U> \ struct Op \ : proto::transform<Op<T, U>, int> \ { \ typedef proto::expr<proto::tag::Op, list2<T, U>, 2> type; \ typedef proto::basic_expr<proto::tag::Op, list2<T, U>, 2> proto_grammar; \ \ template<typename Expr, typename State, typename Data> \ struct impl \ : detail::pass_through_impl<Op, Expr, State, Data> \ {}; \ \ typedef proto::tag::Op proto_tag; \ typedef T proto_child0; \ typedef U proto_child1; \ }; \ /**/ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(unary_plus) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(negate) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(dereference) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(complement) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(address_of) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(logical_not) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_inc) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_dec) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_inc) BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_dec) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less_equal) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater_equal) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(equal_to) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(not_equal_to) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_or) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_and) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(comma) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(mem_ptr) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor_assign) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(subscript) BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(member) #undef BOOST_PROTO_DEFINE_UNARY_METAFUNCTION #undef BOOST_PROTO_DEFINE_BINARY_METAFUNCTION #include <boost/proto/detail/traits.hpp> namespace functional { /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c as_expr() function. template<typename Domain /* = default_domain*/> struct as_expr { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename T> struct result<This(T)> { typedef typename Domain::template as_expr<T>::result_type type; }; template<typename This, typename T> struct result<This(T &)> { typedef typename Domain::template as_expr<T>::result_type type; }; /// \brief Wrap an object in a Proto terminal if it isn't a /// Proto expression already. /// \param t The object to wrap. /// \return <tt>proto::as_expr\<Domain\>(t)</tt> template<typename T> typename add_const<typename result<as_expr(T &)>::type>::type operator ()(T &t) const { return typename Domain::template as_expr<T>()(t); } /// \overload /// template<typename T> typename add_const<typename result<as_expr(T const &)>::type>::type operator ()(T const &t) const { return typename Domain::template as_expr<T const>()(t); } #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) template<typename T, std::size_t N_> typename add_const<typename result<as_expr(T (&)[N_])>::type>::type operator ()(T (&t)[N_]) const { return typename Domain::template as_expr<T[N_]>()(t); } template<typename T, std::size_t N_> typename add_const<typename result<as_expr(T const (&)[N_])>::type>::type operator ()(T const (&t)[N_]) const { return typename Domain::template as_expr<T const[N_]>()(t); } #endif }; /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c as_child() function. template<typename Domain /* = default_domain*/> struct as_child { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename T> struct result<This(T)> { typedef typename Domain::template as_child<T>::result_type type; }; template<typename This, typename T> struct result<This(T &)> { typedef typename Domain::template as_child<T>::result_type type; }; /// \brief Wrap an object in a Proto terminal if it isn't a /// Proto expression already. /// \param t The object to wrap. /// \return <tt>proto::as_child\<Domain\>(t)</tt> template<typename T> typename add_const<typename result<as_child(T &)>::type>::type operator ()(T &t) const { return typename Domain::template as_child<T>()(t); } /// \overload /// template<typename T> typename add_const<typename result<as_child(T const &)>::type>::type operator ()(T const &t) const { return typename Domain::template as_child<T const>()(t); } }; /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c child_c() function. template<long N> struct child_c { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename result_of::child_c<Expr, N>::type type; }; /// \brief Return the Nth child of the given expression. /// \param expr The expression node. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true /// \pre <tt>N \< Expr::proto_arity::value</tt> /// \return <tt>proto::child_c\<N\>(expr)</tt> /// \throw nothrow template<typename Expr> typename result_of::child_c<Expr &, N>::type operator ()(Expr &e) const { return result_of::child_c<Expr &, N>::call(e); } /// \overload /// template<typename Expr> typename result_of::child_c<Expr const &, N>::type operator ()(Expr const &e) const { return result_of::child_c<Expr const &, N>::call(e); } }; /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c child() function. /// /// A callable PolymorphicFunctionObject that is /// equivalent to the \c child() function. \c N is required /// to be an MPL Integral Constant. template<typename N /* = mpl::long_<0>*/> struct child { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename result_of::child<Expr, N>::type type; }; /// \brief Return the Nth child of the given expression. /// \param expr The expression node. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true /// \pre <tt>N::value \< Expr::proto_arity::value</tt> /// \return <tt>proto::child\<N\>(expr)</tt> /// \throw nothrow template<typename Expr> typename result_of::child<Expr &, N>::type operator ()(Expr &e) const { return result_of::child<Expr &, N>::call(e); } /// \overload /// template<typename Expr> typename result_of::child<Expr const &, N>::type operator ()(Expr const &e) const { return result_of::child<Expr const &, N>::call(e); } }; /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c value() function. struct value { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename result_of::value<Expr>::type type; }; /// \brief Return the value of the given terminal expression. /// \param expr The terminal expression node. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true /// \pre <tt>0 == Expr::proto_arity::value</tt> /// \return <tt>proto::value(expr)</tt> /// \throw nothrow template<typename Expr> typename result_of::value<Expr &>::type operator ()(Expr &e) const { return e.proto_base().child0; } /// \overload /// template<typename Expr> typename result_of::value<Expr const &>::type operator ()(Expr const &e) const { return e.proto_base().child0; } }; /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c left() function. struct left { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename result_of::left<Expr>::type type; }; /// \brief Return the left child of the given binary expression. /// \param expr The expression node. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true /// \pre <tt>2 == Expr::proto_arity::value</tt> /// \return <tt>proto::left(expr)</tt> /// \throw nothrow template<typename Expr> typename result_of::left<Expr &>::type operator ()(Expr &e) const { return e.proto_base().child0; } /// \overload /// template<typename Expr> typename result_of::left<Expr const &>::type operator ()(Expr const &e) const { return e.proto_base().child0; } }; /// \brief A callable PolymorphicFunctionObject that is /// equivalent to the \c right() function. struct right { BOOST_PROTO_CALLABLE() template<typename Sig> struct result; template<typename This, typename Expr> struct result<This(Expr)> { typedef typename result_of::right<Expr>::type type; }; /// \brief Return the right child of the given binary expression. /// \param expr The expression node. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true /// \pre <tt>2 == Expr::proto_arity::value</tt> /// \return <tt>proto::right(expr)</tt> /// \throw nothrow template<typename Expr> typename result_of::right<Expr &>::type operator ()(Expr &e) const { return e.proto_base().child1; } template<typename Expr> typename result_of::right<Expr const &>::type operator ()(Expr const &e) const { return e.proto_base().child1; } }; } /// \brief A function that wraps non-Proto expression types in Proto /// terminals and leaves Proto expression types alone. /// /// The <tt>as_expr()</tt> function turns objects into Proto terminals if /// they are not Proto expression types already. Non-Proto types are /// held by value, if possible. Types which are already Proto types are /// left alone and returned by reference. /// /// This function can be called either with an explicitly specified /// \c Domain parameter (i.e., <tt>as_expr\<Domain\>(t)</tt>), or /// without (i.e., <tt>as_expr(t)</tt>). If no domain is /// specified, \c default_domain is assumed. /// /// If <tt>is_expr\<T\>::value</tt> is \c true, then the argument is /// returned unmodified, by reference. Otherwise, the argument is wrapped /// in a Proto terminal expression node according to the following rules. /// If \c T is a function type, let \c A be <tt>T &</tt>. Otherwise, let /// \c A be the type \c T stripped of cv-qualifiers. Then, \c as_expr() /// returns <tt>Domain()(terminal\<A\>::type::make(t))</tt>. /// /// \param t The object to wrap. template<typename T> typename add_const<typename result_of::as_expr<T, default_domain>::type>::type as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)) { return default_domain::as_expr<T>()(t); } /// \overload /// template<typename T> typename add_const<typename result_of::as_expr<T const, default_domain>::type>::type as_expr(T const &t) { return default_domain::as_expr<T const>()(t); } /// \overload /// template<typename Domain, typename T> typename add_const<typename result_of::as_expr<T, Domain>::type>::type as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)) { return typename Domain::template as_expr<T>()(t); } /// \overload /// template<typename Domain, typename T> typename add_const<typename result_of::as_expr<T const, Domain>::type>::type as_expr(T const &t) { return typename Domain::template as_expr<T const>()(t); } /// \brief A function that wraps non-Proto expression types in Proto /// terminals (by reference) and returns Proto expression types by /// reference /// /// The <tt>as_child()</tt> function turns objects into Proto terminals if /// they are not Proto expression types already. Non-Proto types are /// held by reference. Types which are already Proto types are simply /// returned as-is. /// /// This function can be called either with an explicitly specified /// \c Domain parameter (i.e., <tt>as_child\<Domain\>(t)</tt>), or /// without (i.e., <tt>as_child(t)</tt>). If no domain is /// specified, \c default_domain is assumed. /// /// If <tt>is_expr\<T\>::value</tt> is \c true, then the argument is /// returned as-is. Otherwise, \c as_child() returns /// <tt>Domain()(terminal\<T &\>::type::make(t))</tt>. /// /// \param t The object to wrap. template<typename T> typename add_const<typename result_of::as_child<T, default_domain>::type>::type as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)) { return default_domain::as_child<T>()(t); } /// \overload /// template<typename T> typename add_const<typename result_of::as_child<T const, default_domain>::type>::type as_child(T const &t) { return default_domain::as_child<T const>()(t); } /// \overload /// template<typename Domain, typename T> typename add_const<typename result_of::as_child<T, Domain>::type>::type as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)) { return typename Domain::template as_child<T>()(t); } /// \overload /// template<typename Domain, typename T> typename add_const<typename result_of::as_child<T const, Domain>::type>::type as_child(T const &t) { return typename Domain::template as_child<T const>()(t); } /// \brief Return the Nth child of the specified Proto expression. /// /// Return the Nth child of the specified Proto expression. If /// \c N is not specified, as in \c child(expr), then \c N is assumed /// to be <tt>mpl::long_\<0\></tt>. The child is returned by /// reference. /// /// \param expr The Proto expression. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true. /// \pre \c N is an MPL Integral Constant. /// \pre <tt>N::value \< Expr::proto_arity::value</tt> /// \throw nothrow /// \return A reference to the Nth child template<typename N, typename Expr> typename result_of::child<Expr &, N>::type child(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr)) { return result_of::child<Expr &, N>::call(e); } /// \overload /// template<typename N, typename Expr> typename result_of::child<Expr const &, N>::type child(Expr const &e) { return result_of::child<Expr const &, N>::call(e); } /// \overload /// template<typename Expr2> typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::reference child(Expr2 &expr2 BOOST_PROTO_DISABLE_IF_IS_CONST(Expr2)) { return expr2.proto_base().child0; } /// \overload /// template<typename Expr2> typename detail::expr_traits<typename Expr2::proto_base_expr::proto_child0>::const_reference child(Expr2 const &expr2) { return expr2.proto_base().child0; } /// \brief Return the Nth child of the specified Proto expression. /// /// Return the Nth child of the specified Proto expression. The child /// is returned by reference. /// /// \param expr The Proto expression. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true. /// \pre <tt>N \< Expr::proto_arity::value</tt> /// \throw nothrow /// \return A reference to the Nth child template<long N, typename Expr> typename result_of::child_c<Expr &, N>::type child_c(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr)) { return result_of::child_c<Expr &, N>::call(e); } /// \overload /// template<long N, typename Expr> typename result_of::child_c<Expr const &, N>::type child_c(Expr const &e) { return result_of::child_c<Expr const &, N>::call(e); } /// \brief Return the value stored within the specified Proto /// terminal expression. /// /// Return the the value stored within the specified Proto /// terminal expression. The value is returned by /// reference. /// /// \param expr The Proto terminal expression. /// \pre <tt>N::value == 0</tt> /// \throw nothrow /// \return A reference to the terminal's value template<typename Expr> typename result_of::value<Expr &>::type value(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr)) { return e.proto_base().child0; } /// \overload /// template<typename Expr> typename result_of::value<Expr const &>::type value(Expr const &e) { return e.proto_base().child0; } /// \brief Return the left child of the specified binary Proto /// expression. /// /// Return the left child of the specified binary Proto expression. The /// child is returned by reference. /// /// \param expr The Proto expression. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true. /// \pre <tt>2 == Expr::proto_arity::value</tt> /// \throw nothrow /// \return A reference to the left child template<typename Expr> typename result_of::left<Expr &>::type left(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr)) { return e.proto_base().child0; } /// \overload /// template<typename Expr> typename result_of::left<Expr const &>::type left(Expr const &e) { return e.proto_base().child0; } /// \brief Return the right child of the specified binary Proto /// expression. /// /// Return the right child of the specified binary Proto expression. The /// child is returned by reference. /// /// \param expr The Proto expression. /// \pre <tt>is_expr\<Expr\>::value</tt> is \c true. /// \pre <tt>2 == Expr::proto_arity::value</tt> /// \throw nothrow /// \return A reference to the right child template<typename Expr> typename result_of::right<Expr &>::type right(Expr &e BOOST_PROTO_DISABLE_IF_IS_CONST(Expr)) { return e.proto_base().child1; } /// \overload /// template<typename Expr> typename result_of::right<Expr const &>::type right(Expr const &e) { return e.proto_base().child1; } /// INTERNAL ONLY /// template<typename Domain> struct is_callable<functional::as_expr<Domain> > : mpl::true_ {}; /// INTERNAL ONLY /// template<typename Domain> struct is_callable<functional::as_child<Domain> > : mpl::true_ {}; /// INTERNAL ONLY /// template<long N> struct is_callable<functional::child_c<N> > : mpl::true_ {}; /// INTERNAL ONLY /// template<typename N> struct is_callable<functional::child<N> > : mpl::true_ {}; }} #if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 ) #pragma warning(pop) #endif #endif
{ "pile_set_name": "Github" }
# mach: crisv3 crisv8 crisv10 crisv32 # output: ffffff00\nffff0000\n0\nbb113344\n # Test generic "move Ps,Rd" and "move Rs,Pd" insns; the ones with # functionality common to all models. .include "testutils.inc" start moveq -1,r3 clear.b r3 checkr3 ffffff00 moveq -1,r3 clear.w r3 checkr3 ffff0000 moveq -1,r3 clear.d r3 checkr3 0 moveq -1,r3 move.d 0xbb113344,r4 setf zcvn move r4,srp move srp,r3 test_cc 1 1 1 1 checkr3 bb113344 quit
{ "pile_set_name": "Github" }
{% extends "base.html" %} {% load static %} {% block content %} <div class="container"> <div class="row pull-right"> <div class="col-md-12"> <a href="{% url 'booking_manage_create' location.slug %}"> <i class="fa fa-plus-circle"></i> New Booking</a> </div> </div> <ul class="nav nav-tabs"> <li class="active"><a href="#pending" data-toggle="tab">Pending ({{pending.count}})</a></li> <li><a href="#approved" data-toggle="tab">Approved ({{approved.count}})</a></li> <li><a href="#confirmed" data-toggle="tab">Confirmed ({{confirmed.count}})</a></li> <li><a href="#owing" data-toggle="tab">Owing ({{owing|length}})</a></li> <li><a href="#canceled" data-toggle="tab">Canceled ({{canceled.count}})</a></li> </ul> <div class="tab-content" id="booking-list-tab-content"> <div class="tab-pane active" id="pending"> {% with bookings=pending %} {% include "snippets/booking_list_table.html" %} {% endwith %} </div> <div class="tab-pane" id="approved"> {% with bookings=approved %} {% include "snippets/booking_list_table.html" %} {% endwith %} </div> <div class="tab-pane" id="confirmed"> {% with bookings=confirmed %} {% include "snippets/booking_list_table.html" %} {% endwith %} <em>Only bookings with departure date in the future shown by default.</em> [ <a href="?show_all=True">Show All</a> ] </div> <div class="tab-pane" id="owing"> {% with bookings=owing %} <div class="bottom-spacer"><em>Only bookings confirmed but unpaid are shown.</em> </div> {% include "snippets/booking_list_table.html" %} {% endwith %} </div> <div class="tab-pane" id="canceled"> {% with bookings=canceled %} {% include "snippets/booking_list_table.html" %} {% endwith %} [ <a href="?show_all=True">Show All</a> ] </div> <div id="booking-manage-detail"> </div> </div> <div class="row row-spacer"> <div class="col-md-12"> <form method="POST"> <strong>Go To Booking:</strong> <input name="booking_id" size="4" placeholder="ID"/> <input type="submit" value="Go!"/> {% csrf_token %} </form> </div> </div> </div> {% endblock %} {% block extrajs %} <script type="text/javascript" src="https://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js"></script> <link href="https://cdn.datatables.net/1.10.5/css/jquery.dataTables.min.css" rel="stylesheet"> <script> jQuery.extend( jQuery.fn.dataTableExt.oSort, { "currency-pre": function ( a ) { a = (a==="-") ? 0 : a.replace( /[^\d\-\.]/g, "" ); return parseFloat( a ); }, "currency-asc": function ( a, b ) { return a - b; }, "currency-desc": function ( a, b ) { return b - a; } } ); $(document).ready(function() { var hash = window.location.hash; hash && $('ul.nav a[href="' + hash + '"]').tab('show'); $('.nav-tabs a').click(function (e) { $(this).tab('show'); var scrollmem = $('body').scrollTop(); window.location.hash = this.hash; $('html,body').scrollTop(scrollmem); }); $('.booking-list').dataTable({ "iDisplayLength": 50, "order": [[ 2, "asc"]], "aoColumns": [ { "sType": "numeric" }, { "sType": "string" }, { "sType": "date" }, { "sType": "date" }, { "sType": "string" }, { "sType": "numeric" }, { "sType": "currency" }, { "sType": "currency" }, { "sType": "html" } ] }); } ); </script> {% endblock %}
{ "pile_set_name": "Github" }
;- CONFOUNDED ;- VERSION 2.0 0x26170b26 TSwfBXljVwSN4B8ir5tZ3MqgF7BF6fSaxyG2XrV5ApbkzcCKYRd8nvCZ0M+PLeG73Drb9GKsObHbdMFslGzVtFjTzCDvDKO2GQBKhtK8mLe56YnVzGSFNy+8 RzPc5VhNzpOT8ELkCRwuJfyRjeShtN5+SyFqZPXgplOQ+Rmk38qaRf0VIETK34ROS+M8tMBVC0uQmDLMxRBMyf0ltfDHsu8IS/t2bsbjvugQlBehxksWGC68 TDEyOwoBw6MNQwUxBI0biizYPh4ifESpowWzmbQE6zhk63Vafzi88AccFjuappcUNueni2hpguYuGn9TEQ4IH6Jkkz8tvc1j5FvlCTPkL93HRF4SPMjegiO6 ddAHxXN97oURtRnErzaVHISKlMNFvrpbxLZ+7xD+g1jAKqr5ul2W1+HKSVnKvzC+fDg/jV9gUTOLdbNQCorh9fDTdT6gf7mWTQAWCfUFFaeT6aeSX7hDvy3T O5dz3W0obKO2mSfBKhpIivE9qG4uIFYb9M7MFgU152HPDsqdp6A63FLuydh26tQCHB7Iep5Po227Zsir6h0Y2mjayMNQNEUBgQTI9w0g6+x168jtI6q8mi0R Fr3Z5nF6uZcgAPnOrz6sExLez2nOvIR9J57qO1l6nOWfDesyMDMwqeXqWQ+9I1E4R5yAEXurYfAWp+yeGO95lD46WtmpTXWmKnSB+nGcc7+gU+xrnfTwsy3O DLG5+z/AatmtBcbTDOpLOkJc+MwX/ExDpn7P6JL33H7VZfhR318w52ljZo79r3CoNusrYntfQwGxGTknmJVo7G3lMAVpcH0aA5s0lBGC9+G0pDbcrfuynC42 YzCnWEzOS0mayE2LOWlbf9+6uMw8jmTT2rTw8Lt9+wXYM9Tu+IQ07llwRuHZeNMbmdGP5kmGoOH5gWtlgfmZHEmpGSRlxgXiEb0gBJfZy529tzyU7tYsojDd U/ZqzwwTOgCCoC7LGg/EWEMLiU82rDN8jP14IQVcZuhBiYGeG4ziAgkM8EOw7ah9pnDRt31MHVJmUcRNG5zHxYZBTrAo9KqOdkkLzrFAnCuOTSlx/ZqHeSeX M0gR6jPBQqiy/xNZheb4DFskF4Z5WK1WgWq3RaKmKf3HQmYsSHHFiEpThJwZEzu4B99r2KmzVLA2hhl68eNjNC4qoCvdy3j2Inz8g0vfdRekV9LXANVz5yrE e4rkSUpPCt8WnmmIOSHcN4kUqu6nOz9LavLp8c2X4POyjkl2f+khN/U3qw6C30nn2G18EeRVbZ/ZXxKeVxB/o9nGJdmOsva92Yq+emJjsjJZrPOrlAsQdS4s RN8epVQiCdKJNJT+NhddscbB1FWgoH+IzZhWrE5aQJJhOxbYvg/xB5ztvubiLCH/7IB25dQs2ZPDKZfkTyylpdT9Z2SCrJu+XxcfJORshLOa4iME1wyLNS1r clAoanp0EF6Scw+ZoTxRd8tiGeZrNfnrTMmwdauQg6Mhk+W0TOqQpby6/VcbXpEufKvXPSiVgfuLPEcIMXAJkfD3jxK9gs2kTRJrH/v7r74T4JkZWMcesyvl HjA502+WP0KkQwdFK81G+dB6HYguTXIswcWyQoksxkDnFeSv3bSyVF/4RVjT8YBWDQqLOszCCUez7OkLw1vNz+yf2BNEly+LwyZAnwdxXqnU+ozZJoJmOCsN P1TQfS0pGyK08XOSCpLUydgjJ+O+4rs06ekvd0F7IsxzA6o1OZ9AKBXx5a8h5HloKA5bQTXI9dghboE2P96zgCXe7A261ZCsJ4bakHhQATomqsHemRLJ8SsI AEFpXgyA74Mre68DmkYumZfmSat2iMYczYuYUyVOHFhhMvGnC4XfYadS9OY46TbMcV/T5blOUgoNxkVkeZ3gabOKjiSZ9DlYbKzrhOnA1cADP9lU0dqjjCxS JoxyJ0d1RkM4HSK/P7z6eZ5VD3Ukdaxs4tm6PAwwqWD2m+CQnzqFxFYE/v5ytpueCfTW6ZxhhKOxk8fiawoLPe2gT2eQv8zyQ7mLJW1lLxWUtWkEE4he5itd ZM6+FnK9pGKZPESnpViLac7FvHlpB5TkypDjuiqJtSTiv0xTjGYL5lwqqab7GNyPjOP9Rdi2pyvzGFI0SWGa+czlhYyBigQQUxtuUOX/y2Qc5Bu+18Us3i8T UXcJ5lqexdsD4J9fsUk7tYOr0YVjD0yK7CDVRC+N2RNx51csjuQ9/ZUGn5pAWceCaHXmW4UWKq2BU1+7Z7HcOnXAA0sW4idxj4mtMy5L2tRyrXoPMh8kBijx ZjuS5w0OfcSYRtLfGoFnuk5490U262KNC03GJAV/zhCCUd6cm502fG9ZWkHw5UJCFVoEtl1IaE2/xK7Ni579SmqL+/Bg9bfJgCxRbpVAEoh1f4Qh75rAKCr0 R8cyfnz5bM0IuIKTonrvPgYH32NqlqbPL3LSNytBLDEQTlSVDIJHbCVVHEY7avrKMFwntbiPtAmtR79MeX0TaGPKczCZhEDYBIyVDun46QA3L+YR0ca97CgJ fok3W1R47HkUH4ABNjovZAhUXiogtsbiqFqSk45RHCdT2nTHXgpf5AcmCm8WLvaOIWWsoS4tsiul23rGMiwQeeeEEfW8LMFQRqukbHssqcQWPH6gmKydjiW9 PLnXp2G53rS1B/B/LNq2AljYZhUtxopRAB+OjAjpOn6H+PrInVZMS+4MS1J3AP9Z1fCMP566tsBfkeqJameSDBqhWdIQCQBqODkAf60+SVmpdSypc6XtwCpi IUc3whCwQna7+IBNlF54Y9+n3gxxhO1hQ6ZSgKbICeYmJBTOykbVA4VgvmrhiLP94Eb2o9X+kJJFStfHT8WBJZfMx3UC2An+fo/PLCRWzZOKLksAtxGvpS1H bc0YtFSPSa0dvZf2tkH9jgyFVdHgiy+XKjeXbm5P6J0S7PY5rgUlAicEzBFqKUv9sXTPnhAubJJt08tZrS3/JYOASTpzrDb+dKmIC5zs0hOPPWiTa0ygZSnr RHGFHmlX/P6JY9kjqK2nJ8bqcrtv/QLDTy+E2yn0/jcgYP/jDdiu1j1AT8Q5x44XvFaOdLnZDmfrQuus+dZOX8DI2UDZ0e5D1Q3ANsnSPk3f70yNwdPWSjGK Ht5UjAlQo8MkNDHqmK4IuZBBht/3/NUM5NF+6WX0FdB1n4L6K9jbnBe+dfMsx7SyKSmTbzNZEzWh/WUhPJZA9mWXHgY7cekXh6IjlbiCPef2uL1ceXvXny2p PXoG0BEufPa15hjElJFnI9iokkjx42LBQKV0oub7zjYnpYff6l82b76jd2DKBEJL/acSJsA46EnLuiWFxSa9SFC0vlRHqZfIHTPzvIbuAog78FVI5k3IKC25 A8S0IVuqQKSquUG8MdN5ClcHPvSjQm3VB3Mi/M+rSbwETqzw/vd1qi9W4vJAUGOptV3Y74US+Lhvx0DhZ7O1MAKKDOYW4xP0NCyq5a5LQJYvf/nkch9pJyyP AMS8OEMZhJ8rOUWwvYqbF5fHPPLlbpzbZxOj/+y9MTu0fuxxb3xJ6fdOwrYKlf2IWVHIzaBwN6gZwUjwdQLSuDmJCO6fu6AwKa0o4ernGXQhvzjmUElF1i2v CNNbxgEGJZavMrZPnIVLk9XCxQ116XSZRhLfACT+xRok/lIOi12z+b8OnYp4hQCAfXHnU5l4SSwL0V8/aYbt+jCBAwkR+b+RrSktEi3GFqRj/Tofs9nCPihS T5p0Ii9fze0MliG9i6m/rgQQjvR+fw6HLvt6/KE1+BUQioDwybgt/aY39Pfb98+Cce1T7UjBLq2NnwVgAVpeOnOmLiall+ZxjLq7hffxOlRzNPFUXsJURi3a SHtr2TRpMjiPZq5ABjLAREXoyQq4srFyjizZA8JTJ+9A4VEPeAtCg7WCJrABLng9+De6zqWt9XJJcnHx9+wz1ZHQlG5ezNCGfYHmoYpcoS+LqV/GYBSZ+yws Ih1yUBnydcC6VaKEkP9juF9xT2jz1GCMg2CaMufgTxDGR3CX6tL2/HbRjHxIQqICGZ5vqIEbmG25pptC5bcFWmm64TfX4UvBgbTcDU7KbIx1s8KQAl//Ki5F Dwf4EwhZBTcs2OelGCrbw5Q37fg3vryxZsBLeoXVIQ60lxgz28hB88+5O63Qz/mFxSo0QE1dNa5X/La2g5RTu56X983k8OCx+iJXcFdCuTRIeIcujpuV9i5y JwDzhFbPKpE422Jut2HMEB42Lx3gGzdYo8AqCG4H5PrWFyiKriEjCf75ospqO0j4XYp485AnbRAbrJDvbSl/5Di/5OETrnaeKTZe5izt8iOh8oPls0wwfSoX BVJyBSWKKt8p8iKuDsNMN5aij328yndLZ4v6OEBvRPM0MsCSuRVzNbRsV8ZhoWDmeMCCdZXqeR+JCe2sb8/14/HtWkCS3TOdzZ8BtuxUUKJTpixN0xDhPSwU K0gXCkIMSay+2h6hNYbZDd0jFPSg/KXqW/gm7PVEm5mYlb/g35iEoHkjc2bK9os8CfgVJcBBjPIxlaYERRoPFa2jf5SHt87mY7gTXObhLh+EtaU41kpeYyvO B0QJk0yPTswo8hruuUnZvYsrFn78niWycPwnqdt127WNF79CSIAktnPiczeBets3jJiVDWWHpPfzJeYQF/kbF8z7X56uxkTn0xQDWfJZ6x/c4606XBY84yyP UryMInURIkgCBV29po7IfgTaMP5o7I3qDy6EWKd+LyuAx8aAz5TO6WUaX+3yRpSqGXWbXEQBIqCZcv0glipIK+bV0gbuL+15xgNFldItP9BWaA5cTCxWhCjG IR6YeRcuEUA71FeQF5FR+pgyteiwY0mlzkNeWMQafa5CWBOq1yfnqwRVtXj+HwALKdJuFsIt0su4mYAB1Tw3lmwlbJZPpNKng3sa3YLooD/01CH4ZE6Zcykz XmkfRj/87QWEb5QPg/gv2MfvVCd6V/o2ZT+zLKKnpWeX5mUQ5HkLz26KjiXnsHY5HL3zuHT+a1GgF87ojlXrW+BiS+LiEDzBxViJZ9Qy1wxXxeglTyOi6i1Y IH61AxvjJhY7ZEEtEffKURhqvrYzUA3zi25SeBUoeQRgzpW6v77l/pUe9nDKU4EhYXfPkuIPkN2e8tD9xS0Wnf8QxOhHrEIiSuHO4obs6H2QGUvn5ky9Uizk UStp+yRDaSWDzq9RDiftyMQ/yYg8uBY07sx65BrTa8x0noH0uENsmp82/FfJrUWT5GPKgWNOcIZe+ejKBY3msB8VWPOn/Do0OuMA73bE1HYoGCzhHlijVy0j d41mulHwJjQQnajxtP5KQI2WSlhh1MZ4RRAjiiTmmPgt2KxDp1mVALOV6oxGIDle8jJB7J4ydGJUbC54+zPkwhpfu6rYozsNuEZxQ8lrVOppSpQ3QY9jGSoZ Z1ztxABgwoGY9W1OnDY4GsmiKIf1sPNWYhKIZGnQGP29cfi0gcLVAvvBQPfVbZlf1hgU0VeUpFnGfz7mH+CM39NWM+Wqyo8D3MK1ZHBfju3bCPYknRUOGi8H UvZLyjb3YeYCID5Jh33pqQTIgQR4FRuPhKpULqCYfpJmLJaR5WbmNRZv9+VnP4DEoM9PWA69qJfHrSgis3QKuFO/OIf8gMwwHLYw1Vt6r3Q7MrT8CIee1ir5 L8CQbhtxt6Q8u1Obkb6CiBuFN+1zdKmRjBEdUK22rwxJWDMu4/GO+oHVpTrkdDSj6xJmN88YcqfY+gcVU6bnoFwUrxwM6bq8G2P7GKNOFDI42FEa9J3DdSqb a2CUHlHeAr4e61GjtOlYBQqtNvFh30PajA2Fz6JiW7XA/n5hZBv0psUGg50ngQmNSXv1ZC7iVggKTnS8o1v197VOlsj0lzOX787n8t9xUKfCjt9vyoJhPy6Y NWQtZHpojDGx6Q0eoTIfQt0sGK/rMu9/4ssQd3kZh/v+NTW9CaYagVpjJnMRX/6eBsknkzWNl4IXFB7HLuwVMjvjo/UyTMP1qJh9bDwcqJZhJZIguzSdJyah WjcH9lxlIOgGQJhXsjTJLob40gtisYhPwCPvo63XnFvFaEtXY8EXUUfNmQYkbHh2CB54Ka8U7c+QR4gaY6CoFHhKaJuU6p1mCUyY229Ph9+xz+D7Ep0Kgylx UTe2wl+JefuDwMDNs8Llp8Q4/kZiSpOGY8LphoUPkL+UmMhF960RI2812I9uWntPnGJY7QoP1tJixKP4MS01mgEL/Wq9rFOhtexSI/vs4Lxvn4WHWMy5Mi/b Ae9Lx3x/zcwrrL5PIjm/vJAOwQcqtz8FzNt+ryFxRv5DFAPRJZJ6AwTzvUUHRc7fKYFqCD6ANCO4MwUKq2rE4mxwLhPwj6sdg1G7n119HOJ0wXFZC4RHHSYY IZXDpwkzVVu7kfp/GJ/z91gQYx835BGjrlOMCS7Y0a3yUHqCIkaxqtxRgeyEr6sLRdB0XP91BsmNmbYgy5Bdl/ald4bA8uenzjsXVcVDur/SdCc8R5sUMyzc SQ8cmHRST8mP3JXgpi9+vsI21NDovFeEY0X0T2t18r4U20ahAJAgIy8UH/0VxOPPPHK7VDfAoquwc+ukr8qPpmhQWUTy346/gUGANNxVDjP1yWyMyxBOdS0U fkR3o2ottRIUeSB9KRCD0w/kDh4vI6E3ham6iaK7CefnrWHCZHddj1avDEynt10ZAK8yjO75fcAupi5Iw1ZgE6c6u7LEkfll5vTxT8dyNd5GE9QxRoPTgyn0 C4BhCVytlumumysoMlCSLtKVC7Sig6lJ7Zg4XORrDdhTtaCoxx9fkIyjbPn2A1wW7akC1kYjfUfYJ4xllztgUFx6aqRup3lEG1SZxJJpdc44w+B07A5ziyod KiqiFyv/Fgw+TkqnCfnSXBr/u3M/VwH0D6/DviqBWYYirl1ZoGp1vzQukgFFuckBMe/9qh/+N8w2Psjbu9XFFat2yPt40CvmYNLI6xlS3J+FAMjjKZOnIytI eJC8/3tWDBOXE0XTIa1fU05RPMkrfUB1pHcFQ6GUeUZ3Qj4nZeDl3x7Yo74nfIExpJTlda6ckW39gMW0Y2SWRc6pzkyUiIJOUj1LsO9+iEucdwlO0oWNSSpw UEJ/MXAeI7oDeiQ0JAlIh4RljDqpr04WRen7m+H9fneHjUFLRdRmR2a/HAg3ZsD9mKc6rqaRsYviIahZ52IGNkF5eLpWi8p3ldUQy45/LFf/gyTzYgVfRyg1 TUYyRzefbPWN+AKPB8nvIMMkn2c4TxfObUpXF4sMUpuT3JcNcKzwMWyX9yst2ovGnbNPPyvPlBfikZERIc0U+EEhZB413EMQFfkemb/U6OQ/lSPaetC9Hij7 cH7mOyA8fhETQWY5hJ7C04vjJD34cKgF8Jg+iFkCnW5NJbPSibuH25P7dX/h5wqB/JQWKVXJTCxLI6eCD95vehD4f1ei1f7RvRWTPXRQNgRr42UIHxLSbilw bpbO2yA/dqmcGflCDJHFj91R6Y28dyur28FYUHsBXLnYiQC+mLpnMFktLMnpZ/r0Gf868lGJNBY5ljHvjf5TZ6mitGFjxeDf4bj2phTYOQPFtdfFr1bV7TBs O641tVn3Yvm2jAF2MP3oJl6enpuj1QzJqJZUymvVTwhhIobzkNBu6AX47+9tUv4YN5XbYROTtmAuo0EmLPMSXCI4DAWzQ0BCJHWqlHybaU2nU3ncm3d9yisB ch15aHESYxkSVawarwJC0g5TSinAgvaUqnwRml3jK7zAyzVLvfnrge84KKJj+iY90uq9x5TH2nJcHPJ1b1kkVZtn1awSlltGeNpGQKxx5M+JBI+28wI7Cypf VF/vKkxUgV4Bd2e5sakZ9QJhq/vjf1sIJUZhV2YZeHE+ea8OJQVrQ5tpwSMOJ3nN+N1MByIpdYpJBwqVNC5zqZHqKdw/LfC4fZy4eLqsMTALp/Cq+GzR9CdL TXeEASWXpewNxdwqD8OqIAE5XYai2xx8NfUCVfRXR1Ivky28XxFqxaKgOkiKsnwOZDmxsuBj92uHdXRP1Qsy2fbTFrFPv1AATgAnzgLlYWwSab9xpEh52ieT K937WU9mz8k+te0CMDgUuhgjaqWPH92goUQB3PkuhSD/171o7588z/C2bLPKyU0aXS2fz0Beb+Gb/2NxBRX+nHiWHS4nsDYiCSKiAbbi0n2x+P2WfkugUixT IhdzuE1zvwA6UynwsTqG2p/zjN9jNpSfa49yxQ25mzqYNQ3sPfG1zcNBk/++whOKVMllaXpbwKmfDR4iGBcpOHrvI4epMV3wCB49VXGiZ5QxZrI8Hev6pilk WJolJGsmkFGHMwy4qJsw/kRCNc/xd1ETl0i2cV2BYeX+zfeuC/p5nkoPV0Ggx/WjkG4HNnVZM739Xq8Nn5ZQskvG+xBq8eE1kIrRHpBCOfZ9LMQZ7RvVlytw QcYOyVbenMcLuBfKPOQ9PYKll8GJccljbAd/bnkasUUZyAIxr4Um/YO5sx9qxEKIZaVqHBBY6CgHuxmYrRa9eDa0IFrzsZfQLjO8u9ziAoQicHLLS0vILikL VVRFY01Gb9IB8rKdMSBuswIjQWmjO+CrJWcUHkY7JQuU65WqtRRpWE2Fel9kAWTaC7EgIo8gYhsqLQ0f+JvgeRLjMajHYIhsBiqN3cOKjVo2fOp4RP+PwSUN M4wzsH9+53oyuAfyorcLa56HsGr0YUzZ+ip0o98KbwBIfJbHSr/+7BFX5/UAZTYaPcJfbCUIUmGriIMgt77gXGCt7Qb+5blCBT9aFdpIFc239gGcSB7DiirO eUWF3iwc8K8X+dJBgYULCYyFdQRXwVJ5axcODBL5e0ibw7qAmnTD+8K8b0fwPLKARCieNV0kkCwXfeOMC6iBej7XXVCg7onRqgICPvVNjYRgaK2J35wPrile etTzjUmIBRAWMunqM0db0onDbNIiCHob4JcCw6ym7HldOjXvbX4ObCHGD/4Whc5aJYqraa54LkGnrPkicgbeTGa/0AecOaZKBjZElWsmGkm2co7cEKnESCgS HDsUaUgbJdQlY5QeOQXqPBVqeZy5uDxyP9yQWPnm11Wqh+S62cmixmAqXsvJ3hgPhXyD80HVxWv31+1vBdAr2c6CWiEn0tyAUiiBhjbTpywcfexVvlMa+iwl ASdyBQy5+qSryKmsEdeODFKdyPKf6BD7BBtQ98pV2gqsfBX9diKTWlljuPkGF5hbiMhv7yYxBUHxDZthNiJLzE3vYSY+K+yKE54cBbovPym8pqKUeC1W+Cgw aFej5m++QOGfc0HfoFx5Ks1juMjrhetnwsdozuJkJ27POyvC5zvGx+DoJW5nPTKX36ykkwwXSpXrJmJHPyveP1tgLQSkuJdPousDi/JmgsvkHC1TXAmICSxK LPlxTiQF2Zu9AqaNjwqUG9la4NViv4Nh2cTc/BRlCNxZi8LorwhNAhmsTeLyvu/tub+KZ9xlvppptmmlSwgWIYGymEQAvsJ8dbDgtKVlqFIPsdzM94gdRS5Y SbWj2h8W6raPo+vtOpuIBWKLbtYOQLbasx+LxpKsqLPVdlDB29YrB8/ls0xY6uxWbgtEDBloFte5XrepHTl1F/9QaEcrpnPnysGYtTDp8J/QCWDMPU4xIy0a FRg8tR4VkwUh1w70GIG63BeSG16bQwqTppy5IfADVD1+PeEWawnUQbBDQoyIgjnd/VcI0OF71YJLwij+1YcjrZCIuOnP+Vi6fS3w4kLGZTGL/1TnhFn79Cvn a2tsFGKPwLYe7SYmpsS5AQ2sizRoyYtyIqDxMLBCFM0+ofSsZQNdHZsF7PIuJGLieOta77Io+B2JHAHhfC61YnHnrGYbLZPdjZp6paisAIJzpJHEcWzJLSpp Q6048RdJZ22KqIJSFqzLYEKP8rqubKzcFC5Vy/IMnwI/foZzXDyG7arW768LJIoaYALbQSCojGGFaME2NW6PXHfdzA2/jY7CDodKkHr8Dg2yKgnemETOailX MfaQf2XErKqzoFiRJWklC96psGwFt0V4QgFsuL95c8iMcQvazLTHu8llN+rbXLCgQcQyY8iUkTwVi7WnQXCB8j+sdkUFgomVqr+XtCf7jaZgNmdMtscPvy0q ZL0mbQqQtaOZBgMaEssDi05ZGaoyzlY3g1o4f578+m7o2BOydFMFZ/s3HNCaE0vfyPIi/ugzbIPREL3p0SN/Ld3h8mJNq3b6W5lVp4PvchGYpQZFZM1wZCr+ UOs8+yaDNTYDC4BXDkniTYZec7giHjhKdkaVSrQ11UmOSuYz/yAjyHJM349aqtiIDE/DUQhvpSgzTk0+IQ0b+CzOigm1vESQIw7pkn/k6yQk7thfmsi8/idE YW9SaiY/gl4bybcUjBw03D2NdxzjNNMCK68XGNSgoO2gvicaz2qZGmU2vxvCj4Xhh/LzG0R9C5x2kNUbBwRMog4hxhsmuO89snlPmzZmvvJsVQtbPgmWFSW0 c8mlCBT7hhoSv8kolnuaVwyHerTwliVkKrKJ1kxu3t4gMOh9gw2mA6Vx2KhkvBpt59FAwpdkxFpGgQz37oirQZYpKu1SfpzMfn054AwFhwoKVzBmozgK6SmQ Jb5p2G0PKua5hCRCoQzmLdu7jgXHhaTrQIhzjN1juYUPMYRA/bminYjFcCfD2gIz4RQRhUTXyHXF46RUB1EtVleYfrymkl/HnqWTyPZz5o/6O2Vy3gM6Kyy+ QRh2yiCTXWYL1KtJh8r36QcwTYP4TqIGp+6Sa0AFgHb+Bf27Gy+4a/BZ69QtrRVZzUVZfLPsQ8BTywAo/MzojByMLILbXL0qOy+618iUl/mo/nH9QXCCkC2K Npcv9l1TizOwNYnRs6G9T9/Bd3t86hfL2okXKxtPwonYLScDKJ0oKFl/PxcxdF14GdYzHT2A59A5grUYO/q6hCmo9hq4x5QuIb3Xm/lZA3ult0dbWZZI0SkV aK6DOje+ofyfDFEzjFQjoEj/tL1RKcYtCSpu0BU2tuKrXorumZMlLlry93Dxz0NhiQDIK93daNxx6ciDS9R9Ag2dSNcA0Pfts6cI/SVSsppsuijoN5OQISzU ag2F2FEGJyAeXlLAvwBKyo31MUdkK/yXYowsCSWzKxW3HgmhBNBuV9x/tFq842ddw0xHIGNRY9jOU76ejqNgmODcaGh8fMgcfzUhPZ4ErWIK8zwIajif3Saj J3zi3RcG9yY4wG9EFosDRZu7hDGuf0jOeLRujnIFbQuJM5vRnDh/6fHwYX5rJvaYTZGcKZCpsiAToWKCbW4QfDy5HdeTjcFSKzUifWz8KcWg8z2oE0Tdjikw dQwAvHEyhrcR3RDwrxIwBY+XFFzAis//ap4+oFlctYsbByLWv6YkmgLeI2zi1cEwJBm4INRQKfQnZXCGzxLdlibbFNXCs6enpgQm/ERjGr/ma7/ohwtEMykE Nh3h3AokPXGwVmDCkpFH4trxKEZy43oDyQ4giYTTbHVJ9qTKeUTOaiugR2ycmK5ZoLmPIOt2nkBlNWsG0IGGTAfzGRXNegpKNpAgHEOHzEmuIbyYhPkvSCiu D0gZvCGJTfAs2hL0jczeLhG2uunj3KZ7vbLx4lTUmlHrsNRnj1CERECxxqVikotOFTFPxBRzjMu/8Qt0rwMPCeqRKSzyu07oQCE4ANxnbhgVeTCWywl+YCsU bLP+J1L1Uq6dAu+9PvHaCcn46/oIezr5SanBc4GcTwsKpV0/U8ZZ2goPHJgU5f0boX49369IN+Hl1rJ5cp7SnEeC9aocdaAiFqjWQ6sAGX2+Pce3cLrF0i4R ONK1XR6qjqe3McqCGNYeCVlC/WY3wNb2CNfKGYxGuaaqM3qpUCqJo9JsDdu8tZUlxu6wyeHTGUxnh2hqScn30x0wqBIfyYO5gcNBAK/eCLB1iAwW8tXNNCzL OLn/WB2P28o3IuGGk8+VM5xKw1Ds3QP1+0zNPtNUSJZIz8oJzJDtJ5EOSZJDcr///e6IX4SDlpPLnui5Z3sCJdCm2MoWh0h+XTrA8655bVOb9MzvcgZ/xTCi KTtESgmlPFM/xrKLk1ntd5iaxWFeryFGYRjWPhL1Qdcd/9aZmnLetAGiWUtwP7ynpaeFMx0lFz/num4PK6hC88a0m5Ew7ugV1jPhXj1NvWZecFw5u5wX3ynj RBMRAAqqlrWJcLKAMFmwgcJrwcaJr4EV5uz6Q919NvZeI+CvW5LEiB94XMEI86soOtWC9iFDHPgoA23ttZtHECFoGmB/92rkJd2hpprBfB4nh3xF6Fp3Yyrp L+S+sTfctgg8qs90DG0CXpyPf509nVjd6jELZBrofRra6QmGMFZp9mkhkmcEjviXgfllpSd9tSf1lR5ENoQT/8+jI7S+eMCT0rg9TPoGqSXcNbIw2Dmd/iu3 H6Ycz1WjKImkrRBNN9nsklWNO7U+1j8ln68xTDpR1v56vjQwuBIiE4g2to75M9hl8XL30dmjJV5N0Nd+Setbw5OBxymBz2SN/KlPAmXdeypLPQsXl9R0+Suh JOvg7mC+k5k5LuDZp9Q6khvu7EhE6cq0IKLCqp/WNC69INzT3ONkSFHN3G5Td2FZjZBHoYyBecBzoY9GY3p1jAy5azWUh/OqMzUZDG95MLms8yAQkoZRMC1T djaF71uDEOWQQ9LbOkLRKMr78UqmirFmQQtMD9TeicaJ8KmKUUI8s8ujQcyIm9c10LgMcOF3IvZdNaqu1YFYF5vzecHP+mVn+JAQdkLH+9/JIaSthFk0gy/v PhIezV7lCSo0dxFMMnr8Q53gOzW8B7dN+5mxDHs5EspIpXQQmKZACZE7Fp7paeloffQn2dGOPdgLk796Tf3XgDCgcyuDxCKsLTmVA2TY2Doj9WYXF1alcSeY E0Gy4SgfpKWi3sdRCwwnoeEGzz4gvNq8RerLCbVkpDIXnMkSf4ibdb6nyB+a/oTWajpImWhFiweAdIjaERgM7/VT6Putts8bz8BY63PhruHSiYDjHMoeHC1y L+swSjq+lb48roOJgVkThRuP3+R7B2GNobb/fgmmfKplstMpoen3OYewxQJ1zjLwdrHOF5/d0BQOMUudatQhZjJxCVgQUNnfrFEoOq0SpYPjQTiL87ObrSuM PyabyyT3MQa06nflp2fhU/8nJ9NMmQlV806ITLVE3efvV/AMw4iQJlLjdwn4wr1vLq8tK2XLgU29OzoDF98Jymv0MZcu1U2JgJO0XTJQb6h1IHa4PBL+uCsh K/EcdXVEfac+o56ULSlNjZgoU26Bl3E7YUGdOf1p6GslVfMabbyKah33S4qL2JbIK40MU+DWggggryq/VVGIaCU+OckPkg1YJ/awciLzz8AmkvSvtEMujCiQ Lxtudzs5NjI81ScXCh/CQxywi6y+pDjTqi7xfMj0yZz5zecb8nOztfiz5SnlnBW2STBeAlf0w7eR8YOXjsCot/2RbV1iWp03y6EaOBQXh/fQuSGKrzEKlyzj Fs3LlxvPbJ+gGPvhEO/OmdfXzmMtTS4gXoJLpzOcXnwaKIlFPPTmUjh96DQ7QLpFqVdYjLialE5hwgDQ+XeDS4WIrP7ZgQjJ96366cn6TQhOv1HiQcfv6C8C Di6I4E+ggPSsTFTesFszJFFftkvPLk5vBfpvq9k2TMctiIpTf5NYPBmZ9y4Cz39jqbpSAaRddt3htIWWdxRyAkWz7l2esPBtl7BbuGpisVp+sYFKkAuRwSq6 Onn7RkboiDg2ZG2PtPcdRpnoLuDh0FdRaIKj2szK+t0Zs+Vj3UgFPgOC57hOnsvztKjfSoJ1rJXvPcMz5AAfJkL3TQ9XOsb/lBIKEQ6nqhP/YKmeImkcZSxk bTBcvmO1P5Ad5jB1rNLnHgkoq6lzU7rjsf35QhyTFB3tl1A3q3NDYkOiBI1wg2jdlLiu0B17fQJ/Nfv+q4d37YrzUWnw+XKacBAEIl1GcCGNYa6Hi5nxfCvU UI3EizFDbb6DHfLrDyrFgcb3ZVEQlrU9zi4GJjXpi+rKZr6Vify7qmpu7U15+I6oEEHfMBnGjjg9SUMOqdmOcCvNDRHx1g5UII8qHl3RzkYlLjmZi9IuTymG bl/WRQBygzwcd3sOF7oYxIzhpaAwdtWQYgZmep+gu70Ydjyw9P0ljgNgC1HaRFurtNmpPkgY5LnvBXgJgTa7MELrEJJloZT0FBwk35fqAxY/Z775bs/I5yma aSAjxg4F8xWf7g/JmgqBXEgstHdoP4nCEX/2rRElDY291lfALahPqmuCh3az7u65gKjvLfzNvjB1PdsAW1wWdA/3QRaIlMJWMpIMHeFwqEesIKqYVYKdTykJ VhWrxQ4MBLQAdMvDGAX3qbBTyXcpODK4bUBILTGm0DADyYiAPemhdDSNaNa7zhnWLy8Y/fjdxYei/iDoWVQrr+QWvOKJkNy7x2Ly5+HypzHW2NXlVcOa9C8/ bsSGrkxMMbUcHFTzOiVlAYxBslaCN37sc0l1veQhdhoMzRZIVypyYbMPJ7KOr/BcbO4/T+JtMUIDHrMxVAxRzbTm9Q4PPOGKbxrWEaKkuamC5MeedGiVuCfe aY8VmSzWpXsflJFuhGgh4YyVwhVetMaZ8yNNnApgqiBM+ApYoAqcfBMVqbr1P4dSPON4S9+lCsWrGBCzSuhMDmDlpM8ATu9rhRt+8SUdvtn35BPuN7QWAClw KzE633zQyHo+4advi3WawZ0rzZNwujOcQUt+6CTd4BQj3ALTAWaJ0bWXu2m6jI2Eb6JxInh8j64CuJQHmQSOu7Q15pVpuI4x73Nf3BHmjnRC0AN4rcmOVizI VPZKIFscaymBID68sYhszkVIgX7jb8W8InrbkmOcNLekVMFflPTTN+dDzDlvQKD3xshKihKamRfWDYnTrHeF595vaH9zAQuf2l4YqRy6TKPYRqDCK2fvPSwY N49eOBQc5eswvpUcPw2JIJ+M9igMih3NzJ1nNbNE9zxplaacT68L4jEVScijztymH1oxxkNqnq8Oc6RFPLe/DIppSgSBU4bdyW87LfWFnJ3U3jEAX/gHIigd ABOcMGOAeq6rUt62pktOCdLQ83/EJnD5RD3NMV+xaIq369sePNDKGlSoX4ijbrbwDyKGUvSNkhQy+O+/33wAZiwV20lKhMlfo2NBMgB4rcPk2AwPpQafjSsD CWFjki8vCqev6CHlgBTTJ96vIHj8KRPMaQ0PtMyffDAzVrRJw3V3dCzC9rJEgHLWIwjXz4d68Aek7cdxZoexb+cfTy4WeRHbxuYLAa4GQYHWGqkWcjnprCkX Hrmw4CAvLymkIsZajR/vQlXK0L7jtT7Nn4zEydTgVgp6r87yT0riaYg+S++Cn7hYcXaJYWR1FUAN0ugmFwBDzDOA2IWuuuiKLKnA1HJnvSmjPUz8nAkX+Czr Sv53RizoOcCOJCsNgf9vvkBriaJX/GAijWBwXxVfW+FpxYWpGafTr7u/cNMx1TqqeKkR/z3QVDmJPSRpO9LjcHH3PqI407jUDZIzx7lTFQYzoLV1eZND7ytd b8+wHQV4cowcv0giFT9vMgcvEJ+2PeXtLuAzaEKeCSO9HLUihHXN/evn9gfnAC+SQJpXlVa63qWVJIdcDmemPn/77ziiCRpzipRbCvQ+RFXwI4ET3yXrRida c9DB+F0ADNuSln7Ws4h+u86QjPj8/vYx0iHq6ttFsnRceVnjyJgQVhtVAGdBdsFHuMMspQWBqc/pCDrEJ/odi8HtsfS2x8ep1Z90bP5ZKrhfphag2hZcMDCz aS2yHURehoMfzcmgNaQwH4ifePSN0c/y6RoI9PtKsg1bRrn87q0nWaL+7vnKUEJadQbE70AS6EGP6s7hBTO9THKcy+YnoxfKDCfJZbbrQomzekgkfk9oKC0v DkN6mVeNiGIseS1gPEWSRZ9npjqJqzH9yelMuVDdyI7NBrtTF0w3Gshy6yY0hk7QyUroHafLch9gUs8pSmVC2hpFywIACGgBuEtJF6U+/WxpTAgdd6W32iZZ RNEJv3djnl+JFpr1Jrm3+cNQ/uk2ZhKQVMHT4j4JwCQfCUVnuj4pfjrtDiV4Jd3TqB8rhBkoJ4XhZjlUqa7arkXasDzx7aQ7l4T0iN3MG3H+q9bSy9zE1C3y ZZN7dxrmtYSZkq0VGvgpnEuwyq4af8MzCI3R2TQmM+0qDtVqCRtnqZpa2LK5i2Cp6FvFz/n/eThBRE5xWcV18BXLi64J2HOUP4xpQaHW8KYqr5g2ddGxPyy/ BW+jFFRYAiYp70Gmva9XZ52GlF3j9XrHY7TxCWh6RrYbttQSEQfqN7iyxp+tuTx36TDP2XPmV1fB8ct6HMnix9WRSSurXjgP36EIA3CV1WvauSiXHXAj2Sw+ ZzLnOW7+uK2Y5222KnckgEuoBUiwAVssEL2uMv06ZPo9N3uP26f7EavyEVFI6TTkYJCkPgFOUx4FIf6JpZ3g47f5U9J39Dkd7pUFf57A1eJCIy4palqjnSs1 AS6noRJkIhirzEN+HrliUlKfvZuYX2bUhBpqQ0mOYR1sfIinN89O0blj9lQm4XaeeMhIubZKciOJDYjKfh/wffHvaPOaNTFSTZ4Y72ggUcWTpqDhESrhjioK a8+BKFYk8cIev1C4vJEulYYEmNFKaW8VxVjT4hy8YvrOdF9/M35JC2DJMDOOtHR1HREuPXt7aeaKfyw5JD1PJm9TOoo3JG7/gsAx076o/hP0CbR/em62ZShx bYCNQiNe32AdvliLjKcXZgkEn9ZjaULfsevjfZSOaAPtnF0ob339bcOnggKShDfaVLptl+x40oGfNJpdUwagLHrz4bgMuZl6CBBcSqNmBdGxYYKz9InLhCuh akHXrW2UKXKeWdHWg9rp52p2c8vS4AYrN2EFSHz88MuXSReGrP4HO+76EO/jfvpIfoSV3cSiHdgxGV9B89xwkDtznDNc1PEkKNBijwtQsf4hAZ3RIJKRky5F Bt9aDnOjO0CoNL2prlru/lNjwvBALqCCBORV9p21gTUvAZd93dK+xZjdeblT74yf6RgVSgzNDyPB5aYzo1xO/dWbf490lO4SX6QTUR9wvmWau6U+KoKWXix8 HMM0GSWZCu4lGKAMp8B+rBRfyIDCY2YDjfb+4PibRX3rruL+yWH9TcW+3enBijfKV7bCYkX/0omess2nh8UgKHowykVm2Fl4CHHJtBZW5dAxUUhMrhG7hC74 E9JqaWfBq2AisaUYJGODxJgQYgKvEZCuW/mFCeUDPYGqLPEXV7tXrGB/1B0O52K6BVZGmCJJeDG3wo/atB51dG6I63v/NfPWAi3ZK1qgMIe0f0ADCGrRLye+ UoFErgOiGoeCPrx9nNl1lcbE7a1rVnOmVgvaQBCR8L+ebEG2rXIxM/pfjE3zg9H1yEZqsFz7IZZRSpnOi0dZp53M4HHgmWW/+4/crlV2e7PIrkLBj4H0tTDe bTod7EZSBqadxh5YtKJwDcmakwjNUu/7yZj9CtsLpolJvcMD/o2tG6uDU4ZCQAXwcLcAVYQay5QNMiy8ZzespjPwusiWoR8/rJHx8u5qRvPjIVRv0g/qFSvj YKInYlZn0AmbCYOdvLC+cETPzEBifor3DBBdB6i/vq4sZIIVcWUWO6Nb7ZwdiEJx5MRaWKv+6FRHC4G68MW9RhbsbEvdWBfPvh+as0uWwovqZmHPAPGoKStx CrCNKW7lofwuJli+KnqoKBDIn8ywB514PQ3jcP05B9Ar710u26ZKhCCeAgHI6ewuJSatlkFOP3un+vpdhZ3W0eaU0bhn9CIERiPESpbA2G4WeE6z7lqlWyt9 LfVYbE+Blug9hLIXuMM+h66r9Z15W1Yv4jxWWBmXYnvEd4e6qfF4UddSb0vxwnVEXsCbM13b884aCeEPC9cwi7htXBEg0VEp6V8CnjVSYfhBxi3Zv5P5kCwL ZklAWxOI0+OYf7uBFcIwq0nnQ+AxSvAaCIKxfCyAtGGxKPQos3qTXG391oL8h4DCA5dH19t5CQ20og99SIZN6m84qygBee+ZgvX5AqWGPqB0E1AX9/nWPCt4 amhMbWu4428eTRw2gNAIZ6p0kjrfQv3P2edSuHypJ6p6Ax12p35tABhJAbTKucP8i/oWdfz2PgRvkaesW0HWbgKhf0CImiJbtDkTNuF32EHvdSUN1YElTCmJ Z+DWCVGbM6aYq3uqP0bqjcssIfGIoKK7SMOkdnnyAasxlO+9r/F+iheXxdlq/my4Lr1LehBF/zAiNwkrrRg29CRyKANzttIWJ1C4lxzhoGemwfDdK0oZXyt3 WrecHWkPfauGA14iIwToocpan5stoQ4P43fQRSRbctH2a9uxNxdwBE5cQU4+sXFuEkeMMbpicdu8SmqOeAvxgetMmdGZPzGsQM/gfmmlUboVDlypkehhsShT Y/9Vv0aHHUWagbT1Pkv2dEqbaek6HzJWECQYYjg1UEe9e6CnuSBhT+vUfMV5qvnLwIOS9BnvtYnVKGXsqc0TqF/9nmDx3EC4Gpdjpt3U6TA4Ih1Fy9C99C5O PzRvbVF/4wE0wScYPzSC3h0ZD6iImZaSo9kzWnrtoLl+mSQrrn6uA7ARIBJqOYR8fX45n5AmC1IL1rBZbSnMxbCC9LoTri8ObSjWy6zt3uuD/cfzc0wmGSiH aeX8pSl2Rxofqm5+Azh1+Yalg7G9PmiI7iV6/0cfz5HdfhHpBrUupFvWpGImYF4+GIL+p7YK5nO5KNPFfj+6Ven9xXQaJRRGQZdOLKgoQ0+VoguA8S7oyyrB PxQMc3DFVrQ09BgTJWrTjB2hv5o3j6CqO7lzW779GTmotRU7ekRF8GEzJgsYGOuUBfA/kyk2vKY3kbNfMaGXP66hdTk96gLz4jkWCjvPyBXEdSeTuN0tZia8 HRmCWlvXQIyl9fstGPtdGPewZrYfcNxU+YIP/RiwnnTwERnRuVsyYffXEm5OoOpMdbKcnRJbgNqoGXLjHq4wtdbSBfG88tQ2XgCubntDo3eaafuhmJsY1y2Y Fl5hojDr7MSgdCB/j/6FPFdDjBtQ/JVjhvRygxXcm8VuC4THGeYzvbhYcGQx9cqj+VqRpL3ALD3JxORE+9rfclGL3rTY16bVnaxDzMlRGgZ7v41wwZJEbzBi Q5jr7GjfplGKlOXao+yFXEwBf2Pt0JdhCHcElm9osGWuVy7dko6RXmJCO/hsfYHDhEixapMECY33TfQj7LjNqk7PVodTZq+5kg4H1QyJnrB8bq98I34GNCw9 NI4HSzDTCdmxOR2PBWH8Ol9HPVQnijdxmsoyPLb/0tR4DLWI/kUgBglv9lLaGFlvsd5Xv8g25dvthodJQSG7gcOq7zIFqhSsVLzbD6fvwzofN8ERds0o8Sne LzGs9xUwLq285shaFZvipe4ayLuv9zg+QmTIy3LBVXOUW8jzHFpj1f9ESO8rF/iGSsuI4TCxNS+QDGjmPWJT+/1vmOW7i+CRy95g5Hj/OSRQhpzkmUVV/jAN BzrZ4jniOiGoxnddgPdEStG7pY570EpqRCzmSwnN6VmXf9+zIdw9wH7WQ0811NeMCgKNMT/QoqowaOoOOtKYOa1d2ZG4U4VwY8dAXnkTC9QEigy5mbNMhirO BBXQqTUwMk6pUfj6DRNqedPRYFmRimLBRL0EovZkWpCNKz/X6DpTF8nILexJG/r2QZK/YIG3NBeVoPMm5eFTZ/+51QXXymDfyrVGFE7f+QPQMw+cglU17Syi CWPRCWpfEQWv6XioIqze9l6ECNqt9D0PAjW/Ss965VIrdnMzwoe7xaDSlQ9EeRSOZQDmEQcGQyuH6d+eJrno+fadQ1m2Zj0QTicNOn4J1+QSeioLmj4inibo SLkGMnPMHXYPIp0zpO52bYBK/Qp3TfJadUzSE56cMEGPz8WfanTRTHKOTlkQAKHKDC6Lui06mYmzfulLs6eFqGzW2DN86Qu4AwLAjxtOTLA06MzRKJ3vNClV Vhf0dDCZ3DsAUOqUj8edQ4dR6W7Q4Blc7v1AOdXSWVrYtR2aeeFS8mMHPMqB9niPlfot9uXB9Sv/lLpt19oz+cqj8aBO19CQUDhURoJRISQddYa15BJZ/jCB RWdRHTDPkJGJ6ziiD+SePE2urNuQe7fBoI3Jydw1i5D5tPnrUTgWlVIrynoXvF4XBGZ4s7ZWenyGxId+QqvG6+kO7ymEbyoZwe7bAmcNXGBVnsEXlrxnXCx4 GalZ5ilmptwnqrLZibsruBQO6v9h51ywP27Z6RXJZzQq3sBiL9569iAGzKey1fQXpWrKxXxQM2fn3Mn0GxLQ38aHyGyos6ED1ipIoPFjGe3efIjG3YtFmjC/ d1at1ljdyVMQ8EZFu+WX948BvwZK8RwG6tVrDRxhXHdbIogAHTjQZCLM9gezmrtPtBDSlXz3lMvvYcXcG0EDCcLZTniomkjoVAULqvF37RgfaylD3YE/4Cp6 euaJ3WE8qnwWK9TCJx0DSgJk3u+urFDRLEXUUE7W0728Tka+glGgsmtOj8nkEhk1gM7rclczxfZ1DtkvjqMrl4/uwAFia1yn8p7MlhQPZz/MJsrdrz168yyZ AlQQbjn6llAqVBYdgfUz/hLxuJ1lwFCTvBFw2Bfa4SXrYRT6rte5/kDZJuvyURWTlQU/41wSQ6X/6zNnCzPovkqcNSUgoz0zkCe2BDVrV/X9eneUv49ilipu UgIBMB9tksiCWhA2mD26OkZUlD/bHQrgjn/+kWgvVwdpTkLOJx/V3Dv6k2CuiTsYOYT6I/J+VOApq9GHXAXjHCG8RFULODjiJbeOvCCm1R2nsmvItWmj4ieQ FdHW3GhgYtIhsHtCo7NnHZmDDSxF+EvRypsZHJt08JjJlboAcJoAOuM5wowvRlDtXOlXYquCe6qqgxCWzEHGAH8tJN3DGipsCv8++ES33FowFjPqh2EnQSmM UFl/jFlqwsmDUqHssb0ZskZy42X95EW1llDdJFvI67Z+QcIEiN68t4pJTZThVZc38E0KXNWQAvfNTym4z/LIF9POOErCw61n3I6ws8RbH9/bLvTPRxdGgzBw UUAJIwTnhtcD2T6Rt2M+NSS2BGhIvO3CkAE+kjNWhr9E0IFmLKg+BC233jWEWWx+GIL6sPcnQ8MegUH17BBROY2eHHrFreTwc6aiq8fsOxQMuv3DRszU5iq4 Cj3MogBxthsuRfb/l7OoU5BbZ1tc2gPUZXgHIxPP0J6fz74XGu+WEEC6bQwwcRj1hSufEL0CRRZ3/GMe+7vr546XnRnY5zyf8iJiGklJVyPMeJ2bgZ5i/SnI Ghe1hRF4poQmcuDCvbComZXq6OfPWw0ZzSxu034HcPBLw6rnCi/ni5WIeeUgLTqp/62QZDUsVDhKv2Skv6zjcBA2HsT67LjUPXKj9NhMlQYr0P1syRyD7y5u OlPwPB4thi42cWgymJWVYxJwBJfxapv9nsm2Q0o+uChItOiyACWVeBEz2M+lKAPQPfBA8XeuyIQrkYzuHu2tLiChauGqTB/7pTkZ5nAcxpHn9SBlnTSqJCoQ RqjY00O3wUWIKnJDPNOYdEPOirI7UwVWFI7pz7iTS8e/LthxeXNsj+r+wK4Zg38rwBbMwan7dvnVYsr2ccdyEF/Yye2d2XBkGoXIYGvWcV44K0imkNHxwzBc CIyXMw9h3wUvGlO5FLAWV5dzGk8vYsJH/tAhsTKLqE/KAbxOPH8dS9BpcrG7BUfJ3V0Vzni4aohbxyZxmWb8KBiKP65pibd4OSyzQZH+EtAp//U2bcXABCeb N4PevF6ki6iwmv/wuNk2il8049zLb0y4As/FYNgVdyisFl82/wLFy9lWnZzCh7GYSd3nWMR5EaARh186xwZBvD2qAwvGuemyK7ytE0ZmPbWgt/ofBgnXti21 P/u7QHzrL9m0pU2MqfbBmFMZq0jo3bUDB/tug+3uIVQpkRvXU83ZxiGhIX0M3CWPpbk8KCNU26vntTKCtJCkucazNdf/cpswVjA2fVqDhPQecbeoCHsLFizl D3QcOVmlFSesxBA2MdryRdG5u4i917BOXbVxUvvREUubsxQ/2NJByfiwJolJU+mISTG/0gGTPagR8XN/pfNXuD2RFSl3w2KwK6EmAh7beDQguT+Xqld1dinK JlHWtQbKyhA4VvV7HGaQ+6xC1isrCYER40jHgzC+CeREzc9XPWXNnhcPSz07iC+jvu4JCDj+3r3qHqgSuUWmMkBm+J/5mBp1lVrQ2Vn2xFZ/xMT6CcGrRyuE MoLeeiE4YJIyP3kcgRHAn5zAJj7RC5M8fgm/ic2/APIKbXNSQ+VJFbBfFT+EyG3mbUYmCWde/5+Dyr+SFpW2o/SM81+ucBI9zy/VOXICwHJS/kYKHDupVSeX aAd0jDTW7uifWSJmjfAHKkp/CRJU3c/5kFYoH49ULpB9QriZYpDeJAvI8NoUcqZ+MI3U+68DmlOtL0brcrsEReP+D+McZ0tORJarZysJbMuXIvklML5/CSi0 WzL24joJdbwGwmDdgQLjgAayrmb0oqG8kQdAtcZzgSps+gnMRgMJ+YMUqHCGO02QdOP4ruYnb6QPGFDB1il+vjLlhPZOLnYzrBtu7YIt8nXjZBvgZCwwViqd VESBsXEEzb6nd0R3KgsWg9BMn5SJjNu1xXZa73tkvKHv7hDxHYiXPEKepO4r/oLyFCb+4bDFiBW/etPmfVgNZmrUxWWbls/fgAPOJGjxroP1aEuEkUIeLS5/ ImnYjiSeAT2db/vlDsF+ReVPQHQ1xXNOR84MrL/YcMuWjqrA+tbxCf4u+fbYUbHoSn7QbckSEZgQVsSgQbPBoD1CzsaF4ym8K8jL9efLXbIgjclsVt9ntTCV Sm+Qh3Op4bIOSdfhqtyYDAD9/VLH45pvtRdSP8bLBFvv4gWJRl9LQcKYrlIGFWzMVCX7v6Ywfwofe1FJdiL26brUBDIeK7IYaAOuj6ovEGABaHvRcC1BXCg1 KYWIFVStXSm/vNqstUjQy90oxMD/nqEJ2/3O9tr1mehYl0vtyEAFmBkiCWBBGsugOfioJoW3rLwplfiF5+EfMiGjUNRWykb1pbgE/I5f6hZnta7o4hU8ZzAt dBuXzUOdPZoKZGdwBPRXobBbny6nQOK8bURjAfaauDIDy50WXneVdbSMYh2KAQPWby+dmGA6SIeC/mJalSftL/QWnbvvqT/7z2LiS1LuVpHS2N2zDE3iJCrw
{ "pile_set_name": "Github" }
//======================================================================== // GLFW 3.3 Wayland - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2014 Jonas Ådahl <[email protected]> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would // be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not // be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // //======================================================================== #include "internal.h" #include <assert.h> #include <errno.h> #include <limits.h> #include <linux/input.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <sys/timerfd.h> #include <unistd.h> #include <wayland-client.h> static inline int min(int n1, int n2) { return n1 < n2 ? n1 : n2; } static _GLFWwindow* findWindowFromDecorationSurface(struct wl_surface* surface, int* which) { int focus; _GLFWwindow* window = _glfw.windowListHead; if (!which) which = &focus; while (window) { if (surface == window->wl.decorations.top.surface) { *which = topDecoration; break; } if (surface == window->wl.decorations.left.surface) { *which = leftDecoration; break; } if (surface == window->wl.decorations.right.surface) { *which = rightDecoration; break; } if (surface == window->wl.decorations.bottom.surface) { *which = bottomDecoration; break; } window = window->next; } return window; } static void pointerHandleEnter(void* data, struct wl_pointer* pointer, uint32_t serial, struct wl_surface* surface, wl_fixed_t sx, wl_fixed_t sy) { // Happens in the case we just destroyed the surface. if (!surface) return; int focus = 0; _GLFWwindow* window = wl_surface_get_user_data(surface); if (!window) { window = findWindowFromDecorationSurface(surface, &focus); if (!window) return; } window->wl.decorations.focus = focus; _glfw.wl.serial = serial; _glfw.wl.pointerFocus = window; window->wl.hovered = GLFW_TRUE; _glfwPlatformSetCursor(window, window->wl.currentCursor); _glfwInputCursorEnter(window, GLFW_TRUE); } static void pointerHandleLeave(void* data, struct wl_pointer* pointer, uint32_t serial, struct wl_surface* surface) { _GLFWwindow* window = _glfw.wl.pointerFocus; if (!window) return; window->wl.hovered = GLFW_FALSE; _glfw.wl.serial = serial; _glfw.wl.pointerFocus = NULL; _glfwInputCursorEnter(window, GLFW_FALSE); } static void setCursor(_GLFWwindow* window, const char* name) { struct wl_buffer* buffer; struct wl_cursor* cursor; struct wl_cursor_image* image; struct wl_surface* surface = _glfw.wl.cursorSurface; struct wl_cursor_theme* theme = _glfw.wl.cursorTheme; int scale = 1; if (window->wl.scale > 1 && _glfw.wl.cursorThemeHiDPI) { // We only support up to scale=2 for now, since libwayland-cursor // requires us to load a different theme for each size. scale = 2; theme = _glfw.wl.cursorThemeHiDPI; } cursor = wl_cursor_theme_get_cursor(theme, name); if (!cursor) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Standard cursor not found"); return; } // TODO: handle animated cursors too. image = cursor->images[0]; if (!image) return; buffer = wl_cursor_image_get_buffer(image); if (!buffer) return; wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial, surface, image->hotspot_x / scale, image->hotspot_y / scale); wl_surface_set_buffer_scale(surface, scale); wl_surface_attach(surface, buffer, 0, 0); wl_surface_damage(surface, 0, 0, image->width, image->height); wl_surface_commit(surface); } static void pointerHandleMotion(void* data, struct wl_pointer* pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { _GLFWwindow* window = _glfw.wl.pointerFocus; const char* cursorName; if (!window) return; if (window->cursorMode == GLFW_CURSOR_DISABLED) return; else { window->wl.cursorPosX = wl_fixed_to_double(sx); window->wl.cursorPosY = wl_fixed_to_double(sy); } switch (window->wl.decorations.focus) { case mainWindow: _glfwInputCursorPos(window, wl_fixed_to_double(sx), wl_fixed_to_double(sy)); return; case topDecoration: if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) cursorName = "n-resize"; else cursorName = "left_ptr"; break; case leftDecoration: if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) cursorName = "nw-resize"; else cursorName = "w-resize"; break; case rightDecoration: if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) cursorName = "ne-resize"; else cursorName = "e-resize"; break; case bottomDecoration: if (window->wl.cursorPosX < _GLFW_DECORATION_WIDTH) cursorName = "sw-resize"; else if (window->wl.cursorPosX > window->wl.width + _GLFW_DECORATION_WIDTH) cursorName = "se-resize"; else cursorName = "s-resize"; break; default: assert(0); } setCursor(window, cursorName); } static void pointerHandleButton(void* data, struct wl_pointer* pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { _GLFWwindow* window = _glfw.wl.pointerFocus; int glfwButton; // Both xdg-shell and wl_shell use the same values. uint32_t edges = WL_SHELL_SURFACE_RESIZE_NONE; if (!window) return; if (button == BTN_LEFT) { switch (window->wl.decorations.focus) { case mainWindow: break; case topDecoration: if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) edges = WL_SHELL_SURFACE_RESIZE_TOP; else { if (window->wl.xdg.toplevel) xdg_toplevel_move(window->wl.xdg.toplevel, _glfw.wl.seat, serial); else wl_shell_surface_move(window->wl.shellSurface, _glfw.wl.seat, serial); } break; case leftDecoration: if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) edges = WL_SHELL_SURFACE_RESIZE_TOP_LEFT; else edges = WL_SHELL_SURFACE_RESIZE_LEFT; break; case rightDecoration: if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) edges = WL_SHELL_SURFACE_RESIZE_TOP_RIGHT; else edges = WL_SHELL_SURFACE_RESIZE_RIGHT; break; case bottomDecoration: if (window->wl.cursorPosX < _GLFW_DECORATION_WIDTH) edges = WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT; else if (window->wl.cursorPosX > window->wl.width + _GLFW_DECORATION_WIDTH) edges = WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT; else edges = WL_SHELL_SURFACE_RESIZE_BOTTOM; break; default: assert(0); } if (edges != WL_SHELL_SURFACE_RESIZE_NONE) { if (window->wl.xdg.toplevel) xdg_toplevel_resize(window->wl.xdg.toplevel, _glfw.wl.seat, serial, edges); else wl_shell_surface_resize(window->wl.shellSurface, _glfw.wl.seat, serial, edges); } } else if (button == BTN_RIGHT) { if (window->wl.decorations.focus != mainWindow && window->wl.xdg.toplevel) { xdg_toplevel_show_window_menu(window->wl.xdg.toplevel, _glfw.wl.seat, serial, window->wl.cursorPosX, window->wl.cursorPosY); return; } } // Don’t pass the button to the user if it was related to a decoration. if (window->wl.decorations.focus != mainWindow) return; _glfw.wl.serial = serial; /* Makes left, right and middle 0, 1 and 2. Overall order follows evdev * codes. */ glfwButton = button - BTN_LEFT; _glfwInputMouseClick(window, glfwButton, state == WL_POINTER_BUTTON_STATE_PRESSED ? GLFW_PRESS : GLFW_RELEASE, _glfw.wl.xkb.modifiers); } static void pointerHandleAxis(void* data, struct wl_pointer* pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { _GLFWwindow* window = _glfw.wl.pointerFocus; double x = 0.0, y = 0.0; // Wayland scroll events are in pointer motion coordinate space (think two // finger scroll). The factor 10 is commonly used to convert to "scroll // step means 1.0. const double scrollFactor = 1.0 / 10.0; if (!window) return; assert(axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL || axis == WL_POINTER_AXIS_VERTICAL_SCROLL); if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) x = wl_fixed_to_double(value) * scrollFactor; else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) y = wl_fixed_to_double(value) * scrollFactor; _glfwInputScroll(window, x, y); } static const struct wl_pointer_listener pointerListener = { pointerHandleEnter, pointerHandleLeave, pointerHandleMotion, pointerHandleButton, pointerHandleAxis, }; static void keyboardHandleKeymap(void* data, struct wl_keyboard* keyboard, uint32_t format, int fd, uint32_t size) { struct xkb_keymap* keymap; struct xkb_state* state; #ifdef HAVE_XKBCOMMON_COMPOSE_H struct xkb_compose_table* composeTable; struct xkb_compose_state* composeState; #endif char* mapStr; const char* locale; if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { close(fd); return; } mapStr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (mapStr == MAP_FAILED) { close(fd); return; } keymap = xkb_keymap_new_from_string(_glfw.wl.xkb.context, mapStr, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(mapStr, size); close(fd); if (!keymap) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to compile keymap"); return; } state = xkb_state_new(keymap); if (!state) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to create XKB state"); xkb_keymap_unref(keymap); return; } // Look up the preferred locale, falling back to "C" as default. locale = getenv("LC_ALL"); if (!locale) locale = getenv("LC_CTYPE"); if (!locale) locale = getenv("LANG"); if (!locale) locale = "C"; #ifdef HAVE_XKBCOMMON_COMPOSE_H composeTable = xkb_compose_table_new_from_locale(_glfw.wl.xkb.context, locale, XKB_COMPOSE_COMPILE_NO_FLAGS); if (composeTable) { composeState = xkb_compose_state_new(composeTable, XKB_COMPOSE_STATE_NO_FLAGS); xkb_compose_table_unref(composeTable); if (composeState) _glfw.wl.xkb.composeState = composeState; else _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to create XKB compose state"); } else { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to create XKB compose table"); } #endif xkb_keymap_unref(_glfw.wl.xkb.keymap); xkb_state_unref(_glfw.wl.xkb.state); _glfw.wl.xkb.keymap = keymap; _glfw.wl.xkb.state = state; _glfw.wl.xkb.controlMask = 1 << xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Control"); _glfw.wl.xkb.altMask = 1 << xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Mod1"); _glfw.wl.xkb.shiftMask = 1 << xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Shift"); _glfw.wl.xkb.superMask = 1 << xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Mod4"); _glfw.wl.xkb.capsLockMask = 1 << xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Lock"); _glfw.wl.xkb.numLockMask = 1 << xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Mod2"); } static void keyboardHandleEnter(void* data, struct wl_keyboard* keyboard, uint32_t serial, struct wl_surface* surface, struct wl_array* keys) { // Happens in the case we just destroyed the surface. if (!surface) return; _GLFWwindow* window = wl_surface_get_user_data(surface); if (!window) { window = findWindowFromDecorationSurface(surface, NULL); if (!window) return; } _glfw.wl.serial = serial; _glfw.wl.keyboardFocus = window; _glfwInputWindowFocus(window, GLFW_TRUE); } static void keyboardHandleLeave(void* data, struct wl_keyboard* keyboard, uint32_t serial, struct wl_surface* surface) { _GLFWwindow* window = _glfw.wl.keyboardFocus; if (!window) return; _glfw.wl.serial = serial; _glfw.wl.keyboardFocus = NULL; _glfwInputWindowFocus(window, GLFW_FALSE); } static int toGLFWKeyCode(uint32_t key) { if (key < sizeof(_glfw.wl.keycodes) / sizeof(_glfw.wl.keycodes[0])) return _glfw.wl.keycodes[key]; return GLFW_KEY_UNKNOWN; } #ifdef HAVE_XKBCOMMON_COMPOSE_H static xkb_keysym_t composeSymbol(xkb_keysym_t sym) { if (sym == XKB_KEY_NoSymbol || !_glfw.wl.xkb.composeState) return sym; if (xkb_compose_state_feed(_glfw.wl.xkb.composeState, sym) != XKB_COMPOSE_FEED_ACCEPTED) return sym; switch (xkb_compose_state_get_status(_glfw.wl.xkb.composeState)) { case XKB_COMPOSE_COMPOSED: return xkb_compose_state_get_one_sym(_glfw.wl.xkb.composeState); case XKB_COMPOSE_COMPOSING: case XKB_COMPOSE_CANCELLED: return XKB_KEY_NoSymbol; case XKB_COMPOSE_NOTHING: default: return sym; } } #endif static GLFWbool inputChar(_GLFWwindow* window, uint32_t key) { uint32_t code, numSyms; long cp; const xkb_keysym_t *syms; xkb_keysym_t sym; code = key + 8; numSyms = xkb_state_key_get_syms(_glfw.wl.xkb.state, code, &syms); if (numSyms == 1) { #ifdef HAVE_XKBCOMMON_COMPOSE_H sym = composeSymbol(syms[0]); #else sym = syms[0]; #endif cp = _glfwKeySym2Unicode(sym); if (cp != -1) { const int mods = _glfw.wl.xkb.modifiers; const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT)); _glfwInputChar(window, cp, mods, plain); } } return xkb_keymap_key_repeats(_glfw.wl.xkb.keymap, syms[0]); } static void keyboardHandleKey(void* data, struct wl_keyboard* keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { int keyCode; int action; _GLFWwindow* window = _glfw.wl.keyboardFocus; GLFWbool shouldRepeat; struct itimerspec timer = {}; if (!window) return; keyCode = toGLFWKeyCode(key); action = state == WL_KEYBOARD_KEY_STATE_PRESSED ? GLFW_PRESS : GLFW_RELEASE; _glfw.wl.serial = serial; _glfwInputKey(window, keyCode, key, action, _glfw.wl.xkb.modifiers); if (action == GLFW_PRESS) { shouldRepeat = inputChar(window, key); if (shouldRepeat && _glfw.wl.keyboardRepeatRate > 0) { _glfw.wl.keyboardLastKey = keyCode; _glfw.wl.keyboardLastScancode = key; if (_glfw.wl.keyboardRepeatRate > 1) timer.it_interval.tv_nsec = 1000000000 / _glfw.wl.keyboardRepeatRate; else timer.it_interval.tv_sec = 1; timer.it_value.tv_sec = _glfw.wl.keyboardRepeatDelay / 1000; timer.it_value.tv_nsec = (_glfw.wl.keyboardRepeatDelay % 1000) * 1000000; } } timerfd_settime(_glfw.wl.timerfd, 0, &timer, NULL); } static void keyboardHandleModifiers(void* data, struct wl_keyboard* keyboard, uint32_t serial, uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) { xkb_mod_mask_t mask; unsigned int modifiers = 0; _glfw.wl.serial = serial; if (!_glfw.wl.xkb.keymap) return; xkb_state_update_mask(_glfw.wl.xkb.state, modsDepressed, modsLatched, modsLocked, 0, 0, group); mask = xkb_state_serialize_mods(_glfw.wl.xkb.state, XKB_STATE_MODS_DEPRESSED | XKB_STATE_LAYOUT_DEPRESSED | XKB_STATE_MODS_LATCHED | XKB_STATE_LAYOUT_LATCHED); if (mask & _glfw.wl.xkb.controlMask) modifiers |= GLFW_MOD_CONTROL; if (mask & _glfw.wl.xkb.altMask) modifiers |= GLFW_MOD_ALT; if (mask & _glfw.wl.xkb.shiftMask) modifiers |= GLFW_MOD_SHIFT; if (mask & _glfw.wl.xkb.superMask) modifiers |= GLFW_MOD_SUPER; if (mask & _glfw.wl.xkb.capsLockMask) modifiers |= GLFW_MOD_CAPS_LOCK; if (mask & _glfw.wl.xkb.numLockMask) modifiers |= GLFW_MOD_NUM_LOCK; _glfw.wl.xkb.modifiers = modifiers; } #ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION static void keyboardHandleRepeatInfo(void* data, struct wl_keyboard* keyboard, int32_t rate, int32_t delay) { if (keyboard != _glfw.wl.keyboard) return; _glfw.wl.keyboardRepeatRate = rate; _glfw.wl.keyboardRepeatDelay = delay; } #endif static const struct wl_keyboard_listener keyboardListener = { keyboardHandleKeymap, keyboardHandleEnter, keyboardHandleLeave, keyboardHandleKey, keyboardHandleModifiers, #ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION keyboardHandleRepeatInfo, #endif }; static void seatHandleCapabilities(void* data, struct wl_seat* seat, enum wl_seat_capability caps) { if ((caps & WL_SEAT_CAPABILITY_POINTER) && !_glfw.wl.pointer) { _glfw.wl.pointer = wl_seat_get_pointer(seat); wl_pointer_add_listener(_glfw.wl.pointer, &pointerListener, NULL); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && _glfw.wl.pointer) { wl_pointer_destroy(_glfw.wl.pointer); _glfw.wl.pointer = NULL; } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !_glfw.wl.keyboard) { _glfw.wl.keyboard = wl_seat_get_keyboard(seat); wl_keyboard_add_listener(_glfw.wl.keyboard, &keyboardListener, NULL); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && _glfw.wl.keyboard) { wl_keyboard_destroy(_glfw.wl.keyboard); _glfw.wl.keyboard = NULL; } } static void seatHandleName(void* data, struct wl_seat* seat, const char* name) { } static const struct wl_seat_listener seatListener = { seatHandleCapabilities, seatHandleName, }; static void dataOfferHandleOffer(void* data, struct wl_data_offer* dataOffer, const char* mimeType) { } static const struct wl_data_offer_listener dataOfferListener = { dataOfferHandleOffer, }; static void dataDeviceHandleDataOffer(void* data, struct wl_data_device* dataDevice, struct wl_data_offer* id) { if (_glfw.wl.dataOffer) wl_data_offer_destroy(_glfw.wl.dataOffer); _glfw.wl.dataOffer = id; wl_data_offer_add_listener(_glfw.wl.dataOffer, &dataOfferListener, NULL); } static void dataDeviceHandleEnter(void* data, struct wl_data_device* dataDevice, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id) { } static void dataDeviceHandleLeave(void* data, struct wl_data_device* dataDevice) { } static void dataDeviceHandleMotion(void* data, struct wl_data_device* dataDevice, uint32_t time, wl_fixed_t x, wl_fixed_t y) { } static void dataDeviceHandleDrop(void* data, struct wl_data_device* dataDevice) { } static void dataDeviceHandleSelection(void* data, struct wl_data_device* dataDevice, struct wl_data_offer* id) { } static const struct wl_data_device_listener dataDeviceListener = { dataDeviceHandleDataOffer, dataDeviceHandleEnter, dataDeviceHandleLeave, dataDeviceHandleMotion, dataDeviceHandleDrop, dataDeviceHandleSelection, }; static void wmBaseHandlePing(void* data, struct xdg_wm_base* wmBase, uint32_t serial) { xdg_wm_base_pong(wmBase, serial); } static const struct xdg_wm_base_listener wmBaseListener = { wmBaseHandlePing }; static void registryHandleGlobal(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version) { if (strcmp(interface, "wl_compositor") == 0) { _glfw.wl.compositorVersion = min(3, version); _glfw.wl.compositor = wl_registry_bind(registry, name, &wl_compositor_interface, _glfw.wl.compositorVersion); } else if (strcmp(interface, "wl_subcompositor") == 0) { _glfw.wl.subcompositor = wl_registry_bind(registry, name, &wl_subcompositor_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { _glfw.wl.shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { _glfw.wl.shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_output") == 0) { _glfwAddOutputWayland(name, version); } else if (strcmp(interface, "wl_seat") == 0) { if (!_glfw.wl.seat) { _glfw.wl.seatVersion = min(4, version); _glfw.wl.seat = wl_registry_bind(registry, name, &wl_seat_interface, _glfw.wl.seatVersion); wl_seat_add_listener(_glfw.wl.seat, &seatListener, NULL); } } else if (strcmp(interface, "wl_data_device_manager") == 0) { if (!_glfw.wl.dataDeviceManager) { _glfw.wl.dataDeviceManager = wl_registry_bind(registry, name, &wl_data_device_manager_interface, 1); } } else if (strcmp(interface, "xdg_wm_base") == 0) { _glfw.wl.wmBase = wl_registry_bind(registry, name, &xdg_wm_base_interface, 1); xdg_wm_base_add_listener(_glfw.wl.wmBase, &wmBaseListener, NULL); } else if (strcmp(interface, "zxdg_decoration_manager_v1") == 0) { _glfw.wl.decorationManager = wl_registry_bind(registry, name, &zxdg_decoration_manager_v1_interface, 1); } else if (strcmp(interface, "wp_viewporter") == 0) { _glfw.wl.viewporter = wl_registry_bind(registry, name, &wp_viewporter_interface, 1); } else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) { _glfw.wl.relativePointerManager = wl_registry_bind(registry, name, &zwp_relative_pointer_manager_v1_interface, 1); } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) { _glfw.wl.pointerConstraints = wl_registry_bind(registry, name, &zwp_pointer_constraints_v1_interface, 1); } else if (strcmp(interface, "zwp_idle_inhibit_manager_v1") == 0) { _glfw.wl.idleInhibitManager = wl_registry_bind(registry, name, &zwp_idle_inhibit_manager_v1_interface, 1); } } static void registryHandleGlobalRemove(void *data, struct wl_registry *registry, uint32_t name) { int i; _GLFWmonitor* monitor; for (i = 0; i < _glfw.monitorCount; ++i) { monitor = _glfw.monitors[i]; if (monitor->wl.name == name) { _glfwInputMonitor(monitor, GLFW_DISCONNECTED, 0); return; } } } static const struct wl_registry_listener registryListener = { registryHandleGlobal, registryHandleGlobalRemove }; // Create key code translation tables // static void createKeyTables(void) { int scancode; memset(_glfw.wl.keycodes, -1, sizeof(_glfw.wl.keycodes)); memset(_glfw.wl.scancodes, -1, sizeof(_glfw.wl.scancodes)); _glfw.wl.keycodes[KEY_GRAVE] = GLFW_KEY_GRAVE_ACCENT; _glfw.wl.keycodes[KEY_1] = GLFW_KEY_1; _glfw.wl.keycodes[KEY_2] = GLFW_KEY_2; _glfw.wl.keycodes[KEY_3] = GLFW_KEY_3; _glfw.wl.keycodes[KEY_4] = GLFW_KEY_4; _glfw.wl.keycodes[KEY_5] = GLFW_KEY_5; _glfw.wl.keycodes[KEY_6] = GLFW_KEY_6; _glfw.wl.keycodes[KEY_7] = GLFW_KEY_7; _glfw.wl.keycodes[KEY_8] = GLFW_KEY_8; _glfw.wl.keycodes[KEY_9] = GLFW_KEY_9; _glfw.wl.keycodes[KEY_0] = GLFW_KEY_0; _glfw.wl.keycodes[KEY_SPACE] = GLFW_KEY_SPACE; _glfw.wl.keycodes[KEY_MINUS] = GLFW_KEY_MINUS; _glfw.wl.keycodes[KEY_EQUAL] = GLFW_KEY_EQUAL; _glfw.wl.keycodes[KEY_Q] = GLFW_KEY_Q; _glfw.wl.keycodes[KEY_W] = GLFW_KEY_W; _glfw.wl.keycodes[KEY_E] = GLFW_KEY_E; _glfw.wl.keycodes[KEY_R] = GLFW_KEY_R; _glfw.wl.keycodes[KEY_T] = GLFW_KEY_T; _glfw.wl.keycodes[KEY_Y] = GLFW_KEY_Y; _glfw.wl.keycodes[KEY_U] = GLFW_KEY_U; _glfw.wl.keycodes[KEY_I] = GLFW_KEY_I; _glfw.wl.keycodes[KEY_O] = GLFW_KEY_O; _glfw.wl.keycodes[KEY_P] = GLFW_KEY_P; _glfw.wl.keycodes[KEY_LEFTBRACE] = GLFW_KEY_LEFT_BRACKET; _glfw.wl.keycodes[KEY_RIGHTBRACE] = GLFW_KEY_RIGHT_BRACKET; _glfw.wl.keycodes[KEY_A] = GLFW_KEY_A; _glfw.wl.keycodes[KEY_S] = GLFW_KEY_S; _glfw.wl.keycodes[KEY_D] = GLFW_KEY_D; _glfw.wl.keycodes[KEY_F] = GLFW_KEY_F; _glfw.wl.keycodes[KEY_G] = GLFW_KEY_G; _glfw.wl.keycodes[KEY_H] = GLFW_KEY_H; _glfw.wl.keycodes[KEY_J] = GLFW_KEY_J; _glfw.wl.keycodes[KEY_K] = GLFW_KEY_K; _glfw.wl.keycodes[KEY_L] = GLFW_KEY_L; _glfw.wl.keycodes[KEY_SEMICOLON] = GLFW_KEY_SEMICOLON; _glfw.wl.keycodes[KEY_APOSTROPHE] = GLFW_KEY_APOSTROPHE; _glfw.wl.keycodes[KEY_Z] = GLFW_KEY_Z; _glfw.wl.keycodes[KEY_X] = GLFW_KEY_X; _glfw.wl.keycodes[KEY_C] = GLFW_KEY_C; _glfw.wl.keycodes[KEY_V] = GLFW_KEY_V; _glfw.wl.keycodes[KEY_B] = GLFW_KEY_B; _glfw.wl.keycodes[KEY_N] = GLFW_KEY_N; _glfw.wl.keycodes[KEY_M] = GLFW_KEY_M; _glfw.wl.keycodes[KEY_COMMA] = GLFW_KEY_COMMA; _glfw.wl.keycodes[KEY_DOT] = GLFW_KEY_PERIOD; _glfw.wl.keycodes[KEY_SLASH] = GLFW_KEY_SLASH; _glfw.wl.keycodes[KEY_BACKSLASH] = GLFW_KEY_BACKSLASH; _glfw.wl.keycodes[KEY_ESC] = GLFW_KEY_ESCAPE; _glfw.wl.keycodes[KEY_TAB] = GLFW_KEY_TAB; _glfw.wl.keycodes[KEY_LEFTSHIFT] = GLFW_KEY_LEFT_SHIFT; _glfw.wl.keycodes[KEY_RIGHTSHIFT] = GLFW_KEY_RIGHT_SHIFT; _glfw.wl.keycodes[KEY_LEFTCTRL] = GLFW_KEY_LEFT_CONTROL; _glfw.wl.keycodes[KEY_RIGHTCTRL] = GLFW_KEY_RIGHT_CONTROL; _glfw.wl.keycodes[KEY_LEFTALT] = GLFW_KEY_LEFT_ALT; _glfw.wl.keycodes[KEY_RIGHTALT] = GLFW_KEY_RIGHT_ALT; _glfw.wl.keycodes[KEY_LEFTMETA] = GLFW_KEY_LEFT_SUPER; _glfw.wl.keycodes[KEY_RIGHTMETA] = GLFW_KEY_RIGHT_SUPER; _glfw.wl.keycodes[KEY_MENU] = GLFW_KEY_MENU; _glfw.wl.keycodes[KEY_NUMLOCK] = GLFW_KEY_NUM_LOCK; _glfw.wl.keycodes[KEY_CAPSLOCK] = GLFW_KEY_CAPS_LOCK; _glfw.wl.keycodes[KEY_PRINT] = GLFW_KEY_PRINT_SCREEN; _glfw.wl.keycodes[KEY_SCROLLLOCK] = GLFW_KEY_SCROLL_LOCK; _glfw.wl.keycodes[KEY_PAUSE] = GLFW_KEY_PAUSE; _glfw.wl.keycodes[KEY_DELETE] = GLFW_KEY_DELETE; _glfw.wl.keycodes[KEY_BACKSPACE] = GLFW_KEY_BACKSPACE; _glfw.wl.keycodes[KEY_ENTER] = GLFW_KEY_ENTER; _glfw.wl.keycodes[KEY_HOME] = GLFW_KEY_HOME; _glfw.wl.keycodes[KEY_END] = GLFW_KEY_END; _glfw.wl.keycodes[KEY_PAGEUP] = GLFW_KEY_PAGE_UP; _glfw.wl.keycodes[KEY_PAGEDOWN] = GLFW_KEY_PAGE_DOWN; _glfw.wl.keycodes[KEY_INSERT] = GLFW_KEY_INSERT; _glfw.wl.keycodes[KEY_LEFT] = GLFW_KEY_LEFT; _glfw.wl.keycodes[KEY_RIGHT] = GLFW_KEY_RIGHT; _glfw.wl.keycodes[KEY_DOWN] = GLFW_KEY_DOWN; _glfw.wl.keycodes[KEY_UP] = GLFW_KEY_UP; _glfw.wl.keycodes[KEY_F1] = GLFW_KEY_F1; _glfw.wl.keycodes[KEY_F2] = GLFW_KEY_F2; _glfw.wl.keycodes[KEY_F3] = GLFW_KEY_F3; _glfw.wl.keycodes[KEY_F4] = GLFW_KEY_F4; _glfw.wl.keycodes[KEY_F5] = GLFW_KEY_F5; _glfw.wl.keycodes[KEY_F6] = GLFW_KEY_F6; _glfw.wl.keycodes[KEY_F7] = GLFW_KEY_F7; _glfw.wl.keycodes[KEY_F8] = GLFW_KEY_F8; _glfw.wl.keycodes[KEY_F9] = GLFW_KEY_F9; _glfw.wl.keycodes[KEY_F10] = GLFW_KEY_F10; _glfw.wl.keycodes[KEY_F11] = GLFW_KEY_F11; _glfw.wl.keycodes[KEY_F12] = GLFW_KEY_F12; _glfw.wl.keycodes[KEY_F13] = GLFW_KEY_F13; _glfw.wl.keycodes[KEY_F14] = GLFW_KEY_F14; _glfw.wl.keycodes[KEY_F15] = GLFW_KEY_F15; _glfw.wl.keycodes[KEY_F16] = GLFW_KEY_F16; _glfw.wl.keycodes[KEY_F17] = GLFW_KEY_F17; _glfw.wl.keycodes[KEY_F18] = GLFW_KEY_F18; _glfw.wl.keycodes[KEY_F19] = GLFW_KEY_F19; _glfw.wl.keycodes[KEY_F20] = GLFW_KEY_F20; _glfw.wl.keycodes[KEY_F21] = GLFW_KEY_F21; _glfw.wl.keycodes[KEY_F22] = GLFW_KEY_F22; _glfw.wl.keycodes[KEY_F23] = GLFW_KEY_F23; _glfw.wl.keycodes[KEY_F24] = GLFW_KEY_F24; _glfw.wl.keycodes[KEY_KPSLASH] = GLFW_KEY_KP_DIVIDE; _glfw.wl.keycodes[KEY_KPDOT] = GLFW_KEY_KP_MULTIPLY; _glfw.wl.keycodes[KEY_KPMINUS] = GLFW_KEY_KP_SUBTRACT; _glfw.wl.keycodes[KEY_KPPLUS] = GLFW_KEY_KP_ADD; _glfw.wl.keycodes[KEY_KP0] = GLFW_KEY_KP_0; _glfw.wl.keycodes[KEY_KP1] = GLFW_KEY_KP_1; _glfw.wl.keycodes[KEY_KP2] = GLFW_KEY_KP_2; _glfw.wl.keycodes[KEY_KP3] = GLFW_KEY_KP_3; _glfw.wl.keycodes[KEY_KP4] = GLFW_KEY_KP_4; _glfw.wl.keycodes[KEY_KP5] = GLFW_KEY_KP_5; _glfw.wl.keycodes[KEY_KP6] = GLFW_KEY_KP_6; _glfw.wl.keycodes[KEY_KP7] = GLFW_KEY_KP_7; _glfw.wl.keycodes[KEY_KP8] = GLFW_KEY_KP_8; _glfw.wl.keycodes[KEY_KP9] = GLFW_KEY_KP_9; _glfw.wl.keycodes[KEY_KPCOMMA] = GLFW_KEY_KP_DECIMAL; _glfw.wl.keycodes[KEY_KPEQUAL] = GLFW_KEY_KP_EQUAL; _glfw.wl.keycodes[KEY_KPENTER] = GLFW_KEY_KP_ENTER; for (scancode = 0; scancode < 256; scancode++) { if (_glfw.wl.keycodes[scancode] > 0) _glfw.wl.scancodes[_glfw.wl.keycodes[scancode]] = scancode; } } ////////////////////////////////////////////////////////////////////////// ////// GLFW platform API ////// ////////////////////////////////////////////////////////////////////////// int _glfwPlatformInit(void) { const char *cursorTheme; const char *cursorSizeStr; char *cursorSizeEnd; long cursorSizeLong; int cursorSize; _glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0"); if (!_glfw.wl.cursor.handle) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to open libwayland-cursor"); return GLFW_FALSE; } _glfw.wl.cursor.theme_load = (PFN_wl_cursor_theme_load) _glfw_dlsym(_glfw.wl.cursor.handle, "wl_cursor_theme_load"); _glfw.wl.cursor.theme_destroy = (PFN_wl_cursor_theme_destroy) _glfw_dlsym(_glfw.wl.cursor.handle, "wl_cursor_theme_destroy"); _glfw.wl.cursor.theme_get_cursor = (PFN_wl_cursor_theme_get_cursor) _glfw_dlsym(_glfw.wl.cursor.handle, "wl_cursor_theme_get_cursor"); _glfw.wl.cursor.image_get_buffer = (PFN_wl_cursor_image_get_buffer) _glfw_dlsym(_glfw.wl.cursor.handle, "wl_cursor_image_get_buffer"); _glfw.wl.egl.handle = _glfw_dlopen("libwayland-egl.so.1"); if (!_glfw.wl.egl.handle) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to open libwayland-egl"); return GLFW_FALSE; } _glfw.wl.egl.window_create = (PFN_wl_egl_window_create) _glfw_dlsym(_glfw.wl.egl.handle, "wl_egl_window_create"); _glfw.wl.egl.window_destroy = (PFN_wl_egl_window_destroy) _glfw_dlsym(_glfw.wl.egl.handle, "wl_egl_window_destroy"); _glfw.wl.egl.window_resize = (PFN_wl_egl_window_resize) _glfw_dlsym(_glfw.wl.egl.handle, "wl_egl_window_resize"); _glfw.wl.xkb.handle = _glfw_dlopen("libxkbcommon.so.0"); if (!_glfw.wl.xkb.handle) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to open libxkbcommon"); return GLFW_FALSE; } _glfw.wl.xkb.context_new = (PFN_xkb_context_new) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_context_new"); _glfw.wl.xkb.context_unref = (PFN_xkb_context_unref) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_context_unref"); _glfw.wl.xkb.keymap_new_from_string = (PFN_xkb_keymap_new_from_string) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_keymap_new_from_string"); _glfw.wl.xkb.keymap_unref = (PFN_xkb_keymap_unref) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_keymap_unref"); _glfw.wl.xkb.keymap_mod_get_index = (PFN_xkb_keymap_mod_get_index) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_keymap_mod_get_index"); _glfw.wl.xkb.keymap_key_repeats = (PFN_xkb_keymap_key_repeats) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_keymap_key_repeats"); _glfw.wl.xkb.state_new = (PFN_xkb_state_new) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_state_new"); _glfw.wl.xkb.state_unref = (PFN_xkb_state_unref) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_state_unref"); _glfw.wl.xkb.state_key_get_syms = (PFN_xkb_state_key_get_syms) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_state_key_get_syms"); _glfw.wl.xkb.state_update_mask = (PFN_xkb_state_update_mask) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_state_update_mask"); _glfw.wl.xkb.state_serialize_mods = (PFN_xkb_state_serialize_mods) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_state_serialize_mods"); #ifdef HAVE_XKBCOMMON_COMPOSE_H _glfw.wl.xkb.compose_table_new_from_locale = (PFN_xkb_compose_table_new_from_locale) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_table_new_from_locale"); _glfw.wl.xkb.compose_table_unref = (PFN_xkb_compose_table_unref) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_table_unref"); _glfw.wl.xkb.compose_state_new = (PFN_xkb_compose_state_new) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_state_new"); _glfw.wl.xkb.compose_state_unref = (PFN_xkb_compose_state_unref) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_state_unref"); _glfw.wl.xkb.compose_state_feed = (PFN_xkb_compose_state_feed) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_state_feed"); _glfw.wl.xkb.compose_state_get_status = (PFN_xkb_compose_state_get_status) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_state_get_status"); _glfw.wl.xkb.compose_state_get_one_sym = (PFN_xkb_compose_state_get_one_sym) _glfw_dlsym(_glfw.wl.xkb.handle, "xkb_compose_state_get_one_sym"); #endif _glfw.wl.display = wl_display_connect(NULL); if (!_glfw.wl.display) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to connect to display"); return GLFW_FALSE; } _glfw.wl.registry = wl_display_get_registry(_glfw.wl.display); wl_registry_add_listener(_glfw.wl.registry, &registryListener, NULL); createKeyTables(); _glfw.wl.xkb.context = xkb_context_new(0); if (!_glfw.wl.xkb.context) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Failed to initialize xkb context"); return GLFW_FALSE; } // Sync so we got all registry objects wl_display_roundtrip(_glfw.wl.display); // Sync so we got all initial output events wl_display_roundtrip(_glfw.wl.display); #ifdef __linux__ if (!_glfwInitJoysticksLinux()) return GLFW_FALSE; #endif _glfwInitTimerPOSIX(); _glfw.wl.timerfd = -1; if (_glfw.wl.seatVersion >= 4) _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); if (_glfw.wl.pointer && _glfw.wl.shm) { cursorTheme = getenv("XCURSOR_THEME"); cursorSizeStr = getenv("XCURSOR_SIZE"); cursorSize = 32; if (cursorSizeStr) { errno = 0; cursorSizeLong = strtol(cursorSizeStr, &cursorSizeEnd, 10); if (!*cursorSizeEnd && !errno && cursorSizeLong > 0 && cursorSizeLong <= INT_MAX) cursorSize = (int)cursorSizeLong; } _glfw.wl.cursorTheme = wl_cursor_theme_load(cursorTheme, cursorSize, _glfw.wl.shm); if (!_glfw.wl.cursorTheme) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Unable to load default cursor theme"); return GLFW_FALSE; } // If this happens to be NULL, we just fallback to the scale=1 version. _glfw.wl.cursorThemeHiDPI = wl_cursor_theme_load(cursorTheme, 2 * cursorSize, _glfw.wl.shm); _glfw.wl.cursorSurface = wl_compositor_create_surface(_glfw.wl.compositor); _glfw.wl.cursorTimerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); } if (_glfw.wl.seat && _glfw.wl.dataDeviceManager) { _glfw.wl.dataDevice = wl_data_device_manager_get_data_device(_glfw.wl.dataDeviceManager, _glfw.wl.seat); wl_data_device_add_listener(_glfw.wl.dataDevice, &dataDeviceListener, NULL); _glfw.wl.clipboardString = malloc(4096); if (!_glfw.wl.clipboardString) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Unable to allocate clipboard memory"); return GLFW_FALSE; } _glfw.wl.clipboardSize = 4096; } return GLFW_TRUE; } void _glfwPlatformTerminate(void) { #ifdef __linux__ _glfwTerminateJoysticksLinux(); #endif _glfwTerminateEGL(); if (_glfw.wl.egl.handle) { _glfw_dlclose(_glfw.wl.egl.handle); _glfw.wl.egl.handle = NULL; } #ifdef HAVE_XKBCOMMON_COMPOSE_H if (_glfw.wl.xkb.composeState) xkb_compose_state_unref(_glfw.wl.xkb.composeState); #endif if (_glfw.wl.xkb.keymap) xkb_keymap_unref(_glfw.wl.xkb.keymap); if (_glfw.wl.xkb.state) xkb_state_unref(_glfw.wl.xkb.state); if (_glfw.wl.xkb.context) xkb_context_unref(_glfw.wl.xkb.context); if (_glfw.wl.xkb.handle) { _glfw_dlclose(_glfw.wl.xkb.handle); _glfw.wl.xkb.handle = NULL; } if (_glfw.wl.cursorTheme) wl_cursor_theme_destroy(_glfw.wl.cursorTheme); if (_glfw.wl.cursorThemeHiDPI) wl_cursor_theme_destroy(_glfw.wl.cursorThemeHiDPI); if (_glfw.wl.cursor.handle) { _glfw_dlclose(_glfw.wl.cursor.handle); _glfw.wl.cursor.handle = NULL; } if (_glfw.wl.cursorSurface) wl_surface_destroy(_glfw.wl.cursorSurface); if (_glfw.wl.subcompositor) wl_subcompositor_destroy(_glfw.wl.subcompositor); if (_glfw.wl.compositor) wl_compositor_destroy(_glfw.wl.compositor); if (_glfw.wl.shm) wl_shm_destroy(_glfw.wl.shm); if (_glfw.wl.shell) wl_shell_destroy(_glfw.wl.shell); if (_glfw.wl.viewporter) wp_viewporter_destroy(_glfw.wl.viewporter); if (_glfw.wl.decorationManager) zxdg_decoration_manager_v1_destroy(_glfw.wl.decorationManager); if (_glfw.wl.wmBase) xdg_wm_base_destroy(_glfw.wl.wmBase); if (_glfw.wl.dataSource) wl_data_source_destroy(_glfw.wl.dataSource); if (_glfw.wl.dataDevice) wl_data_device_destroy(_glfw.wl.dataDevice); if (_glfw.wl.dataOffer) wl_data_offer_destroy(_glfw.wl.dataOffer); if (_glfw.wl.dataDeviceManager) wl_data_device_manager_destroy(_glfw.wl.dataDeviceManager); if (_glfw.wl.pointer) wl_pointer_destroy(_glfw.wl.pointer); if (_glfw.wl.keyboard) wl_keyboard_destroy(_glfw.wl.keyboard); if (_glfw.wl.seat) wl_seat_destroy(_glfw.wl.seat); if (_glfw.wl.relativePointerManager) zwp_relative_pointer_manager_v1_destroy(_glfw.wl.relativePointerManager); if (_glfw.wl.pointerConstraints) zwp_pointer_constraints_v1_destroy(_glfw.wl.pointerConstraints); if (_glfw.wl.idleInhibitManager) zwp_idle_inhibit_manager_v1_destroy(_glfw.wl.idleInhibitManager); if (_glfw.wl.registry) wl_registry_destroy(_glfw.wl.registry); if (_glfw.wl.display) { wl_display_flush(_glfw.wl.display); wl_display_disconnect(_glfw.wl.display); } if (_glfw.wl.timerfd >= 0) close(_glfw.wl.timerfd); if (_glfw.wl.cursorTimerfd >= 0) close(_glfw.wl.cursorTimerfd); if (_glfw.wl.clipboardString) free(_glfw.wl.clipboardString); if (_glfw.wl.clipboardSendString) free(_glfw.wl.clipboardSendString); } const char* _glfwPlatformGetVersionString(void) { return _GLFW_VERSION_NUMBER " Wayland EGL OSMesa" #if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) " clock_gettime" #else " gettimeofday" #endif " evdev" #if defined(_GLFW_BUILD_DLL) " shared" #endif ; }
{ "pile_set_name": "Github" }
import java.io.{File, PrintWriter} import java.nio.charset.Charset import java.nio.file.{Files, Paths} import SchemaGenerators.CompiledSchema import com.google.protobuf import com.google.protobuf.{Message, TextFormat => GTextFormat} import scalapb.{GeneratedMessage, JavaProtoSupport, TextFormat} import org.scalatest.propspec.AnyPropSpec import org.scalatest.matchers.should.Matchers import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks import org.scalatest.tagobjects.Slow import scalapb.descriptors.ScalaType import scala.jdk.CollectionConverters._ class GeneratedCodeSpec extends AnyPropSpec with ScalaCheckDrivenPropertyChecks with Matchers { val printer = GTextFormat.printer().escapingNonAscii(false) property("min and max id are consecutive over files") { forAll(GraphGen.genRootNode) { node => def validateMinMax(pairs: Seq[(Int, Int)]) = pairs.sliding(2).filter(_.size == 2).forall { case Seq((min1, max1), (min2, max2)) => min2 == max1 + 1 && min1 <= max1 && min2 <= max2 } val messageIdPairs: Seq[(Int, Int)] = node.files.flatMap { f => (f.minMessageId.map((_, f.maxMessageId.get))) } val enumIdPairs: Seq[(Int, Int)] = node.files.flatMap { f => (f.minEnumId.map((_, f.maxEnumId.get))) } validateMinMax(messageIdPairs) && validateMinMax(enumIdPairs) } } property("Java and Scala protos are equivalent", Slow) { forAll(SchemaGenerators.genCompiledSchema, workers(1), minSuccessful(20)) { (schema: CompiledSchema) => forAll(GenData.genMessageValueInstance(schema.rootNode)) { case (message, messageValue) => // Ascii to binary is the same. val messageAscii = messageValue.toAscii try { val builder = schema.javaBuilder(message) GTextFormat.merge(messageAscii, builder) val javaProto: protobuf.Message = builder.build() val companion = schema.scalaObject(message) val scalaProto = companion.fromAscii(messageValue.toAscii) val scalaBytes = scalaProto.toByteArray // Parsing in Scala the serialized bytes should give the same object. val scalaParsedFromBytes = companion.parseFrom(scalaBytes) scalaParsedFromBytes.toProtoString should be(scalaProto.toProtoString) scalaParsedFromBytes should be(scalaProto) // Parsing in Java the bytes serialized by Scala should give back javaProto: val javaProto2 = schema.javaParse(message, scalaBytes) javaProto2 should be(javaProto) // toJavaProto, fromJava should bring back the same object. val javaConversions = companion.asInstanceOf[JavaProtoSupport[GeneratedMessage, protobuf.Message]] javaConversions.fromJavaProto(javaProto) should be(scalaProto) javaConversions.toJavaProto(scalaProto) should be(javaProto) def javaParse(s: String): Message = { val builder = schema.javaBuilder(message) GTextFormat.merge(s, builder) builder.build() } // String representation are not always the same since maps do not preserve // the order. val scalaAscii = TextFormat.printToString(scalaProto) val scalaUnicodeAscii = TextFormat.printToUnicodeString(scalaProto) // Scala can parse the ASCII format generated by Java: companion.fromAscii(javaProto.toString) should be(scalaProto) companion.fromAscii(printer.printToString(javaProto)) should be(scalaProto) // Scala can parse the ASCII format generated by Scala: companion.fromAscii(scalaAscii) should be(scalaProto) try { companion.fromAscii(scalaUnicodeAscii) should be(scalaProto) } catch { case e: Exception => Files.write( Paths.get(s"/tmp/unicode.txt"), scalaUnicodeAscii.getBytes(Charset.forName("UTF-8")) ) throw e } // Java can parse the ASCII format generated by Scala: javaParse(scalaAscii) should be(javaProto) javaParse(scalaUnicodeAscii) should be(javaProto) // Java and Scala Descriptors have the same full names. // Enum and message fields have same full name references. companion.javaDescriptor.getFullName should be(companion.scalaDescriptor.fullName) companion.javaDescriptor.getFields.size should be( companion.scalaDescriptor.fields.size ) (companion.javaDescriptor.getFields.asScala zip companion.scalaDescriptor.fields) .foreach { case (jf, sf) => jf.getFullName should be(sf.fullName) jf.getJavaType() match { case com.google.protobuf.Descriptors.FieldDescriptor.JavaType.MESSAGE => jf.getMessageType().getFullName should be( sf.scalaType.asInstanceOf[ScalaType.Message].descriptor.fullName ) case com.google.protobuf.Descriptors.FieldDescriptor.JavaType.ENUM => jf.getEnumType().getFullName should be( sf.scalaType.asInstanceOf[ScalaType.Enum].descriptor.fullName ) case _ => } } } catch { case e: Exception => println(e.printStackTrace) println("Message: " + message.name) val pw = new PrintWriter(new File("/tmp/message.ascii")) pw.print(messageAscii) pw.close() throw new RuntimeException(e.getMessage, e) } } } } }
{ "pile_set_name": "Github" }
package sfBugs; import java.util.Currency; import java.util.Locale; import edu.umd.cs.findbugs.annotations.NoWarning; public class Bug3102313 { @Override public int hashCode() { return getCurrencyCode().hashCode(); } @Override @NoWarning("NP") public boolean equals(Object o) { try { return ((Bug3102313) o).getCurrencyCode().equals(getCurrencyCode()); } catch (Exception e) { return false; } } private String getCurrencyCode() { return Currency.getInstance(Locale.getDefault()).getCurrencyCode(); } }
{ "pile_set_name": "Github" }
/* * Copyright 2011 The LibYuv Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "libyuv/convert_argb.h" #include "libyuv/cpu_id.h" #ifdef HAVE_JPEG #include "libyuv/mjpeg_decoder.h" #endif #include "libyuv/planar_functions.h" // For CopyPlane and ARGBShuffle. #include "libyuv/rotate_argb.h" #include "libyuv/row.h" #include "libyuv/video_common.h" #ifdef __cplusplus namespace libyuv { extern "C" { #endif // Copy ARGB with optional flipping LIBYUV_API int ARGBCopy(const uint8* src_argb, int src_stride_argb, uint8* dst_argb, int dst_stride_argb, int width, int height) { if (!src_argb || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_argb = src_argb + (height - 1) * src_stride_argb; src_stride_argb = -src_stride_argb; } CopyPlane(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width * 4, height); return 0; } // Convert I422 to ARGB with matrix static int I420ToARGBMatrix(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, const struct YuvConstants* yuvconstants, int width, int height) { int y; void (*I422ToARGBRow)(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, uint8* rgb_buf, const struct YuvConstants* yuvconstants, int width) = I422ToARGBRow_C; if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } #if defined(HAS_I422TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { I422ToARGBRow = I422ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { I422ToARGBRow = I422ToARGBRow_SSSE3; } } #endif #if defined(HAS_I422TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { I422ToARGBRow = I422ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { I422ToARGBRow = I422ToARGBRow_AVX2; } } #endif #if defined(HAS_I422TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { I422ToARGBRow = I422ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { I422ToARGBRow = I422ToARGBRow_NEON; } } #endif #if defined(HAS_I422TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) && IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) { I422ToARGBRow = I422ToARGBRow_DSPR2; } #endif #if defined(HAS_I422TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { I422ToARGBRow = I422ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { I422ToARGBRow = I422ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); dst_argb += dst_stride_argb; src_y += src_stride_y; if (y & 1) { src_u += src_stride_u; src_v += src_stride_v; } } return 0; } // Convert I420 to ARGB. LIBYUV_API int I420ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I420ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvI601Constants, width, height); } // Convert I420 to ABGR. LIBYUV_API int I420ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I420ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuI601Constants, // Use Yvu matrix width, height); } // Convert J420 to ARGB. LIBYUV_API int J420ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I420ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvJPEGConstants, width, height); } // Convert J420 to ABGR. LIBYUV_API int J420ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I420ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuJPEGConstants, // Use Yvu matrix width, height); } // Convert H420 to ARGB. LIBYUV_API int H420ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I420ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvH709Constants, width, height); } // Convert H420 to ABGR. LIBYUV_API int H420ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I420ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuH709Constants, // Use Yvu matrix width, height); } // Convert I422 to ARGB with matrix static int I422ToARGBMatrix(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, const struct YuvConstants* yuvconstants, int width, int height) { int y; void (*I422ToARGBRow)(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, uint8* rgb_buf, const struct YuvConstants* yuvconstants, int width) = I422ToARGBRow_C; if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } // Coalesce rows. if (src_stride_y == width && src_stride_u * 2 == width && src_stride_v * 2 == width && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_y = src_stride_u = src_stride_v = dst_stride_argb = 0; } #if defined(HAS_I422TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { I422ToARGBRow = I422ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { I422ToARGBRow = I422ToARGBRow_SSSE3; } } #endif #if defined(HAS_I422TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { I422ToARGBRow = I422ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { I422ToARGBRow = I422ToARGBRow_AVX2; } } #endif #if defined(HAS_I422TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { I422ToARGBRow = I422ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { I422ToARGBRow = I422ToARGBRow_NEON; } } #endif #if defined(HAS_I422TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) && IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) { I422ToARGBRow = I422ToARGBRow_DSPR2; } #endif #if defined(HAS_I422TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { I422ToARGBRow = I422ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { I422ToARGBRow = I422ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); dst_argb += dst_stride_argb; src_y += src_stride_y; src_u += src_stride_u; src_v += src_stride_v; } return 0; } // Convert I422 to ARGB. LIBYUV_API int I422ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I422ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvI601Constants, width, height); } // Convert I422 to ABGR. LIBYUV_API int I422ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I422ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuI601Constants, // Use Yvu matrix width, height); } // Convert J422 to ARGB. LIBYUV_API int J422ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I422ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvJPEGConstants, width, height); } // Convert J422 to ABGR. LIBYUV_API int J422ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I422ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuJPEGConstants, // Use Yvu matrix width, height); } // Convert H422 to ARGB. LIBYUV_API int H422ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I422ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvH709Constants, width, height); } // Convert H422 to ABGR. LIBYUV_API int H422ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I422ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuH709Constants, // Use Yvu matrix width, height); } // Convert I444 to ARGB with matrix static int I444ToARGBMatrix(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, const struct YuvConstants* yuvconstants, int width, int height) { int y; void (*I444ToARGBRow)(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, uint8* rgb_buf, const struct YuvConstants* yuvconstants, int width) = I444ToARGBRow_C; if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } // Coalesce rows. if (src_stride_y == width && src_stride_u == width && src_stride_v == width && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_y = src_stride_u = src_stride_v = dst_stride_argb = 0; } #if defined(HAS_I444TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { I444ToARGBRow = I444ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { I444ToARGBRow = I444ToARGBRow_SSSE3; } } #endif #if defined(HAS_I444TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { I444ToARGBRow = I444ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { I444ToARGBRow = I444ToARGBRow_AVX2; } } #endif #if defined(HAS_I444TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { I444ToARGBRow = I444ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { I444ToARGBRow = I444ToARGBRow_NEON; } } #endif #if defined(HAS_I444TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { I444ToARGBRow = I444ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 8)) { I444ToARGBRow = I444ToARGBRow_DSPR2; } } #endif #if defined(HAS_I444TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { I444ToARGBRow = I444ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { I444ToARGBRow = I444ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { I444ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); dst_argb += dst_stride_argb; src_y += src_stride_y; src_u += src_stride_u; src_v += src_stride_v; } return 0; } // Convert I444 to ARGB. LIBYUV_API int I444ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I444ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvI601Constants, width, height); } // Convert I444 to ABGR. LIBYUV_API int I444ToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_abgr, int dst_stride_abgr, int width, int height) { return I444ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, dst_abgr, dst_stride_abgr, &kYvuI601Constants, // Use Yvu matrix width, height); } // Convert J444 to ARGB. LIBYUV_API int J444ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, uint8* dst_argb, int dst_stride_argb, int width, int height) { return I444ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, dst_argb, dst_stride_argb, &kYuvJPEGConstants, width, height); } // Convert I420 with Alpha to preattenuated ARGB. static int I420AlphaToARGBMatrix(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, const uint8* src_a, int src_stride_a, uint8* dst_argb, int dst_stride_argb, const struct YuvConstants* yuvconstants, int width, int height, int attenuate) { int y; void (*I422AlphaToARGBRow)(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, const uint8* a_buf, uint8* dst_argb, const struct YuvConstants* yuvconstants, int width) = I422AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8* src_argb, uint8* dst_argb, int width) = ARGBAttenuateRow_C; if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } #if defined(HAS_I422ALPHATOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { I422AlphaToARGBRow = I422AlphaToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { I422AlphaToARGBRow = I422AlphaToARGBRow_SSSE3; } } #endif #if defined(HAS_I422ALPHATOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { I422AlphaToARGBRow = I422AlphaToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { I422AlphaToARGBRow = I422AlphaToARGBRow_AVX2; } } #endif #if defined(HAS_I422ALPHATOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { I422AlphaToARGBRow = I422AlphaToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { I422AlphaToARGBRow = I422AlphaToARGBRow_NEON; } } #endif #if defined(HAS_I422ALPHATOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) && IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) { I422AlphaToARGBRow = I422AlphaToARGBRow_DSPR2; } #endif #if defined(HAS_I422ALPHATOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { I422AlphaToARGBRow = I422AlphaToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { I422AlphaToARGBRow = I422AlphaToARGBRow_MSA; } } #endif #if defined(HAS_ARGBATTENUATEROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; if (IS_ALIGNED(width, 4)) { ARGBAttenuateRow = ARGBAttenuateRow_SSSE3; } } #endif #if defined(HAS_ARGBATTENUATEROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { ARGBAttenuateRow = ARGBAttenuateRow_Any_AVX2; if (IS_ALIGNED(width, 8)) { ARGBAttenuateRow = ARGBAttenuateRow_AVX2; } } #endif #if defined(HAS_ARGBATTENUATEROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { ARGBAttenuateRow = ARGBAttenuateRow_Any_NEON; if (IS_ALIGNED(width, 8)) { ARGBAttenuateRow = ARGBAttenuateRow_NEON; } } #endif #if defined(HAS_ARGBATTENUATEROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { ARGBAttenuateRow = ARGBAttenuateRow_Any_MSA; if (IS_ALIGNED(width, 8)) { ARGBAttenuateRow = ARGBAttenuateRow_MSA; } } #endif for (y = 0; y < height; ++y) { I422AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, width); if (attenuate) { ARGBAttenuateRow(dst_argb, dst_argb, width); } dst_argb += dst_stride_argb; src_a += src_stride_a; src_y += src_stride_y; if (y & 1) { src_u += src_stride_u; src_v += src_stride_v; } } return 0; } // Convert I420 with Alpha to ARGB. LIBYUV_API int I420AlphaToARGB(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, const uint8* src_a, int src_stride_a, uint8* dst_argb, int dst_stride_argb, int width, int height, int attenuate) { return I420AlphaToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, src_a, src_stride_a, dst_argb, dst_stride_argb, &kYuvI601Constants, width, height, attenuate); } // Convert I420 with Alpha to ABGR. LIBYUV_API int I420AlphaToABGR(const uint8* src_y, int src_stride_y, const uint8* src_u, int src_stride_u, const uint8* src_v, int src_stride_v, const uint8* src_a, int src_stride_a, uint8* dst_abgr, int dst_stride_abgr, int width, int height, int attenuate) { return I420AlphaToARGBMatrix( src_y, src_stride_y, src_v, src_stride_v, // Swap U and V src_u, src_stride_u, src_a, src_stride_a, dst_abgr, dst_stride_abgr, &kYvuI601Constants, // Use Yvu matrix width, height, attenuate); } // Convert I400 to ARGB. LIBYUV_API int I400ToARGB(const uint8* src_y, int src_stride_y, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*I400ToARGBRow)(const uint8* y_buf, uint8* rgb_buf, int width) = I400ToARGBRow_C; if (!src_y || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } // Coalesce rows. if (src_stride_y == width && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_y = dst_stride_argb = 0; } #if defined(HAS_I400TOARGBROW_SSE2) if (TestCpuFlag(kCpuHasSSE2)) { I400ToARGBRow = I400ToARGBRow_Any_SSE2; if (IS_ALIGNED(width, 8)) { I400ToARGBRow = I400ToARGBRow_SSE2; } } #endif #if defined(HAS_I400TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { I400ToARGBRow = I400ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { I400ToARGBRow = I400ToARGBRow_AVX2; } } #endif #if defined(HAS_I400TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { I400ToARGBRow = I400ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { I400ToARGBRow = I400ToARGBRow_NEON; } } #endif #if defined(HAS_I400TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { I400ToARGBRow = I400ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { I400ToARGBRow = I400ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { I400ToARGBRow(src_y, dst_argb, width); dst_argb += dst_stride_argb; src_y += src_stride_y; } return 0; } // Convert J400 to ARGB. LIBYUV_API int J400ToARGB(const uint8* src_y, int src_stride_y, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*J400ToARGBRow)(const uint8* src_y, uint8* dst_argb, int width) = J400ToARGBRow_C; if (!src_y || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_y = src_y + (height - 1) * src_stride_y; src_stride_y = -src_stride_y; } // Coalesce rows. if (src_stride_y == width && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_y = dst_stride_argb = 0; } #if defined(HAS_J400TOARGBROW_SSE2) if (TestCpuFlag(kCpuHasSSE2)) { J400ToARGBRow = J400ToARGBRow_Any_SSE2; if (IS_ALIGNED(width, 8)) { J400ToARGBRow = J400ToARGBRow_SSE2; } } #endif #if defined(HAS_J400TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { J400ToARGBRow = J400ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { J400ToARGBRow = J400ToARGBRow_AVX2; } } #endif #if defined(HAS_J400TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { J400ToARGBRow = J400ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { J400ToARGBRow = J400ToARGBRow_NEON; } } #endif #if defined(HAS_J400TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { J400ToARGBRow = J400ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { J400ToARGBRow = J400ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { J400ToARGBRow(src_y, dst_argb, width); src_y += src_stride_y; dst_argb += dst_stride_argb; } return 0; } // Shuffle table for converting BGRA to ARGB. static uvec8 kShuffleMaskBGRAToARGB = {3u, 2u, 1u, 0u, 7u, 6u, 5u, 4u, 11u, 10u, 9u, 8u, 15u, 14u, 13u, 12u}; // Shuffle table for converting ABGR to ARGB. static uvec8 kShuffleMaskABGRToARGB = {2u, 1u, 0u, 3u, 6u, 5u, 4u, 7u, 10u, 9u, 8u, 11u, 14u, 13u, 12u, 15u}; // Shuffle table for converting RGBA to ARGB. static uvec8 kShuffleMaskRGBAToARGB = {1u, 2u, 3u, 0u, 5u, 6u, 7u, 4u, 9u, 10u, 11u, 8u, 13u, 14u, 15u, 12u}; // Convert BGRA to ARGB. LIBYUV_API int BGRAToARGB(const uint8* src_bgra, int src_stride_bgra, uint8* dst_argb, int dst_stride_argb, int width, int height) { return ARGBShuffle(src_bgra, src_stride_bgra, dst_argb, dst_stride_argb, (const uint8*)(&kShuffleMaskBGRAToARGB), width, height); } // Convert ARGB to BGRA (same as BGRAToARGB). LIBYUV_API int ARGBToBGRA(const uint8* src_bgra, int src_stride_bgra, uint8* dst_argb, int dst_stride_argb, int width, int height) { return ARGBShuffle(src_bgra, src_stride_bgra, dst_argb, dst_stride_argb, (const uint8*)(&kShuffleMaskBGRAToARGB), width, height); } // Convert ABGR to ARGB. LIBYUV_API int ABGRToARGB(const uint8* src_abgr, int src_stride_abgr, uint8* dst_argb, int dst_stride_argb, int width, int height) { return ARGBShuffle(src_abgr, src_stride_abgr, dst_argb, dst_stride_argb, (const uint8*)(&kShuffleMaskABGRToARGB), width, height); } // Convert ARGB to ABGR to (same as ABGRToARGB). LIBYUV_API int ARGBToABGR(const uint8* src_abgr, int src_stride_abgr, uint8* dst_argb, int dst_stride_argb, int width, int height) { return ARGBShuffle(src_abgr, src_stride_abgr, dst_argb, dst_stride_argb, (const uint8*)(&kShuffleMaskABGRToARGB), width, height); } // Convert RGBA to ARGB. LIBYUV_API int RGBAToARGB(const uint8* src_rgba, int src_stride_rgba, uint8* dst_argb, int dst_stride_argb, int width, int height) { return ARGBShuffle(src_rgba, src_stride_rgba, dst_argb, dst_stride_argb, (const uint8*)(&kShuffleMaskRGBAToARGB), width, height); } // Convert RGB24 to ARGB. LIBYUV_API int RGB24ToARGB(const uint8* src_rgb24, int src_stride_rgb24, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*RGB24ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) = RGB24ToARGBRow_C; if (!src_rgb24 || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24; src_stride_rgb24 = -src_stride_rgb24; } // Coalesce rows. if (src_stride_rgb24 == width * 3 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_rgb24 = dst_stride_argb = 0; } #if defined(HAS_RGB24TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { RGB24ToARGBRow = RGB24ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 16)) { RGB24ToARGBRow = RGB24ToARGBRow_SSSE3; } } #endif #if defined(HAS_RGB24TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { RGB24ToARGBRow = RGB24ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { RGB24ToARGBRow = RGB24ToARGBRow_NEON; } } #endif #if defined(HAS_RGB24TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { RGB24ToARGBRow = RGB24ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 8)) { RGB24ToARGBRow = RGB24ToARGBRow_DSPR2; } } #endif #if defined(HAS_RGB24TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { RGB24ToARGBRow = RGB24ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { RGB24ToARGBRow = RGB24ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { RGB24ToARGBRow(src_rgb24, dst_argb, width); src_rgb24 += src_stride_rgb24; dst_argb += dst_stride_argb; } return 0; } // Convert RAW to ARGB. LIBYUV_API int RAWToARGB(const uint8* src_raw, int src_stride_raw, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*RAWToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) = RAWToARGBRow_C; if (!src_raw || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_raw = src_raw + (height - 1) * src_stride_raw; src_stride_raw = -src_stride_raw; } // Coalesce rows. if (src_stride_raw == width * 3 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_raw = dst_stride_argb = 0; } #if defined(HAS_RAWTOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { RAWToARGBRow = RAWToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 16)) { RAWToARGBRow = RAWToARGBRow_SSSE3; } } #endif #if defined(HAS_RAWTOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { RAWToARGBRow = RAWToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { RAWToARGBRow = RAWToARGBRow_NEON; } } #endif #if defined(HAS_RAWTOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { RAWToARGBRow = RAWToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 8)) { RAWToARGBRow = RAWToARGBRow_DSPR2; } } #endif #if defined(HAS_RAWTOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { RAWToARGBRow = RAWToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { RAWToARGBRow = RAWToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { RAWToARGBRow(src_raw, dst_argb, width); src_raw += src_stride_raw; dst_argb += dst_stride_argb; } return 0; } // Convert RGB565 to ARGB. LIBYUV_API int RGB565ToARGB(const uint8* src_rgb565, int src_stride_rgb565, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*RGB565ToARGBRow)(const uint8* src_rgb565, uint8* dst_argb, int width) = RGB565ToARGBRow_C; if (!src_rgb565 || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_rgb565 = src_rgb565 + (height - 1) * src_stride_rgb565; src_stride_rgb565 = -src_stride_rgb565; } // Coalesce rows. if (src_stride_rgb565 == width * 2 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_rgb565 = dst_stride_argb = 0; } #if defined(HAS_RGB565TOARGBROW_SSE2) if (TestCpuFlag(kCpuHasSSE2)) { RGB565ToARGBRow = RGB565ToARGBRow_Any_SSE2; if (IS_ALIGNED(width, 8)) { RGB565ToARGBRow = RGB565ToARGBRow_SSE2; } } #endif #if defined(HAS_RGB565TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { RGB565ToARGBRow = RGB565ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { RGB565ToARGBRow = RGB565ToARGBRow_AVX2; } } #endif #if defined(HAS_RGB565TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { RGB565ToARGBRow = RGB565ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { RGB565ToARGBRow = RGB565ToARGBRow_NEON; } } #endif #if defined(HAS_RGB565TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { RGB565ToARGBRow = RGB565ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 8)) { RGB565ToARGBRow = RGB565ToARGBRow_DSPR2; } } #endif #if defined(HAS_RGB565TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { RGB565ToARGBRow = RGB565ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { RGB565ToARGBRow = RGB565ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { RGB565ToARGBRow(src_rgb565, dst_argb, width); src_rgb565 += src_stride_rgb565; dst_argb += dst_stride_argb; } return 0; } // Convert ARGB1555 to ARGB. LIBYUV_API int ARGB1555ToARGB(const uint8* src_argb1555, int src_stride_argb1555, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*ARGB1555ToARGBRow)(const uint8* src_argb1555, uint8* dst_argb, int width) = ARGB1555ToARGBRow_C; if (!src_argb1555 || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_argb1555 = src_argb1555 + (height - 1) * src_stride_argb1555; src_stride_argb1555 = -src_stride_argb1555; } // Coalesce rows. if (src_stride_argb1555 == width * 2 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_argb1555 = dst_stride_argb = 0; } #if defined(HAS_ARGB1555TOARGBROW_SSE2) if (TestCpuFlag(kCpuHasSSE2)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_SSE2; if (IS_ALIGNED(width, 8)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_SSE2; } } #endif #if defined(HAS_ARGB1555TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_AVX2; } } #endif #if defined(HAS_ARGB1555TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_NEON; } } #endif #if defined(HAS_ARGB1555TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 4)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_DSPR2; } } #endif #if defined(HAS_ARGB1555TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { ARGB1555ToARGBRow = ARGB1555ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { ARGB1555ToARGBRow(src_argb1555, dst_argb, width); src_argb1555 += src_stride_argb1555; dst_argb += dst_stride_argb; } return 0; } // Convert ARGB4444 to ARGB. LIBYUV_API int ARGB4444ToARGB(const uint8* src_argb4444, int src_stride_argb4444, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*ARGB4444ToARGBRow)(const uint8* src_argb4444, uint8* dst_argb, int width) = ARGB4444ToARGBRow_C; if (!src_argb4444 || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_argb4444 = src_argb4444 + (height - 1) * src_stride_argb4444; src_stride_argb4444 = -src_stride_argb4444; } // Coalesce rows. if (src_stride_argb4444 == width * 2 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_argb4444 = dst_stride_argb = 0; } #if defined(HAS_ARGB4444TOARGBROW_SSE2) if (TestCpuFlag(kCpuHasSSE2)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_SSE2; if (IS_ALIGNED(width, 8)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_SSE2; } } #endif #if defined(HAS_ARGB4444TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_AVX2; } } #endif #if defined(HAS_ARGB4444TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_NEON; } } #endif #if defined(HAS_ARGB4444TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 4)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_DSPR2; } } #endif #if defined(HAS_ARGB4444TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 16)) { ARGB4444ToARGBRow = ARGB4444ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { ARGB4444ToARGBRow(src_argb4444, dst_argb, width); src_argb4444 += src_stride_argb4444; dst_argb += dst_stride_argb; } return 0; } // Convert NV12 to ARGB. LIBYUV_API int NV12ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_uv, int src_stride_uv, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*NV12ToARGBRow)(const uint8* y_buf, const uint8* uv_buf, uint8* rgb_buf, const struct YuvConstants* yuvconstants, int width) = NV12ToARGBRow_C; if (!src_y || !src_uv || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } #if defined(HAS_NV12TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { NV12ToARGBRow = NV12ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_SSSE3; } } #endif #if defined(HAS_NV12TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { NV12ToARGBRow = NV12ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { NV12ToARGBRow = NV12ToARGBRow_AVX2; } } #endif #if defined(HAS_NV12TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { NV12ToARGBRow = NV12ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_NEON; } } #endif #if defined(HAS_NV12TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_DSPR2; } } #endif #if defined(HAS_NV12TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { NV12ToARGBRow = NV12ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width); dst_argb += dst_stride_argb; src_y += src_stride_y; if (y & 1) { src_uv += src_stride_uv; } } return 0; } // Convert NV21 to ARGB. LIBYUV_API int NV21ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_uv, int src_stride_uv, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*NV21ToARGBRow)(const uint8* y_buf, const uint8* uv_buf, uint8* rgb_buf, const struct YuvConstants* yuvconstants, int width) = NV21ToARGBRow_C; if (!src_y || !src_uv || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } #if defined(HAS_NV21TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { NV21ToARGBRow = NV21ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { NV21ToARGBRow = NV21ToARGBRow_SSSE3; } } #endif #if defined(HAS_NV21TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { NV21ToARGBRow = NV21ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { NV21ToARGBRow = NV21ToARGBRow_AVX2; } } #endif #if defined(HAS_NV21TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { NV21ToARGBRow = NV21ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { NV21ToARGBRow = NV21ToARGBRow_NEON; } } #endif #if defined(HAS_NV21TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { NV21ToARGBRow = NV21ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { NV21ToARGBRow = NV21ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width); dst_argb += dst_stride_argb; src_y += src_stride_y; if (y & 1) { src_uv += src_stride_uv; } } return 0; } // Convert M420 to ARGB. LIBYUV_API int M420ToARGB(const uint8* src_m420, int src_stride_m420, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*NV12ToARGBRow)(const uint8* y_buf, const uint8* uv_buf, uint8* rgb_buf, const struct YuvConstants* yuvconstants, int width) = NV12ToARGBRow_C; if (!src_m420 || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; dst_argb = dst_argb + (height - 1) * dst_stride_argb; dst_stride_argb = -dst_stride_argb; } #if defined(HAS_NV12TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { NV12ToARGBRow = NV12ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_SSSE3; } } #endif #if defined(HAS_NV12TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { NV12ToARGBRow = NV12ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 16)) { NV12ToARGBRow = NV12ToARGBRow_AVX2; } } #endif #if defined(HAS_NV12TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { NV12ToARGBRow = NV12ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_NEON; } } #endif #if defined(HAS_NV12TOARGBROW_DSPR2) if (TestCpuFlag(kCpuHasDSPR2)) { NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_DSPR2; } } #endif #if defined(HAS_NV12TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { NV12ToARGBRow = NV12ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { NV12ToARGBRow = NV12ToARGBRow_MSA; } } #endif for (y = 0; y < height - 1; y += 2) { NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, &kYuvI601Constants, width); NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2, dst_argb + dst_stride_argb, &kYuvI601Constants, width); dst_argb += dst_stride_argb * 2; src_m420 += src_stride_m420 * 3; } if (height & 1) { NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, &kYuvI601Constants, width); } return 0; } // Convert YUY2 to ARGB. LIBYUV_API int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*YUY2ToARGBRow)(const uint8* src_yuy2, uint8* dst_argb, const struct YuvConstants* yuvconstants, int width) = YUY2ToARGBRow_C; if (!src_yuy2 || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_yuy2 = src_yuy2 + (height - 1) * src_stride_yuy2; src_stride_yuy2 = -src_stride_yuy2; } // Coalesce rows. if (src_stride_yuy2 == width * 2 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_yuy2 = dst_stride_argb = 0; } #if defined(HAS_YUY2TOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { YUY2ToARGBRow = YUY2ToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 16)) { YUY2ToARGBRow = YUY2ToARGBRow_SSSE3; } } #endif #if defined(HAS_YUY2TOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { YUY2ToARGBRow = YUY2ToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 32)) { YUY2ToARGBRow = YUY2ToARGBRow_AVX2; } } #endif #if defined(HAS_YUY2TOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { YUY2ToARGBRow = YUY2ToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { YUY2ToARGBRow = YUY2ToARGBRow_NEON; } } #endif #if defined(HAS_YUY2TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { YUY2ToARGBRow = YUY2ToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { YUY2ToARGBRow = YUY2ToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvI601Constants, width); src_yuy2 += src_stride_yuy2; dst_argb += dst_stride_argb; } return 0; } // Convert UYVY to ARGB. LIBYUV_API int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, uint8* dst_argb, int dst_stride_argb, int width, int height) { int y; void (*UYVYToARGBRow)(const uint8* src_uyvy, uint8* dst_argb, const struct YuvConstants* yuvconstants, int width) = UYVYToARGBRow_C; if (!src_uyvy || !dst_argb || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. if (height < 0) { height = -height; src_uyvy = src_uyvy + (height - 1) * src_stride_uyvy; src_stride_uyvy = -src_stride_uyvy; } // Coalesce rows. if (src_stride_uyvy == width * 2 && dst_stride_argb == width * 4) { width *= height; height = 1; src_stride_uyvy = dst_stride_argb = 0; } #if defined(HAS_UYVYTOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { UYVYToARGBRow = UYVYToARGBRow_Any_SSSE3; if (IS_ALIGNED(width, 16)) { UYVYToARGBRow = UYVYToARGBRow_SSSE3; } } #endif #if defined(HAS_UYVYTOARGBROW_AVX2) if (TestCpuFlag(kCpuHasAVX2)) { UYVYToARGBRow = UYVYToARGBRow_Any_AVX2; if (IS_ALIGNED(width, 32)) { UYVYToARGBRow = UYVYToARGBRow_AVX2; } } #endif #if defined(HAS_UYVYTOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON)) { UYVYToARGBRow = UYVYToARGBRow_Any_NEON; if (IS_ALIGNED(width, 8)) { UYVYToARGBRow = UYVYToARGBRow_NEON; } } #endif #if defined(HAS_UYVYTOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { UYVYToARGBRow = UYVYToARGBRow_Any_MSA; if (IS_ALIGNED(width, 8)) { UYVYToARGBRow = UYVYToARGBRow_MSA; } } #endif for (y = 0; y < height; ++y) { UYVYToARGBRow(src_uyvy, dst_argb, &kYuvI601Constants, width); src_uyvy += src_stride_uyvy; dst_argb += dst_stride_argb; } return 0; } #ifdef __cplusplus } // extern "C" } // namespace libyuv #endif
{ "pile_set_name": "Github" }
/* Fontname: -FreeType-Amstrad CPC extended-Medium-R-Normal--8-80-72-72-P-64-ISO10646-1 Copyright: Copyright ruboku 2008 Glyphs: 18/228 BBX Build Mode: 3 */ const uint8_t u8g2_font_amstrad_cpc_extended_8n[235] U8X8_FONT_SECTION("u8g2_font_amstrad_cpc_extended_8n") = "\22\3\4\3\4\4\1\1\5\10\7\0\0\10\0\10\1\0\0\0\0\0\322 \7\210\343\307\21\0*\16" "\210\343\24\221!\71\10\241\21\221\7\1+\13\210\343\25\23\62\22\223\7\2,\11\210\343G-&%\4" "-\10\210\343\7\265G\3.\10\210\343G-&\13/\10\210\343\322g\361\0\60\22\210\343(\221\221\20" "\231\220\210\220\30\221\220\21)\5\61\12\210\343\221\32\323\221%\0\62\16\210c\241\21\21\223\241\21\23\21" "\261\4\63\15\210c\241\211\21\23\232\23QC\12\64\16\210\343\221\32\212\220\11\221\71\222\42\5\65\15\210" "\343\60\221\11\221\243\23QC\12\66\15\210c\241\21QV#\242\15)\0\67\14\210\343\60\211\221\232R" "\246\26\0\70\15\210c\241\21\321\206FD\33R\0\71\15\210c\241\21\321\246LD\15)\0:\12\210" "\343\7\22\23\27\223\5\0\0\0";
{ "pile_set_name": "Github" }
/* * Copyright (c) 2002-2012 Alibaba Group Holding Limited. * All rights reserved. * * 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 com.alibaba.citrus.service.form.impl.configuration; import static com.alibaba.citrus.util.ArrayUtil.*; import static com.alibaba.citrus.util.BasicConstant.*; import static com.alibaba.citrus.util.CollectionUtil.*; import static com.alibaba.citrus.util.StringUtil.*; import static java.util.Collections.*; import java.util.List; import com.alibaba.citrus.service.form.Validator; import com.alibaba.citrus.service.form.configuration.FieldConfig; import com.alibaba.citrus.service.form.configuration.GroupConfig; /** * 代表一个form field的定义信息。 * * @author Michael Zhou */ public class FieldConfigImpl extends AbstractConfig<FieldConfig> implements FieldConfig { private GroupConfig groupConfig; private String name; private String key; private String displayName; private String[] defaultValues; private Boolean trimming; private String propertyName; private List<Validator> validators; private List<Validator> validatorList; /** 取得field所属的group config。 */ public GroupConfig getGroupConfig() { return groupConfig; } /** 设置field所属的group config。 */ public void setGroupConfig(GroupConfig groupConfig) { this.groupConfig = groupConfig; } /** 取得field name。 */ public String getName() { return name; } /** 设置field name。 */ public void setName(String name) { this.name = trimToNull(name); } /** 取得field key。 */ public String getKey() { return key; } /** 设置field key。 */ public void setKey(String key) { this.key = trimToNull(key); } /** 取得用来显示field的名称。 */ public String getDisplayName() { return displayName == null ? getName() : displayName; } /** 设置用来显示field的名称。 */ public void setDisplayName(String displayName) { this.displayName = trimToNull(displayName); } /** 取得trimming选项。 */ public boolean isTrimming() { if (trimming == null) { return groupConfig == null ? true : getGroupConfig().isTrimmingByDefault(); } else { return trimming.booleanValue(); } } /** 设置trimming选项。 */ public void setTrimming(boolean trimming) { this.trimming = trimming; } /** 取得bean property名称。 */ public String getPropertyName() { return propertyName == null ? getName() : propertyName; } /** 设置bean property名称。 */ public void setPropertyName(String propertyName) { this.propertyName = trimToNull(propertyName); } /** 取得单个默认值。 */ public String getDefaultValue() { if (!isEmptyArray(defaultValues)) { return defaultValues[0]; } else { return null; } } /** 取得一组默认值。 */ public String[] getDefaultValues() { if (!isEmptyArray(defaultValues)) { return defaultValues.clone(); } else { return EMPTY_STRING_ARRAY; } } /** 设置默认值。 */ public void setDefaultValues(String[] defaultValues) { if (!isEmptyArray(defaultValues)) { this.defaultValues = defaultValues.clone(); } } /** 取得validator列表。 */ public List<Validator> getValidators() { if (validatorList == null) { return emptyList(); } else { return validatorList; } } /** 设置一组validator。 */ public void setValidators(List<Validator> validators) { if (validators != null) { initValidatorList(); this.validators.addAll(validators); } } private void initValidatorList() { validators = createArrayList(); validatorList = unmodifiableList(validators); } /** 将指定field中的内容复制到当前field中。 */ void mergeWith(FieldConfigImpl src) { if (name == null) { setName(src.name); } if (displayName == null) { setDisplayName(src.displayName); } if (isEmptyArray(defaultValues)) { setDefaultValues(src.defaultValues); } if (trimming == null) { trimming = src.trimming; } if (propertyName == null) { setPropertyName(src.propertyName); } if (validators == null) { initValidatorList(); } for (Validator validator : src.getValidators()) { validators.add(validator.clone()); } } /** 转换成易于阅读的字符串。 */ @Override public String toString() { String groupName = groupConfig == null ? null : groupConfig.getName(); return "FieldConfig[group: " + groupName + ", name: " + getName() + ", validators: " + getValidators().size() + "]"; } }
{ "pile_set_name": "Github" }
# # Copyright 2016-2017, Noah Kantrowitz # # 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. # require 'chef/platform/provider_priority_map' require 'poise_archive/archive_providers/gnu_tar' require 'poise_archive/archive_providers/seven_zip' require 'poise_archive/archive_providers/tar' require 'poise_archive/archive_providers/zip' module PoiseArchive # Providers for the poise_archive resource. # # @since 1.0.0 module ArchiveProviders # Set up priority maps Chef::Platform::ProviderPriorityMap.instance.priority(:poise_archive, [ PoiseArchive::ArchiveProviders::Zip, PoiseArchive::ArchiveProviders::GnuTar, PoiseArchive::ArchiveProviders::SevenZip, PoiseArchive::ArchiveProviders::Tar, ]) end end
{ "pile_set_name": "Github" }
#ifndef __reg_h__ #define __reg_h__ /* * Exception frame offsets. */ #define EF_V0 0 #define EF_T0 1 #define EF_T1 2 #define EF_T2 3 #define EF_T3 4 #define EF_T4 5 #define EF_T5 6 #define EF_T6 7 #define EF_T7 8 #define EF_S0 9 #define EF_S1 10 #define EF_S2 11 #define EF_S3 12 #define EF_S4 13 #define EF_S5 14 #define EF_S6 15 #define EF_A3 16 #define EF_A4 17 #define EF_A5 18 #define EF_T8 19 #define EF_T9 20 #define EF_T10 21 #define EF_T11 22 #define EF_RA 23 #define EF_T12 24 #define EF_AT 25 #define EF_SP 26 #define EF_PS 27 #define EF_PC 28 #define EF_GP 29 #define EF_A0 30 #define EF_A1 31 #define EF_A2 32 #define EF_SIZE (33*8) #define HWEF_SIZE (6*8) /* size of PAL frame (PS-A2) */ #define EF_SSIZE (EF_SIZE - HWEF_SIZE) /* * Map register number into core file offset. */ #define CORE_REG(reg, ubase) \ (((unsigned long *)((unsigned long)(ubase)))[reg]) #endif /* __reg_h__ */
{ "pile_set_name": "Github" }
var url = require('url') var qs = require('qs') var Grant = require('../grant') module.exports = function (args = {}) { var app = {} function register (server, options, next) { args = args.config ? args : {config: args} args.config = Object.keys(options).length ? options : args.config var grant = Grant(args) app.config = grant.config var prefix = app.config.defaults.prefix .replace(server.realm.modifiers.route.prefix, '') server.route({ method: ['GET', 'POST'], path: `${prefix}/{provider}/{override?}`, handler: (req, res) => { if (!(req.session || req.yar)) { throw new Error('Grant: register session plugin first') } var query = (parseInt(server.version.split('.')[0]) >= 12) ? qs.parse(url.parse(req.url, false).query) // #2985 : req.query var body = (parseInt(server.version.split('.')[0]) >= 12) ? qs.parse(req.payload) // #2985 : req.payload grant({ method: req.method, params: req.params, query: query, body: body, state: req.plugins.grant, session: (req.session || req.yar).get('grant'), }).then(({location, session, state}) => { ;(req.session || req.yar).set('grant', session) req.plugins.grant = state location ? res.redirect(location) : res.continue() }) } }) next() } register.attributes = { pkg: require('../../package.json') } app.register = register return app }
{ "pile_set_name": "Github" }
/* * Copyright 2010-2016 OrientDB LTD (http://orientdb.com) * * 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 com.orientechnologies.orient.server.distributed; import com.orientechnologies.common.concur.ONeedRetryException; import com.orientechnologies.orient.core.db.document.ODatabaseDocument; import com.orientechnologies.orient.core.exception.ORecordNotFoundException; import com.orientechnologies.orient.core.exception.OTransactionException; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.storage.ORecordDuplicatedException; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Set; import java.util.UUID; import java.util.concurrent.Callable; /** Test distributed TX */ public abstract class AbstractServerClusterTxTest extends AbstractServerClusterInsertTest { protected int printBlocksOf = 100; protected AbstractServerClusterTxTest() { useTransactions = true; } class TxWriter extends BaseWriter { public TxWriter(final int iServerId, final int iThreadId, final ServerRun serverRun) { super(iServerId, iThreadId, serverRun); } @Override public Void call() throws Exception { final String name = Integer.toString(threadId); Set<Integer> clusters = new LinkedHashSet<Integer>(); LinkedHashMap<String, Long> clusterNames = new LinkedHashMap<String, Long>(); for (int i = 0; i < count; i++) { final ODatabaseDocument database = getDatabase(serverRun); try { final int id = baseCount + i; final String uid = UUID.randomUUID().toString(); int retry; for (retry = 0; retry < maxRetries; retry++) { database.activateOnCurrentThread(); if ((i + 1) % printBlocksOf == 0) System.out.println( "\nWriter " + database.getURL() + "(thread=" + threadId + ") managed " + (i + 1) + "/" + count + " records so far"); if (useTransactions) database.begin(); try { ODocument person = createRecord(database, id, uid); updateRecord(database, person); checkRecord(database, person); deleteRecord(database, person); checkRecordIsDeleted(database, person); person = createRecord(database, id, uid); updateRecord(database, person); checkRecord(database, person); if (useTransactions) database.commit(); if (delayWriter > 0) Thread.sleep(delayWriter); clusters.add(person.getIdentity().getClusterId()); String clusterName = database.getClusterNameById(person.getIdentity().getClusterId()); Long counter = clusterNames.get(clusterName); if (counter == null) counter = 0L; clusterNames.put(clusterName, counter + 1); // OK break; } catch (InterruptedException e) { // STOP IT System.out.println("Writer received interrupt (db=" + database.getURL()); Thread.currentThread().interrupt(); break; } catch (ORecordNotFoundException e) { // IGNORE IT AND RETRY System.out.println( "ORecordNotFoundException Exception caught on writer thread " + threadId + " (db=" + database.getURL()); // e.printStackTrace(); } catch (ORecordDuplicatedException e) { // IGNORE IT AND RETRY System.out.println( "ORecordDuplicatedException Exception caught on writer thread " + threadId + " (db=" + database.getURL()); // e.printStackTrace(); } catch (OTransactionException e) { if (e.getCause() instanceof ORecordDuplicatedException) // IGNORE IT AND RETRY ; else throw e; } catch (ONeedRetryException e) { // System.out.println("ONeedRetryException Exception caught on writer thread " + // threadId + " (db=" + // database.getURL()); if (retry >= maxRetries) e.printStackTrace(); } catch (ODistributedException e) { System.out.println( "ODistributedException Exception caught on writer thread " + threadId + " (db=" + database.getURL()); if (!(e.getCause() instanceof ORecordDuplicatedException)) { database.rollback(); throw e; } // RETRY } catch (Throwable e) { System.out.println( e.getClass() + " Exception caught on writer thread " + threadId + " (db=" + database.getURL()); e.printStackTrace(); return null; } } } finally { runningWriters.countDown(); database.activateOnCurrentThread(); database.close(); } } System.out.println( "\nWriter " + name + " END total:" + count + " clusters:" + clusters + " names:" + clusterNames); return null; } } @Override protected Callable createWriter(final int i, final int threadId, final ServerRun serverRun) { return new TxWriter(i, threadId, serverRun); } }
{ "pile_set_name": "Github" }
/* PURPOSE: (UnitsMap) */ #ifndef UNITSMAP_HH #define UNITSMAP_HH #include <map> #include <string> namespace Trick { /** * This map stores all the variables and their units and * provides a convenient way of getting variables units. */ class UnitsMap { public: /** * Returns a pointer to the singleton Trick::UnitsMap instance. * @return A pointer to Trick::UnitsMap. */ static Trick::UnitsMap * units_map() ; /** * Constructor. */ UnitsMap() {} ; /** * Destructor. */ ~UnitsMap() ; /** * Adds a variable with specified units to the map. * @param param The name of the variable. * @param units The units of the variable. */ int add_param( std::string param , const char * units ) ; /** * Gets the units for a specified variable. * @param param The name of the variable. * @return The units of a specified variable. */ std::string get_units( std::string param ) ; private: std::map<std::string, char * > param_units ; static Trick::UnitsMap* pInstance ; } ; } #endif
{ "pile_set_name": "Github" }
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll, winapi_test winterm = None if windll is not None: winterm = WinTerm() def is_stream_closed(stream): return not hasattr(stream, 'closed') or stream.closed def is_a_tty(stream): return hasattr(stream, 'isatty') and stream.isatty() class StreamWrapper(object): ''' Wraps a stream (such as stdout), acting as a transparent proxy for all attribute access apart from method 'write()', which is delegated to our Converter instance. ''' def __init__(self, wrapped, converter): # double-underscore everything to prevent clashes with names of # attributes on the wrapped stream object. self.__wrapped = wrapped self.__convertor = converter def __getattr__(self, name): return getattr(self.__wrapped, name) def write(self, text): self.__convertor.write(text) class AnsiToWin32(object): ''' Implements a 'write()' method which, on Windows, will strip ANSI character sequences from the text, and if outputting to a tty, will convert them into win32 function calls. ''' ANSI_CSI_RE = re.compile('\001?\033\[((?:\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer ANSI_OSC_RE = re.compile('\001?\033\]((?:.|;)*?)(\x07)\002?') # Operating System Command def __init__(self, wrapped, convert=None, strip=None, autoreset=False): # The wrapped stream (normally sys.stdout or sys.stderr) self.wrapped = wrapped # should we reset colors to defaults after every .write() self.autoreset = autoreset # create the proxy wrapping our output stream self.stream = StreamWrapper(wrapped, self) on_windows = os.name == 'nt' # We test if the WinAPI works, because even if we are on Windows # we may be using a terminal that doesn't support the WinAPI # (e.g. Cygwin Terminal). In this case it's up to the terminal # to support the ANSI codes. conversion_supported = on_windows and winapi_test() # should we strip ANSI sequences from our output? if strip is None: strip = conversion_supported or (not is_stream_closed(wrapped) and not is_a_tty(wrapped)) self.strip = strip # should we should convert ANSI sequences into win32 calls? if convert is None: convert = conversion_supported and not is_stream_closed(wrapped) and is_a_tty(wrapped) self.convert = convert # dict of ansi codes to win32 functions and parameters self.win32_calls = self.get_win32_calls() # are we wrapping stderr? self.on_stderr = self.wrapped is sys.stderr def should_wrap(self): ''' True if this class is actually needed. If false, then the output stream will not be affected, nor will win32 calls be issued, so wrapping stdout is not actually required. This will generally be False on non-Windows platforms, unless optional functionality like autoreset has been requested using kwargs to init() ''' return self.convert or self.strip or self.autoreset def get_win32_calls(self): if self.convert and winterm: return { AnsiStyle.RESET_ALL: (winterm.reset_all, ), AnsiStyle.BRIGHT: (winterm.style, WinStyle.BRIGHT), AnsiStyle.DIM: (winterm.style, WinStyle.NORMAL), AnsiStyle.NORMAL: (winterm.style, WinStyle.NORMAL), AnsiFore.BLACK: (winterm.fore, WinColor.BLACK), AnsiFore.RED: (winterm.fore, WinColor.RED), AnsiFore.GREEN: (winterm.fore, WinColor.GREEN), AnsiFore.YELLOW: (winterm.fore, WinColor.YELLOW), AnsiFore.BLUE: (winterm.fore, WinColor.BLUE), AnsiFore.MAGENTA: (winterm.fore, WinColor.MAGENTA), AnsiFore.CYAN: (winterm.fore, WinColor.CYAN), AnsiFore.WHITE: (winterm.fore, WinColor.GREY), AnsiFore.RESET: (winterm.fore, ), AnsiFore.LIGHTBLACK_EX: (winterm.fore, WinColor.BLACK, True), AnsiFore.LIGHTRED_EX: (winterm.fore, WinColor.RED, True), AnsiFore.LIGHTGREEN_EX: (winterm.fore, WinColor.GREEN, True), AnsiFore.LIGHTYELLOW_EX: (winterm.fore, WinColor.YELLOW, True), AnsiFore.LIGHTBLUE_EX: (winterm.fore, WinColor.BLUE, True), AnsiFore.LIGHTMAGENTA_EX: (winterm.fore, WinColor.MAGENTA, True), AnsiFore.LIGHTCYAN_EX: (winterm.fore, WinColor.CYAN, True), AnsiFore.LIGHTWHITE_EX: (winterm.fore, WinColor.GREY, True), AnsiBack.BLACK: (winterm.back, WinColor.BLACK), AnsiBack.RED: (winterm.back, WinColor.RED), AnsiBack.GREEN: (winterm.back, WinColor.GREEN), AnsiBack.YELLOW: (winterm.back, WinColor.YELLOW), AnsiBack.BLUE: (winterm.back, WinColor.BLUE), AnsiBack.MAGENTA: (winterm.back, WinColor.MAGENTA), AnsiBack.CYAN: (winterm.back, WinColor.CYAN), AnsiBack.WHITE: (winterm.back, WinColor.GREY), AnsiBack.RESET: (winterm.back, ), AnsiBack.LIGHTBLACK_EX: (winterm.back, WinColor.BLACK, True), AnsiBack.LIGHTRED_EX: (winterm.back, WinColor.RED, True), AnsiBack.LIGHTGREEN_EX: (winterm.back, WinColor.GREEN, True), AnsiBack.LIGHTYELLOW_EX: (winterm.back, WinColor.YELLOW, True), AnsiBack.LIGHTBLUE_EX: (winterm.back, WinColor.BLUE, True), AnsiBack.LIGHTMAGENTA_EX: (winterm.back, WinColor.MAGENTA, True), AnsiBack.LIGHTCYAN_EX: (winterm.back, WinColor.CYAN, True), AnsiBack.LIGHTWHITE_EX: (winterm.back, WinColor.GREY, True), } return dict() def write(self, text): if self.strip or self.convert: self.write_and_convert(text) else: self.wrapped.write(text) self.wrapped.flush() if self.autoreset: self.reset_all() def reset_all(self): if self.convert: self.call_win32('m', (0,)) elif not self.strip and not is_stream_closed(self.wrapped): self.wrapped.write(Style.RESET_ALL) def write_and_convert(self, text): ''' Write the given text to our wrapped stream, stripping any ANSI sequences from the text, and optionally converting them into win32 calls. ''' cursor = 0 text = self.convert_osc(text) for match in self.ANSI_CSI_RE.finditer(text): start, end = match.span() self.write_plain_text(text, cursor, start) self.convert_ansi(*match.groups()) cursor = end self.write_plain_text(text, cursor, len(text)) def write_plain_text(self, text, start, end): if start < end: self.wrapped.write(text[start:end]) self.wrapped.flush() def convert_ansi(self, paramstring, command): if self.convert: params = self.extract_params(command, paramstring) self.call_win32(command, params) def extract_params(self, command, paramstring): if command in 'Hf': params = tuple(int(p) if len(p) != 0 else 1 for p in paramstring.split(';')) while len(params) < 2: # defaults: params = params + (1,) else: params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0) if len(params) == 0: # defaults: if command in 'JKm': params = (0,) elif command in 'ABCD': params = (1,) return params def call_win32(self, command, params): if command == 'm': for param in params: if param in self.win32_calls: func_args = self.win32_calls[param] func = func_args[0] args = func_args[1:] kwargs = dict(on_stderr=self.on_stderr) func(*args, **kwargs) elif command in 'J': winterm.erase_screen(params[0], on_stderr=self.on_stderr) elif command in 'K': winterm.erase_line(params[0], on_stderr=self.on_stderr) elif command in 'Hf': # cursor position - absolute winterm.set_cursor_position(params, on_stderr=self.on_stderr) elif command in 'ABCD': # cursor position - relative n = params[0] # A - up, B - down, C - forward, D - back x, y = {'A': (0, -n), 'B': (0, n), 'C': (n, 0), 'D': (-n, 0)}[command] winterm.cursor_adjust(x, y, on_stderr=self.on_stderr) def convert_osc(self, text): for match in self.ANSI_OSC_RE.finditer(text): start, end = match.span() text = text[:start] + text[end:] paramstring, command = match.groups() if command in '\x07': # \x07 = BEL params = paramstring.split(";") # 0 - change title and icon (we will only change title) # 1 - change icon (we don't support this) # 2 - change title if params[0] in '02': winterm.set_title(params[1]) return text
{ "pile_set_name": "Github" }
| a | b | out | | 0 | 0 | 0 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 |
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 org.apache.hadoop.yarn.security; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.authorize.AccessControlList; import org.apache.hadoop.util.ReflectionUtils; import org.apache.hadoop.yarn.conf.YarnConfiguration; import com.google.common.annotations.VisibleForTesting; import java.util.List; /** * An implementation of the interface will provide authorization related * information and enforce permission check. It is excepted that any of the * methods defined in this interface should be non-blocking call and should not * involve expensive computation as these method could be invoked in RPC. */ @Private @Unstable public abstract class YarnAuthorizationProvider { private static final Logger LOG = LoggerFactory.getLogger(YarnAuthorizationProvider.class); private static YarnAuthorizationProvider authorizer = null; public static YarnAuthorizationProvider getInstance(Configuration conf) { synchronized (YarnAuthorizationProvider.class) { if (authorizer == null) { Class<?> authorizerClass = conf.getClass(YarnConfiguration.YARN_AUTHORIZATION_PROVIDER, ConfiguredYarnAuthorizer.class); authorizer = (YarnAuthorizationProvider) ReflectionUtils.newInstance( authorizerClass, conf); authorizer.init(conf); LOG.info(authorizerClass.getName() + " is instantiated."); } } return authorizer; } /** * Destroy the {@link YarnAuthorizationProvider} instance. * This method is called only in Tests. */ @VisibleForTesting public static void destroy() { synchronized (YarnAuthorizationProvider.class) { if (authorizer != null) { LOG.debug("{} is destroyed.", authorizer.getClass().getName()); authorizer = null; } } } /** * Initialize the provider. Invoked on daemon startup. DefaultYarnAuthorizer is * initialized based on configurations. */ public abstract void init(Configuration conf); /** * Check if user has the permission to access the target object. * * @param accessRequest * the request object which contains all the access context info. * @return true if user can access the object, otherwise false. */ public abstract boolean checkPermission(AccessRequest accessRequest); /** * Set permissions for the target object. * * @param permissions * A list of permissions on the target object. * @param ugi User who sets the permissions. */ public abstract void setPermission(List<Permission> permissions, UserGroupInformation ugi); /** * Set a list of users/groups who have admin access * * @param acls users/groups who have admin access * @param ugi User who sets the admin acls. */ public abstract void setAdmins(AccessControlList acls, UserGroupInformation ugi); /** * Check if the user is an admin. * * @param ugi the user to be determined if it is an admin * @return true if the given user is an admin */ public abstract boolean isAdmin(UserGroupInformation ugi); }
{ "pile_set_name": "Github" }
references: - v.+ template: | # What's Changed $CHANGES
{ "pile_set_name": "Github" }
function varargout = override(varargin) % VL_OVERRIDE Override structure subset % CONFIG = VL_OVERRIDE(CONFIG, UPDATE) copies recursively the fileds % of the structure UPDATE to the corresponding fields of the % struture CONFIG. % % Usually CONFIG is interpreted as a list of paramters with their % default values and UPDATE as a list of new paramete values. % % VL_OVERRIDE(..., 'Warn') prints a warning message whenever: (i) % UPDATE has a field not found in CONFIG, or (ii) non-leaf values of % CONFIG are overwritten. % % VL_OVERRIDE(..., 'Skip') skips fields of UPDATE that are not found % in CONFIG instead of copying them. % % VL_OVERRIDE(..., 'CaseI') matches field names in a % case-insensitive manner. % % Remark:: % Fields are copied at the deepest possible level. For instance, % if CONFIG has fields A.B.C1=1 and A.B.C2=2, and if UPDATE is the % structure A.B.C1=3, then VL_OVERRIDE() returns a strucuture with % fields A.B.C1=3, A.B.C2=2. By contrast, if UPDATE is the % structure A.B=4, then the field A.B is copied, and VL_OVERRIDE() % returns the structure A.B=4 (specifying 'Warn' would warn about % the fact that the substructure B.C1, B.C2 is being deleted). % % Remark:: % Two fields are matched if they correspond exactly. Specifically, % two fileds A(IA).(FA) and B(IA).FB of two struct arrays A and B % match if, and only if, (i) A and B have the same dimensions, % (ii) IA == IB, and (iii) FA == FB. % % See also: VL_ARGPARSE(), VL_HELP(). [varargout{1:nargout}] = vl_override(varargin{:});
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#3F51B5</color> <color name="colorPrimaryDark">#303F9F</color> <color name="colorAccent">#FF4081</color> </resources>
{ "pile_set_name": "Github" }
{ "accountLinkingWhitelistedDomains": null, "asin": "B01MTNKVNX", "averageRating": 4, "canDisable": true, "capabilities": null, "category": null, "description": "It's about time! Here is a collection of fun facts that will leave you bewildered and amazed about time!", "enablement": null, "exampleInteractions": [ "Alexa, start my time facts.", "Alexa, ask my time facts for a fact." ], "firstReleaseDate": 1479364541.964, "homepageLinkText": null, "homepageLinkUrl": null, "id": "amzn1.ask.skill.daf55eba-6260-49c8-acbf-0a6d7ea865fc", "imageAltText": "My Time Facts icon", "imageUrl": "https://github.com/dale3h/alexa-skills-list/raw/master/skills/B01MTNKVNX/skill_icon", "inAppPurchasingSupported": false, "launchPhrase": "my time facts", "name": "My Time Facts", "numberOfReviews": 1, "pamsPartnerId": null, "permissions": null, "privacyPolicyUrl": null, "shortDescription": "My Time Facts", "skillTypes": null, "stage": "live", "termsOfUseUrl": null, "vendorId": "MYJTILYLXARLO", "vendorName": "JustinCadburyWong" }
{ "pile_set_name": "Github" }
// Copyright (c) 2004,2006-2009, 2017 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sylvain Pion <[email protected]> // Nico Kruithof <[email protected]> // Manuel Caroli <[email protected]> #ifndef CGAL_PERIODIC_3_DELAUNAY_TRIANGULATION_FILTERED_TRAITS_3_H #define CGAL_PERIODIC_3_DELAUNAY_TRIANGULATION_FILTERED_TRAITS_3_H #include <CGAL/license/Periodic_3_triangulation_3.h> #include <CGAL/internal/Periodic_3_triangulation_filtered_traits_3.h> #include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h> #include <CGAL/basic.h> #include <CGAL/config.h> #include <CGAL/internal/Has_boolean_tags.h> #include <CGAL/Interval_nt.h> #include <CGAL/Uncertain.h> #include <CGAL/Profile_counter.h> namespace CGAL { // The first template item is supposed to be a Filtered_kernel-like kernel. template <typename K_, typename Off_> class Periodic_3_Delaunay_triangulation_filtered_traits_base_3 : public Periodic_3_Delaunay_triangulation_traits_base_3<K_, Off_> { typedef Periodic_3_Delaunay_triangulation_traits_base_3<K_, Off_> Base; typedef K_ Kernel; // Exact traits is based on the exact kernel. typedef Periodic_3_Delaunay_triangulation_traits_3<typename Kernel::Exact_kernel, Off_> Exact_traits; // Filtering traits is based on the filtering kernel. typedef Periodic_3_Delaunay_triangulation_traits_3<typename Kernel::Approximate_kernel, Off_> Filtering_traits; private: typedef typename Kernel::C2E C2E; typedef typename Kernel::C2F C2F; typedef typename Kernel::Iso_cuboid_3 Iso_cuboid_3; public: virtual ~Periodic_3_Delaunay_triangulation_filtered_traits_base_3() { } Periodic_3_Delaunay_triangulation_filtered_traits_base_3(const Iso_cuboid_3& domain, const Kernel& k) : Base(domain, k), Delaunay_traits_e(C2E()(domain)), Delaunay_traits_f(C2F()(domain)) { // Problem 1: above is a default initialization of the kernel in the traits. // Hence, if the kernel has members and we use filtered traits, then // the members will be default constructed here... // Problem 2: we have built filtered traits in P3Tfiltered_traits_3 and now // we also need those two... } virtual void set_domain(const Iso_cuboid_3& domain) { this->_domain = domain; this->set_filtrating_traits(domain); set_filtrating_Delaunay_traits(domain); } void set_filtrating_Delaunay_traits(const Iso_cuboid_3& domain) { Delaunay_traits_e.set_domain(C2E()(domain)); Delaunay_traits_f.set_domain(C2F()(domain)); } public: typedef Filtered_predicate< typename Exact_traits::Side_of_oriented_sphere_3, typename Filtering_traits::Side_of_oriented_sphere_3, Offset_converter_3<C2E>, Offset_converter_3<C2F> > Side_of_oriented_sphere_3; typedef Filtered_predicate< typename Exact_traits::Compare_distance_3, typename Filtering_traits::Compare_distance_3, Offset_converter_3<C2E>, Offset_converter_3<C2F> > Compare_distance_3; typedef Filtered_predicate< typename Exact_traits::Coplanar_orientation_3, typename Filtering_traits::Coplanar_orientation_3, Offset_converter_3<C2E>, Offset_converter_3<C2F> > Coplanar_orientation_3; typedef Filtered_predicate< typename Exact_traits::Coplanar_side_of_bounded_circle_3, typename Filtering_traits::Coplanar_side_of_bounded_circle_3, Offset_converter_3<C2E>, Offset_converter_3<C2F> > Coplanar_side_of_bounded_circle_3; typedef Filtered_predicate< typename Exact_traits::Side_of_bounded_sphere_3, typename Filtering_traits::Side_of_bounded_sphere_3, Offset_converter_3<C2E>, Offset_converter_3<C2F> > Side_of_bounded_sphere_3; Side_of_oriented_sphere_3 side_of_oriented_sphere_3_object() const { typename Exact_traits::Side_of_oriented_sphere_3 pe = Delaunay_traits_e.side_of_oriented_sphere_3_object(); typename Filtering_traits::Side_of_oriented_sphere_3 pf = Delaunay_traits_f.side_of_oriented_sphere_3_object(); return Side_of_oriented_sphere_3(pe, pf); } Compare_distance_3 compare_distance_3_object() const { typename Exact_traits::Compare_distance_3 pe = Delaunay_traits_e.compare_distance_3_object(); typename Filtering_traits::Compare_distance_3 pf = Delaunay_traits_f.compare_distance_3_object(); return Compare_distance_3(pe, pf); } Coplanar_orientation_3 coplanar_orientation_3_object() const { typename Exact_traits::Coplanar_orientation_3 pe = Delaunay_traits_e.coplanar_orientation_3_object(); typename Filtering_traits::Coplanar_orientation_3 pf = Delaunay_traits_f.coplanar_orientation_3_object(); return Coplanar_orientation_3(pe, pf); } Coplanar_side_of_bounded_circle_3 coplanar_side_of_bounded_circle_3_object() const { typename Exact_traits::Coplanar_side_of_bounded_circle_3 pe = Delaunay_traits_e.coplanar_side_of_bounded_circle_3_object(); typename Filtering_traits::Coplanar_side_of_bounded_circle_3 pf = Delaunay_traits_f.coplanar_side_of_bounded_circle_3_object(); return Coplanar_side_of_bounded_circle_3(pe, pf); } Side_of_bounded_sphere_3 side_of_bounded_sphere_3_object() const { typename Exact_traits::Side_of_bounded_sphere_3 pe = Delaunay_traits_e.side_of_bounded_sphere_3_object(); typename Filtering_traits::Side_of_bounded_sphere_3 pf = Delaunay_traits_f.side_of_bounded_sphere_3_object(); return Side_of_bounded_sphere_3(pe, pf); } protected: Exact_traits Delaunay_traits_e; Filtering_traits Delaunay_traits_f; }; template <class K_, class Off_ = CGAL::Periodic_3_offset_3, bool Has_static_filters_ = internal::Has_static_filters<K_>::value > class Periodic_3_Delaunay_triangulation_filtered_traits_3; } //namespace CGAL #include <CGAL/internal/Periodic_3_Delaunay_triangulation_statically_filtered_traits_3.h> namespace CGAL { template<class K_, class Off_> class Periodic_3_Delaunay_triangulation_filtered_traits_3<K_, Off_, false> : public Periodic_3_Delaunay_triangulation_filtered_traits_base_3<K_, Off_> { typedef Periodic_3_Delaunay_triangulation_filtered_traits_base_3<K_, Off_> Base; public: typedef K_ Kernel; typedef typename Kernel::Iso_cuboid_3 Iso_cuboid_3; Periodic_3_Delaunay_triangulation_filtered_traits_3(const Iso_cuboid_3& domain, const Kernel& k) : Base(domain, k) { } }; template<class K_, class Off_> class Periodic_3_Delaunay_triangulation_filtered_traits_3<K_, Off_, true> : public Periodic_3_Delaunay_triangulation_statically_filtered_traits_3<K_, Off_> { typedef Periodic_3_Delaunay_triangulation_statically_filtered_traits_3<K_, Off_> Base; public: typedef K_ Kernel; typedef typename Kernel::Iso_cuboid_3 Iso_cuboid_3; Periodic_3_Delaunay_triangulation_filtered_traits_3(const Iso_cuboid_3& domain, const Kernel& k) : Base(domain, k) { } }; } //namespace CGAL #endif // CGAL_PERIODIC_3_DELAUNAY_TRIANGULATION_FILTERED_TRAITS_3_H
{ "pile_set_name": "Github" }
!------------------------------------------------------------------------! ! The Community Multiscale Air Quality (CMAQ) system software is in ! ! continuous development by various groups and is based on information ! ! from these groups: Federal Government employees, contractors working ! ! within a United States Government contract, and non-Federal sources ! ! including research institutions. These groups give the Government ! ! permission to use, prepare derivative works of, and distribute copies ! ! of their work in the CMAQ system to the public and to permit others ! ! to do so. The United States Environmental Protection Agency ! ! therefore grants similar permission to use the CMAQ system software, ! ! but users are requested to provide copies of derivative works or ! ! products designed to operate in the CMAQ system to the United States ! ! Government without restrictions as to use by others. Software ! ! that is used with the CMAQ system but distributed under the GNU ! ! General Public License or the GNU Lesser General Public License is ! ! subject to their copyright restrictions. ! !------------------------------------------------------------------------! SUBROUTINE HRG1( DTC ) C********************************************************************** C C FUNCTION: To solve for the concentration of NO2, NO, O3, and O3P C algebraically. C R1 PRECONDITIONS: For SAPRC99 family of mechanisms only C C KEY SUBROUTINES/FUNCTIONS CALLED: None C R2 REVISION HISTORY: Prototype created by Jerry Gipson, January, 2003 C C 18 Jul 14 B.Hutzell: revised to use real(8) variables C 01 Jun 18 B.Hutzell: replaced steady solution for O1D with backward Euler C approximation. To match conditions where the initial C concentration cannot be neglected. C********************************************************************** USE HRDATA IMPLICIT NONE C..INCLUDES: None C..ARGUMENTS: REAL( 8 ), INTENT( IN ) :: DTC ! Time step C..PARAMETERS: None C..EXTERNAL FUNCTIONS: NONE C..SAVED LOCAL VARIABLES: ! CHARACTER( 16 ), SAVE :: PNAME = 'HRG1' ! Prgram Name C..SCRATCH LOCAL VARIABLES: REAL( 8 ) :: O1D_S ! sum of O1D loss frequencies REAL( 8 ) :: O3P_S ! stoich coeff for O3P from O1D RE REAL( 8 ) :: EXN_S ! sum of NO2EX loss frequencies RE REAL( 8 ) :: NO2_S ! stoich coeff for NO2 from NO2EX REAL( 8 ) :: R1_2 ! production term for NO from NO2 REAL( 8 ) :: R2_1 ! production term for NO2 from NO REAL( 8 ) :: P1, P2, P3, P12 ! production terms for NO, NO2, O3, & O3P REAL( 8 ) :: L1, L2, L3, L12 ! loss terms for NO, NO2, O3, O3P REAL( 8 ) :: L1_INV, L2_INV, & L3_INV, L12_INV ! inverse of loss terms REAL( 8 ) :: T1, T2, T3, T4, T5 ! intermerdiate terms REAL( 8 ) :: F1, F2, F3 ! intermerdiate terms REAL( 8 ) :: A, B, C ! coefficients for quadratic equation REAL( 8 ) :: Q, XX, S1, S2 ! intermerdiate terms REAL( 8 ) :: RK1, RK2, RK3 ! rate constants REAL( 8 ) :: PO3 ! temp variable for O3 C********************************************************************** S1 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c O1D2 Section c 1) sum of the rate constants for all O1D loss reactions c 2) get fractional yield of O3P from O1D loss cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc O1D_DNM = RKI( 19 ) + RKI( 20 ) O3P_S = RKI( 20 ) / O1D_DNM cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c NO Section c R1_2 = production of NO from NO2 ( rates of form k[NO2][x] ) c except NO2+NO3=NO+NO2 (it is treated as if it were NO3=NO ) c P1 = remaining NO production terms c L1 = loss of NO (except rxns producing NO2 - they are in R2_1) cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc R1_2 = RKI( 1 ) ! NO2+hv=NO & + RKI( 5 ) * YC( O3P ) ! NO2+O3P=NO R1_2 = R1_2 * DTC P1 = RXRAT( 14 ) ! NO2+NO3=NO+NO2 & + RXRAT( 15 ) ! NO3+hv=NO & + RXRAT( 22 ) ! HONO+hv=NO P1 = YC0( NCELL, NO ) + P1 * DTC L1 = RKI( 21 ) * YC( HO ) ! NO+HO=HONO & + RKI( 23 ) * YC( RO2_N ) ! NO+RO2_N=RNO3 L1 = 1.0D0 + L1 * DTC cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c NO2 Section c R2_1 = production of NO2 from NO ( rates of form k[NO][x] ) c a) NO+O3=NO2 not included c b) NO+NO3=2NO2 ( 1/2 of rate included ) c c) NO3+NO2=NO+NO2 is not included for NO2 c P2 = remaining NO2 production terms c a) NO+O3=NO2 not included c b) NO+NO3=2NO2 (1/2 of rate included ) c L2 = loss of NO2 (except rxns producing NO2 - they are in R1_2) cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc R2_1 = RKI( 4 ) * YC( O3P ) ! NO+O3P=NO2 & + RKI( 9 ) * YC( NO3 ) ! NO+NO3=2*NO2 (1/2) & + 2.000D0 * RKI( 10 ) * YC( NO ) ! NO+NO=2*NO2 & + RKI( 31 ) * YC( HO2 ) ! NO+HO2=NO2 & + RKI( 46 ) * YC( C_O2 ) ! NO+C_O2=NO2 & + RKI( 51 ) * YC( RO2_R ) ! NO+RO2_R=NO2 & + RKI( 56 ) * YC( R2O2 ) ! NO+R2O2=NO2 & + RKI( 62 ) * YC( RO2_N ) ! NO+RO2_N=NO2 & + RKI( 71 ) * YC( CCO_O2 ) ! NO+CCO_O2=NO2 & + RKI( 81 ) * YC( RCO_O2 ) ! NO+RCO_O2=NO2 & + RKI( 92 ) * YC( BZCO_O2 ) ! NO+BZCO_O2=NO2 & + RKI( 104 ) * YC( MA_RCO3 ) ! NO+MA_RCO3=NO2 & + RKI( 128 ) * YC( HOCOO ) ! NO+HOCOO=NO2 R2_1 = R2_1 * DTC P2 = RXRAT( 10 ) ! NO+NO3=2*NO2 (1/2) & + RXRAT( 12 ) ! N2O5=NO2 & + RXRAT( 16 ) ! NO3+hv=NO2 & + RXRAT( 23 ) ! HONO+hv=NO2 & + RXRAT( 24 ) ! HONO+HO=NO2 & + RXRAT( 26 ) ! NO3+HO=NO2 & + RXRAT( 28 ) ! HNO3+hv=NO2 & + RXRAT( 33 ) ! HNO4=NO2 & + 0.610D0 * RXRAT( 34 ) ! HNO4+hv=0.610*NO2 & + RXRAT( 35 ) ! HNO4+HO=NO2 & + 0.800D0 * RXRAT( 39 ) ! NO3+HO2=0.800*NO2 & + 2.000D0 * RXRAT( 40 ) ! NO3+NO3=2*NO2 & + RXRAT( 48 ) ! NO3+C_O2=NO2 & + RXRAT( 58 ) ! NO3+RO2_R=NO2 & + RXRAT( 65 ) ! NO3+RO2_N=NO2 & + RXRAT( 70 ) ! PAN=NO2 & + RXRAT( 73 ) ! NO3+CCO_O2=NO2 & + RXRAT( 80 ) ! PAN2=NO2 & + RXRAT( 83 ) ! NO3+RCO_O2=NO2 & + RXRAT( 91 ) ! PBZN=NO2 & + RXRAT( 94 ) ! NO3+BZCO_O2=NO2 & + RXRAT( 103 ) ! MA_PAN=NO2 & + RXRAT( 106 ) ! NO3+MA_RCO3=NO2 & + 0.338 * RXRAT( 176 ) ! RNO3+HO=0.338*NO2 & + RXRAT( 177 ) ! RNO3+hv=NO2 & + 0.187 * RXRAT( 191 ) ! NO3+ISOPRENE=0.187*NO2 & + 0.474 * RXRAT( 195 ) ! NO3+TRP1=0.474*NO2 & + 0.391D0 * RXRAT( 210 ) ! NO3+OLE2=0.391*NO2 P2 = YC0( NCELL, NO2 ) + P2 * DTC L2 = RKI( 6 ) * YC( O3P ) ! NO2+O3P=NO3 & + RKI( 9 ) * YC( O3 ) ! NO2+O3=NO3 & + RKI( 12 ) * YC( NO3 ) ! NO2+NO3=N2O5 & + RKI( 25 ) * YC( NO ) ! NO2+OH=HNO3 & + RKI( 32 ) * YC( HO2 ) ! NO2+HO2=HNO4 & + RKI( 69 ) * YC( CCO_O2 ) ! NO2+CCO_O2=PAN & + RKI( 79 ) * YC( RCO_O2 ) ! NO2+RCO_O2=PAN2 & + RKI( 90 ) * YC( BZCO_O2 ) ! NO2+BZCO_O2=PBZN & + RKI( 102 ) * YC( MA_RCO3 ) ! NO2+MA_RCO3=MA_PAN & + 0.800D0 * RKI( 115 ) * YC( TBU_O ) ! NO2+TBU_O=RNO3 & + RKI( 117 ) * YC( BZ_O ) ! NO2+BZ_O=NPHE & + RKI( 120 ) * YC( BZNO2_O ) ! NO2+BZNO2_O= L2 = 1.0D0 + L2 * DTC cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c O3 Section c P3 = production of O3 except O+O2=O3 c except NO2+NO3=NO+NO2 (it is treated as if it were NO3=NO ) c L3 = loss terms for O3 except NO+O3=NO2 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc P3 = 0.250D0 * RXRAT( 72 ) ! CCO_O2+HO2=0.250*O3 & + 0.250D0 * RXRAT( 82 ) ! RCO_O2+HO2=0.250*O3 & + 0.250D0 * RXRAT( 93 ) ! BZCO_O2+HO2=0.250*O3 & + 0.250D0 * RXRAT( 105 ) ! MA_RCO3+HO2=0.250*O3 P3 = YC0( NCELL, O3 ) + P3 * DTC L3 = RKI( 3 ) * YC( O3P ) ! O3+O3P= & + RKI( 8 ) * YC( NO2 ) ! O3+NO2=NO3 & + RKI( 17 ) ! O3+hv=O3P & + RKI( 18 ) ! O3+hv=O1D2 & + RKI( 30 ) * YC( HO ) ! O3+OH=HO2 & + RKI( 36 ) * YC( HO2 ) ! O3+HO2=OH & + RKI( 162 ) * YC( METHACRO ) ! O3+METHACRO= & + RKI( 167 ) * YC( MVK ) ! O3+MVK= & + RKI( 171 ) * YC( ISOPROD ) ! O3+ISOPROD= & + RKI( 179 ) * YC( DCB1 ) ! O3+DCB1= & + RKI( 186 ) * YC( ETHENE ) ! O3+ETHENE= & + RKI( 190 ) * YC( ISOPRENE ) ! O3+ISOPRENE= & + RKI( 194 ) * YC( TRP1 ) ! O3+TRP1= & + RKI( 205 ) * YC( OLE1 ) ! O3+OLE1= & + RKI( 209 ) * YC( OLE2 ) ! O3+OLE2= L3 = 1.0D0 + L3 * DTC cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c O3P Section c P12 = production of O3P except NO2+hv=O3P (J1) c L12 = loss terms cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc P12 = RXRAT( 16 ) ! NO3+hv=O3P & + RXRAT( 17 ) ! O3+hv=O3P & + O3P_S * RXRAT( 18 ) ! O3+hv=O1D2=>O3P P12 = YC0( NCELL, O ) + P12 * DTC L12 = RKI( 2 ) ! O3P=O3 & + RKI( 4 ) * YC( NO ) ! O3P+NO=NO2 & + RKI( 5 ) * YC( NO2 ) ! O3P+NO2=NO & + RKI( 6 ) * YC( NO2 ) ! O3P+NO=NO3 & + RKI( 164 ) * YC( METHACRO ) ! O3P+METHACRO= & + RKI( 168 ) * YC( MVK ) ! O3P+MVK= & + RKI( 188 ) * YC( ETHENE ) ! O3P+ETHENE= & + RKI( 192 ) * YC( ISOPRENE ) ! O3P+ISOPRENE= & + RKI( 196 ) * YC( TRP1 ) ! O3P+TRP1= & + RKI( 207 ) * YC( OLE1 ) ! O3P+OLE1= & + RKI( 211 ) * YC( OLE2 ) ! O3P+OLE2= L12 = 1.0D0 + L12 * DTC S1 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Solution section ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c..compute reciprocal of loss terms L1_INV = 1.0D0 / L1 L2_INV = 1.0D0 / L2 L3_INV = 1.0D0 / L3 L12_INV = 1.0D0 / L12 c..compute specific k*delta t terms R3 RK1 = RKI( 1 ) * DTC ! J1 (NO2+hv=NO+O3P) R3 RK2 = RKI( 2 ) * DTC ! J2 (O3P+O2=O3) R3 RK3 = RKI( 3 ) * DTC ! k1_3 (NO+O3=NO2) c..compute terms that are used to calulate a,b & c T1 = RK1 * L2_INV ! J1 / ( 1.0 + Lno2 * dt ) T2 = R1_2 * L2_INV ! r1,2 / ( 1.0 + Lno2 * dt) T3 = R2_1 * L1_INV ! r2,1 / ( 1.0 + Lno * dt) T4 = RK2 * L12_INV ! J2 / ( 1.0 + Lo3p * dt ) T5 = T3 * P1 - T2 * P2 ! T3 * Pno - T2 * Pno2 F1 = 1.0D0 + T2 + T3 ! factor in calculating a & b F2 = T1 * T4 ! factor in calculating a & b F3 = L3 * L1 + RK3 * P1 ! (1 + Lo3 * dt) (1 + lno * dt ) ! + k1,3 * dt * Pno PO3 = P3 + P12 * T4 A = RK3 * ( F1 - F2 ) B = F1 * F3 + RK3 * ( F2 * ( P2 - P1 ) + PO3 + T5 ) C = RK3 * P1 * ( PO3 + P2 * F2 ) + F3 * T5 Q = -0.5D0 * ( B + SIGN( 1.0D0, B ) * SQRT( B * B - 4.0D0 * A * C ) ) XX = MAX( Q / A , C / Q ) ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Species solutions c [NO] = ( P1 + x ) / ( 1 + L1 ) c [NO2] = ( P2 - x ) / ( 1 + L2 ) c [O3 ] = ( P3 + Ko3p->O3 ) / (1 + K1,3 * [NO] + L3 ) c [O3P] = ( P12 + J1 * [NO2] ) / ( 1 + L12 ) c [O1D] = ( yc0(o1d) + Ko3->o1d * [O3] *dtc) / ( 1 + O1D_S*dtc ) ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc S2 YCP( NCELL, NO ) = MAX( 0.0D0, ( P1 + XX ) * L1_INV ) YCP( NCELL, NO2 ) = MAX( 0.0D0, ( P2 - XX ) * L2_INV ) S1 = P12 + RK1 * YCP( NCELL, NO2 ) S2 = T4 * S1 YCP( O3 ) = ( P3 + S2 ) / ( L3 + RK3 * YCP( NO ) ) YCP( O3P ) = S1 * L12_INV YCP( O1D2 ) = ( YC0( O1D2 ) + RKI( 18 ) * YCP( O3 ) * DTC ) & / ( 1.0D0 + O1D_DNM * DTC ) RETURN END
{ "pile_set_name": "Github" }
var $ = require("common:widget/ui/jquery/jquery.js"); var CON = conf.headerTest, isScrolled = false, fixedClass = "header-fixed" + (CON.ceilingMore === "1" ? " header-fixed-up" : " header-fixed-st"), $head = $("#top"), $win = $(window), $doc = $(document), $body = $(document.body), initHeight = $head.parent().outerHeight(), curHeight = 0; setTimeout(function() { //吸顶 if (CON.isCeiling === "1") { $win.on("scroll", function() { isScrolled = true; }); window.setTimeout(function() { if (isScrolled) { isScrolled = false; curHeight = initHeight; if ($doc.scrollTop() > curHeight) { if (!$body.hasClass(fixedClass)) { $head.css("position", "fixed"); $body.addClass(fixedClass); if (CON.ceilingMore === "1") { $win.trigger("headerFixed.transTo"); $win.trigger("headerFixed.changed"); } } } else { if ($body.hasClass(fixedClass)) { $head.css("position", "relative"); $body.removeClass(fixedClass); if (CON.ceilingMore === "1") { $win.trigger("headerFixed.restore"); $win.trigger("headerFixed.changed"); } } } } window.setTimeout(arguments.callee, 250); }, 250); } }, 1000);
{ "pile_set_name": "Github" }
# :copyright: (c) 2017 Alex Huszagh. # :license: FreeBSD, see LICENSE.txt for more details. # FindPackage # ----------- # # Macros and functions to help find packages. Do not invoke this module # directly, it merely provides library definitions to be invoked # by other find utilities. include(CheckCXXSourceCompiles) # Return if the package name has previously been found # # Args: # packageName Name of the package # # Example: # ReturnFound(Iconv) # macro(ReturnFound packageName) if(${packageName}_FOUND) return() endif() endmacro(ReturnFound) # Set the library extensions for a given package dependent on whether # to search for static or dynamic libraries. # # Args: # packageName Name of the package # # Example: # SetSuffixes(IConv) # macro(SetSuffixes packageName) if(${packageName}_USE_STATIC_LIBS) if(MSVC) set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib") else() set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") endif() else() if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll" ".lib" ".a") else() set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") endif() endif() endmacro(SetSuffixes) # Check if the package was found. # # Args: # packageName Name of the package # # Example: # CheckFound(IConv) # macro(CheckFound packageName) if(${packageName}_INCLUDE_DIRS AND ${packageName}_LIBRARIES) set(${packageName}_FOUND TRUE) endif() endmacro(CheckFound) # Replace a dynamic library with a `.dll.a` extension with the corresponding # library removing the `.dll`. # # Args: # libraryName Variable name for path to found library # # Example: # ReplaceDynamic(/mingw64/lib/libiconv.dll.a) # macro(ReplaceDynamic libraryName) if(${libraryName} MATCHES ".dll.a") string(REPLACE ".dll.a" ".a" static ${${libraryName}}) if(EXISTS ${static}) set(${libraryName} ${static}) endif() endif() endmacro(ReplaceDynamic) # Replace a dynamic libraries with the static variants, with integrity # checks for the package. # # Args: # packageName Name of the package # # Example: # FindStaticLibs(IConv) # macro(FindStaticLibs packageName) if(${packageName}_USE_STATIC_LIBS AND MSYS) # convert `.dll.a` to `.a` set(${packageName}_LIBRARY_SOURCE ${${packageName}_LIBRARIES}) set(${packageName}_LIBRARIES "") foreach(library ${${packageName}_LIBRARY_SOURCE}) # replace each dynamic library with a single one set(static_library ${library}) ReplaceDynamic(static_library) list(APPEND ${packageName}_LIBRARIES ${static_library}) endforeach(library) endif() endmacro(FindStaticLibs) # Checks if a suitable version for the found library was identified, # if provided. The library can either force exact or inexact matching. # # Args: # packageName Name of the package # # Example: # MatchVersion(ICU) # macro(MatchVersion packageName) if(${packageName}_FOUND AND ${packageName}_FIND_VERSION) # MATCH VERSION if(${packageName}_FIND_VERSION_EXACT) # EXACT VERSION if(${packageName}_FIND_VERSION VERSION_EQUAL ${packageName}_VERSION) else() set(${packageName}_FOUND FALSE) endif() else() # GREATER THAN VERSION if(${packageName}_VERSION VERSION_LESS ${packageName}_FIND_VERSION) set(${packageName}_FOUND FALSE) endif() endif() endif() endmacro(MatchVersion) # Check if a sample program compiles, if not, set the library to not found. # # Args: # packageName Name of the package # code String of simple program depending on the library # # Example: # set(IConv_CODE "int main(int argc, char **argv){ return 0; }") # CheckCompiles(IConv) # macro(CheckCompiles packageName) # FLAGS set(CMAKE_REQUIRED_INCLUDES ${${packageName}_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${${packageName}_LIBRARIES}) # COMPILATION check_cxx_source_compiles("${${packageName}_CODE}" ${packageName}_COMPILES) if(NOT ${${packageName}_COMPILES}) set(${packageName}_FOUND FALSE) message(SEND_ERROR "Cannot compile a simple ${packageName} program.") endif() endmacro(CheckCompiles) # Send an error if a required package was not found. Otherwise, if the # package is found, report to the user it was identified. # # Args: # packageName Name of the package # # Example: # RequiredPackageFound(ICU) # macro(RequiredPackageFound packageName) if(${packageName}_FOUND) message("Found ${packageName}.") else() if(${packageName}_FIND_REQUIRED) message(SEND_ERROR "Unable to find requested ${packageName} libraries.") endif() endif() endmacro(RequiredPackageFound)
{ "pile_set_name": "Github" }