diff --git "a/train/github-14-72286484.jsonl" "b/train/github-14-72286484.jsonl" new file mode 100644--- /dev/null +++ "b/train/github-14-72286484.jsonl" @@ -0,0 +1,313 @@ +{"text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Symfony\\Component\\HttpKernel\\Profiler;\n\n/**\n * ProfilerStorageInterface.\n *\n * This interface exists for historical reasons. The only supported\n * implementation is FileProfilerStorage.\n *\n * As the profiler must only be used on non-production servers, the file storage\n * is more than enough and no other implementations will ever be supported.\n *\n * @internal\n *\n * @author Fabien Potencier \n */\ninterface ProfilerStorageInterface\n{\n /**\n * Finds profiler tokens for the given criteria.\n *\n * @param int|null $limit The maximum number of tokens to return\n * @param int|null $start The start date to search from\n * @param int|null $end The end date to search to\n *\n * @return array An array of tokens\n */\n public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;\n\n /**\n * Reads data associated with the given token.\n *\n * The method returns false if the token does not exist in the storage.\n *\n * @return Profile|null The profile associated with token\n */\n public function read(string $token): ?Profile;\n\n /**\n * Saves a Profile.\n *\n * @return bool Write operation successful\n */\n public function write(Profile $profile): bool;\n\n /**\n * Purges all data from the database.\n */\n public function purge();\n}\n"} +{"text": "/****************************************************************************\n * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice (including the next\n * paragraph) shall be included in all copies or substantial portions of the\n * Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n *\n * @file rasterizer.h\n *\n * @brief Definitions for the rasterizer.\n *\n ******************************************************************************/\n#pragma once\n\n#include \"context.h\"\n#include \n#include \"conservativeRast.h\"\n#include \"multisample.h\"\n\nvoid RasterizeLine(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData);\nvoid RasterizeSimplePoint(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData);\nvoid RasterizeTriPoint(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData);\nvoid InitRasterizerFunctions();\n\nINLINE\n__m128i fpToFixedPoint(const __m128 vIn)\n{\n __m128 vFixed = _mm_mul_ps(vIn, _mm_set1_ps(FIXED_POINT_SCALE));\n return _mm_cvtps_epi32(vFixed);\n}\n\nenum TriEdgesStates\n{\n STATE_NO_VALID_EDGES = 0,\n STATE_E0_E1_VALID,\n STATE_E0_E2_VALID,\n STATE_E1_E2_VALID,\n STATE_ALL_EDGES_VALID,\n STATE_VALID_TRI_EDGE_COUNT,\n};\n\nenum TriEdgesValues\n{\n NO_VALID_EDGES = 0,\n E0_E1_VALID = 0x3,\n E0_E2_VALID = 0x5,\n E1_E2_VALID = 0x6,\n ALL_EDGES_VALID = 0x7,\n VALID_TRI_EDGE_COUNT,\n};\n\n// Selector for correct templated RasterizeTriangle function\nPFN_WORK_FUNC GetRasterizerFunc(SWR_MULTISAMPLE_COUNT numSamples,\n bool IsCenter,\n bool IsConservative,\n SWR_INPUT_COVERAGE InputCoverage,\n uint32_t EdgeEnable,\n bool RasterizeScissorEdges);\n\n//////////////////////////////////////////////////////////////////////////\n/// @brief ValidTriEdges convenience typedefs used for templated function\n/// specialization supported Fixed Point precisions\ntypedef std::integral_constant AllEdgesValidT;\ntypedef std::integral_constant E0E1ValidT;\ntypedef std::integral_constant E0E2ValidT;\ntypedef std::integral_constant E1E2ValidT;\ntypedef std::integral_constant NoEdgesValidT;\n\ntypedef std::integral_constant StateAllEdgesValidT;\ntypedef std::integral_constant StateE0E1ValidT;\ntypedef std::integral_constant StateE0E2ValidT;\ntypedef std::integral_constant StateE1E2ValidT;\ntypedef std::integral_constant StateNoEdgesValidT;\n\n// some specializations to convert from edge state to edge bitmask values\ntemplate \nstruct EdgeMaskVal\n{\n static_assert(EdgeMask::value > STATE_ALL_EDGES_VALID,\n \"Primary EdgeMaskVal shouldn't be instantiated\");\n};\n\ntemplate <>\nstruct EdgeMaskVal\n{\n typedef AllEdgesValidT T;\n};\n\ntemplate <>\nstruct EdgeMaskVal\n{\n typedef E0E1ValidT T;\n};\n\ntemplate <>\nstruct EdgeMaskVal\n{\n typedef E0E2ValidT T;\n};\n\ntemplate <>\nstruct EdgeMaskVal\n{\n typedef E1E2ValidT T;\n};\n\ntemplate <>\nstruct EdgeMaskVal\n{\n typedef NoEdgesValidT T;\n};\n\nINLINE uint32_t EdgeValToEdgeState(uint32_t val)\n{\n SWR_ASSERT(val < VALID_TRI_EDGE_COUNT, \"Unexpected tri edge mask\");\n static const uint32_t edgeValToEdgeState[VALID_TRI_EDGE_COUNT] = {0, 0, 0, 1, 0, 2, 3, 4};\n return edgeValToEdgeState[val];\n}\n\n//////////////////////////////////////////////////////////////////////////\n/// @struct RasterScissorEdgesT\n/// @brief Primary RasterScissorEdgesT templated struct that holds compile\n/// time information about the number of edges needed to be rasterized,\n/// If either the scissor rect or conservative rast is enabled,\n/// the scissor test is enabled and the rasterizer will test\n/// 3 triangle edges + 4 scissor edges for coverage.\n/// @tparam RasterScissorEdgesT: number of multisamples\n/// @tparam ConservativeT: is this a conservative rasterization\n/// @tparam EdgeMaskT: Which edges are valid(not degenerate)\ntemplate \nstruct RasterEdgeTraits\n{\n typedef std::true_type RasterizeScissorEdgesT;\n typedef std::integral_constant NumEdgesT;\n // typedef std::integral_constant ValidEdgeMaskT;\n typedef typename EdgeMaskVal::T ValidEdgeMaskT;\n};\n\n//////////////////////////////////////////////////////////////////////////\n/// @brief specialization of RasterEdgeTraits. If neither scissor rect\n/// nor conservative rast is enabled, only test 3 triangle edges\n/// for coverage\ntemplate \nstruct RasterEdgeTraits\n{\n typedef std::false_type RasterizeScissorEdgesT;\n typedef std::integral_constant NumEdgesT;\n // no need for degenerate edge masking in non-conservative case; rasterize all triangle edges\n typedef std::integral_constant ValidEdgeMaskT;\n};\n\n//////////////////////////////////////////////////////////////////////////\n/// @struct RasterizerTraits\n/// @brief templated struct that holds compile time information used\n/// during rasterization. Inherits EdgeTraits and ConservativeRastBETraits.\n/// @tparam NumSamplesT: number of multisamples\n/// @tparam ConservativeT: is this a conservative rasterization\n/// @tparam InputCoverageT: what type of input coverage is the PS expecting?\n/// (only used with conservative rasterization)\n/// @tparam RasterScissorEdgesT: do we need to rasterize with a scissor?\ntemplate \nstruct _RasterizerTraits : public ConservativeRastBETraits,\n public RasterEdgeTraits\n{\n typedef MultisampleTraits(NumSamplesT::value),\n CenterPatternT::value>\n MT;\n\n /// Fixed point precision the rasterizer is using\n typedef FixedPointTraits PrecisionT;\n /// Fixed point precision of the edge tests used during rasterization\n typedef FixedPointTraits EdgePrecisionT;\n\n // If conservative rast or MSAA center pattern is enabled, only need a single sample coverage\n // test, with the result copied to all samples\n typedef std::integral_constant\n NumCoverageSamplesT;\n\n static_assert(\n EdgePrecisionT::BitsT::value >=\n ConservativeRastBETraits::ConservativePrecisionT::BitsT::value,\n \"Rasterizer edge fixed point precision < required conservative rast precision\");\n\n /// constants used to offset between different types of raster tiles\n static const int colorRasterTileStep{\n (KNOB_TILE_X_DIM * KNOB_TILE_Y_DIM * (FormatTraits::bpp / 8)) *\n MT::numSamples};\n static const int depthRasterTileStep{\n (KNOB_TILE_X_DIM * KNOB_TILE_Y_DIM * (FormatTraits::bpp / 8)) *\n MT::numSamples};\n static const int stencilRasterTileStep{(KNOB_TILE_X_DIM * KNOB_TILE_Y_DIM *\n (FormatTraits::bpp / 8)) *\n MT::numSamples};\n static const int colorRasterTileRowStep{(KNOB_MACROTILE_X_DIM / KNOB_TILE_X_DIM) *\n colorRasterTileStep};\n static const int depthRasterTileRowStep{(KNOB_MACROTILE_X_DIM / KNOB_TILE_X_DIM) *\n depthRasterTileStep};\n static const int stencilRasterTileRowStep{(KNOB_MACROTILE_X_DIM / KNOB_TILE_X_DIM) *\n stencilRasterTileStep};\n};\n\ntemplate \nstruct RasterizerTraits final\n : public _RasterizerTraits,\n std::integral_constant,\n std::integral_constant,\n std::integral_constant,\n std::integral_constant,\n std::integral_constant>\n{\n};\n"} +{"text": "import {Wallet, BigNumber} from 'ethers';\nimport {Numberish} from '../types';\n\nexport async function toChangeBalances(\n transactionCallback: () => Promise,\n wallets: Wallet[],\n balanceChanges: Numberish[]\n) {\n if (typeof transactionCallback !== 'function') {\n /* eslint-disable max-len */\n throw new Error(\n 'Expect subject should be a callback returning the Promise' +\n 'e.g.: await expect(() => wallet.send({to: \\'0xb\\', value: 200})).to.changeBalances([\\'0xa\\', \\'0xb\\'], [-200, 200])'\n );\n /* eslint-enable max-len */\n }\n\n const balancesBefore = await Promise.all(\n wallets.map((wallet) => wallet.getBalance())\n );\n await transactionCallback();\n const balancesAfter = await Promise.all(\n wallets.map((wallet) => wallet.getBalance())\n );\n\n const actualChanges = balancesAfter.map((balance, ind) =>\n balance.sub(balancesBefore[ind])\n );\n const pass = actualChanges.every((change, ind) =>\n change.eq(BigNumber.from(balanceChanges[ind]))\n );\n\n const walletsAddresses = wallets.map((wallet) => wallet.address);\n if (pass) {\n return {\n pass: true,\n message: () =>\n `Expected ${walletsAddresses} to not change balance by ${balanceChanges} wei,`\n };\n } else {\n return {\n pass: false,\n message: () =>\n `Expected ${walletsAddresses} to change balance by ${balanceChanges} wei, ` +\n `but it has changed by ${actualChanges} wei`\n };\n }\n}\n"} +{"text": "\n */\n\nuse yii\\db\\Migration;\nuse app\\models\\Special;\nuse app\\models\\Subweapon;\nuse app\\models\\WeaponType;\nuse app\\models\\DeathReasonType;\n\nclass m160108_090118_weapon extends Migration\n{\n public function safeUp()\n {\n $this->insert('weapon', [\n 'type_id' => WeaponType::findOne(['key' => 'slosher'])->id,\n 'key' => 'screwslosher_neo',\n 'name' => 'Sloshing Machine Neo',\n 'subweapon_id' => Subweapon::findOne(['key' => 'pointsensor'])->id,\n 'special_id' => Special::findOne(['key' => 'supershot'])->id,\n ]);\n\n $this->insert('death_reason', [\n 'type_id' => DeathReasonType::findOne(['key' => 'main'])->id,\n 'key' => 'screwslosher_neo',\n 'name' => 'Sloshing Machine Neo',\n ]);\n }\n\n public function safeDown()\n {\n $keys = [\n 'screwslosher_neo',\n ];\n $this->delete('death_reason', ['key' => $keys]);\n $this->delete('weapon', ['key' => $keys]);\n }\n}\n"} +{"text": "class RenameSecureReviewHostToSecureHost < ActiveRecord::Migration\n def change\n execute \"\n INSERT INTO settings (name, value, created_at, updated_at) SELECT 'secure_host', value, now(), now() FROM settings WHERE name = 'secure_review_host';\n DELETE FROM settings WHERE name = 'secure_review_host';\n \"\n end\nend\n"} +{"text": "package com.skylaker.yunzhi.pojo.db;\n\nimport java.io.Serializable;\nimport java.util.List;\n\n/**\n * 问题回答集合封装POJO\n *\n * User: zhuyong\n * Date: 2018/5/31 10:30\n */\npublic class AnswersList implements Serializable {\n private static final long serialVersionUID = 1L;\n\n //问题所有回答集合(当前查询页)\n private List answersList;\n //回答总数量\n private Long sum;\n\n\n public AnswersList(List answersList, Long sum) {\n this.answersList = answersList;\n this.sum = sum;\n }\n\n public List getAnswersList() {\n return answersList;\n }\n\n public void setAnswersList(List answersList) {\n this.answersList = answersList;\n }\n\n public Long getSum() {\n return sum;\n }\n\n public void setSum(Long sum) {\n this.sum = sum;\n }\n}"} +{"text": "// Copyright 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, OpenBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"} +{"text": "using System;\nnamespace TailBlazer.Infrastucture\n{\n public interface ISelectedAware\n {\n bool IsSelected { get; set; }\n }\n}\n"} +{"text": "---\ntitle: OperatorIntrinsics.SignDynamic<'T> Function (F#)\ndescription: OperatorIntrinsics.SignDynamic<'T> Function (F#)\nkeywords: visual f#, f#, functional programming\nauthor: dend\nmanager: danielfe\nms.date: 05/16/2016\nms.topic: language-reference\nms.prod: visual-studio-dev14\nms.technology: devlang-fsharp\nms.assetid: 84890cb6-d2d5-4ad4-a1c2-a997ea892a35 \n---\n\n# OperatorIntrinsics.SignDynamic<'T> Function (F#)\n\nThis is a library intrinsic. Calls to this function may be generated by evaluating quotations.\n\n**Namespace/Module Path:** Microsoft.FSharp.Core.Operators.OperatorIntrinsics\n\n**Assembly:** FSharp.Core (in FSharp.Core.dll)\n\n\n## Syntax\n\n```fsharp\n// Signature:\nSignDynamic : 'T -> int\n\n// Usage:\nSignDynamic x\n```\n\n#### Parameters\n*x*\nType: **'T**\n\n\nThe argument of the operation.\n\n## Return Value\n\nA number representing the sign of x. 1 if x > 0, -1 if x < 0, 0 otherwise.\n\n## Remarks\nThis function is for use by compiled F# code and should not be used directly.\n\n## Platforms\nWindows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2\n\n\n## Version Information\n**F# Core Library Versions**\n\nSupported in: 2.0, 4.0, Portable, Portable\n\n## See Also\n[Operators.OperatorIntrinsics Module (F#)](Operators.OperatorIntrinsics-Module-%5BFSharp%5D.md)\n\n[Core.Operators Module (F#)](Core.Operators-Module-%5BFSharp%5D.md)"} +{"text": "#\n# (C) Copyright 2003-2008\n# Wolfgang Denk, DENX Software Engineering, wd@denx.de.\n#\n# (C) Copyright 2008\n# Stelian Pop \n# Lead Tech Design \n#\n# SPDX-License-Identifier:\tGPL-2.0+\n#\n\nobj-y += at91sam9m10g45ek.o\nobj-y += led.o\n"} +{"text": "package com.renyu.arrorprogressbar;\r\n\r\nimport android.support.v7.app.ActionBarActivity;\r\nimport android.os.Bundle;\r\nimport android.view.Menu;\r\nimport android.view.MenuItem;\r\nimport android.view.View;\r\nimport android.widget.TextView;\r\n\r\nimport com.renyu.arrorprogressbar.myview.MyLayoutProgress;\r\n\r\n\r\npublic class MyActivity extends ActionBarActivity {\r\n\r\n MyLayoutProgress progresslayout=null;\r\n TextView hello_world=null;\r\n\r\n @Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_my);\r\n\r\n hello_world=(TextView) findViewById(R.id.hello_world);\r\n hello_world.setOnClickListener(new TextView.OnClickListener() {\r\n @Override\r\n public void onClick(View view) {\r\n progresslayout.setProgress(50);\r\n }\r\n });\r\n progresslayout=(MyLayoutProgress) findViewById(R.id.progresslayout);\r\n\r\n }\r\n\r\n\r\n @Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n // Inflate the menu; this adds items to the action bar if it is present.\r\n getMenuInflater().inflate(R.menu.my, menu);\r\n return true;\r\n }\r\n\r\n @Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle action bar item clicks here. The action bar will\r\n // automatically handle clicks on the Home/Up button, so long\r\n // as you specify a parent activity in AndroidManifest.xml.\r\n int id = item.getItemId();\r\n if (id == R.id.action_settings) {\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }\r\n}\r\n"} +{"text": "package com.tencent.clean.data.model;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.List;\n\n/**\n * Created by hoollyzhang on 16/5/30.\n * Description :\n */\npublic class SampleResult {\n public boolean error;\n public @SerializedName(\"results\")\n List beauties;\n\n public boolean isError() {\n return error;\n }\n\n public void setError(boolean error) {\n this.error = error;\n }\n\n public List getBeauties() {\n return beauties;\n }\n\n public void setBeauties(List beauties) {\n this.beauties = beauties;\n }\n\n @Override\n public String toString() {\n return \"SampleResult{\" +\n \"error=\" + error +\n \", beauties=\" + beauties +\n '}';\n }\n}\n"} +{"text": "\n\n Bonjour\n\n"} +{"text": "// Copyright © 2018 Dmitry Sikorsky. All rights reserved.\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net.Http.Headers;\nusing System.Text;\nusing System.Threading.Tasks;\nusing ExtCore.Data.Abstractions;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Platformus.Barebone.Backend.Controllers\n{\n [Area(\"Backend\")]\n public class PhotoUploaderController : ControllerBase\n {\n private IWebHostEnvironment webHostEnvironment;\n\n public PhotoUploaderController(IStorage storage, IWebHostEnvironment webHostEnvironment)\n : base(storage)\n {\n this.webHostEnvironment = webHostEnvironment;\n }\n\n [HttpGet]\n public ActionResult Index()\n {\n return this.View();\n }\n\n [HttpPost]\n public async Task Index(IList files)\n {\n StringBuilder filenames = new StringBuilder();\n\n foreach (IFormFile source in files)\n {\n string filename = ContentDispositionHeaderValue.Parse(source.ContentDisposition).FileName.ToString().Trim('\"');\n\n filename = this.EnsureCorrectFilename(filename);\n\n using (FileStream output = System.IO.File.Create(this.GetTempFilepath(filename)))\n await source.CopyToAsync(output);\n\n if (filenames.Length != 0)\n filenames.Append(',');\n\n filenames.Append(filename);\n }\n\n return this.Content(\"filenames=\" + filenames.ToString());\n }\n\n private string EnsureCorrectFilename(string filename)\n {\n if (filename.Contains(Path.DirectorySeparatorChar.ToString()))\n filename = filename.Substring(filename.LastIndexOf(Path.DirectorySeparatorChar) + 1);\n\n return filename;\n }\n\n private string GetTempFilepath(string filename)\n {\n return this.GetFilepath(this.GetTempBasePath(), filename);\n }\n\n private string GetFilepath(string basePath, string filename)\n {\n basePath = basePath.Replace('/', '\\\\');\n\n return this.webHostEnvironment.WebRootPath + basePath.Replace('\\\\', Path.DirectorySeparatorChar) + filename;\n }\n\n private string GetTempBasePath()\n {\n char directorySeparatorChar = Path.DirectorySeparatorChar;\n\n return $\"{directorySeparatorChar}images{directorySeparatorChar}temp{directorySeparatorChar}\";\n }\n }\n}"} +{"text": "\n\n\n\n\tBuildSystemType\n\tLatest\n\tIDEWorkspaceSharedSettings_AutocreateContextsIfNeeded\n\t\n\n\n"} +{"text": "//\n// SKBounceAnimation.h\n// SKBounceAnimation\n//\n// Created by Soroush Khanlou on 6/15/12.\n// Copyright (c) 2012 __MyCompanyName__. All rights reserved.\n//\n\n#import \n#import \n\n\n@interface SKBounceAnimation : CAKeyframeAnimation\n\n@property (nonatomic, retain) id fromValue;\n@property (nonatomic, retain) id byValue;\n@property (nonatomic, retain) id toValue;\n@property (nonatomic, assign) NSUInteger numberOfBounces;\n@property (nonatomic, assign) BOOL shouldOvershoot; //default YES\n@property (nonatomic, assign) BOOL shake; //if shaking, set fromValue to the furthest value, and toValue to the current value\n\n\n+ (SKBounceAnimation*) animationWithKeyPath:(NSString*)keyPath;\n\n\n@end\n"} +{"text": "/*=============================================================================\r\n Copyright (c) 2001-2011 Joel de Guzman\r\n\r\n Distributed under the Boost Software License, Version 1.0. (See accompanying\r\n file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r\n==============================================================================*/\r\n#if !defined(BOOST_SPIRIT_DEBUG_HANDLER_DECEMBER_05_2008_0734PM)\r\n#define BOOST_SPIRIT_DEBUG_HANDLER_DECEMBER_05_2008_0734PM\r\n\r\n#if defined(_MSC_VER)\r\n#pragma once\r\n#endif\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\nnamespace boost { namespace spirit { namespace qi\r\n{\r\n template <\r\n typename Iterator, typename Context\r\n , typename Skipper, typename F>\r\n struct debug_handler\r\n {\r\n typedef function<\r\n bool(Iterator& first, Iterator const& last\r\n , Context& context\r\n , Skipper const& skipper\r\n )>\r\n function_type;\r\n\r\n debug_handler(\r\n function_type subject_\r\n , F f_\r\n , std::string const& rule_name_)\r\n : subject(subject_)\r\n , f(f_)\r\n , rule_name(rule_name_)\r\n {\r\n }\r\n\r\n bool operator()(\r\n Iterator& first, Iterator const& last\r\n , Context& context, Skipper const& skipper) const\r\n {\r\n f(first, last, context, pre_parse, rule_name);\r\n try // subject might throw an exception\r\n {\r\n if (subject(first, last, context, skipper))\r\n {\r\n f(first, last, context, successful_parse, rule_name);\r\n return true;\r\n }\r\n f(first, last, context, failed_parse, rule_name);\r\n }\r\n catch (expectation_failure const& e)\r\n {\r\n f(first, last, context, failed_parse, rule_name);\r\n boost::throw_exception(e);\r\n }\r\n return false;\r\n }\r\n\r\n function_type subject;\r\n F f;\r\n std::string rule_name;\r\n };\r\n\r\n template \r\n void debug(rule& r, F f)\r\n {\r\n typedef rule rule_type;\r\n\r\n typedef\r\n debug_handler<\r\n Iterator\r\n , typename rule_type::context_type\r\n , typename rule_type::skipper_type\r\n , F>\r\n debug_handler;\r\n r.f = debug_handler(r.f, f, r.name());\r\n }\r\n\r\n struct simple_trace;\r\n\r\n namespace detail\r\n {\r\n // This class provides an extra level of indirection through a\r\n // template to produce the simple_trace type. This way, the use\r\n // of simple_trace below is hidden behind a dependent type, so\r\n // that compilers eagerly type-checking template definitions\r\n // won't complain that simple_trace is incomplete.\r\n template\r\n struct get_simple_trace\r\n {\r\n typedef simple_trace type;\r\n };\r\n }\r\n\r\n template \r\n void debug(rule& r)\r\n {\r\n typedef rule rule_type;\r\n\r\n typedef\r\n debug_handler<\r\n Iterator\r\n , typename rule_type::context_type\r\n , typename rule_type::skipper_type\r\n , simple_trace>\r\n debug_handler;\r\n\r\n typedef typename qi::detail::get_simple_trace::type trace;\r\n r.f = debug_handler(r.f, trace(), r.name());\r\n }\r\n\r\n}}}\r\n\r\n///////////////////////////////////////////////////////////////////////////////\r\n// Utility macro for easy enabling of rule and grammar debugging\r\n#if !defined(BOOST_SPIRIT_DEBUG_NODE)\r\n #if defined(BOOST_SPIRIT_DEBUG) || defined(BOOST_SPIRIT_QI_DEBUG)\r\n #define BOOST_SPIRIT_DEBUG_NODE(r) r.name(#r); debug(r)\r\n #else\r\n #define BOOST_SPIRIT_DEBUG_NODE(r) r.name(#r)\r\n #endif\r\n#endif\r\n\r\n#define BOOST_SPIRIT_DEBUG_NODE_A(r, _, name) \\\r\n BOOST_SPIRIT_DEBUG_NODE(name); \\\r\n /***/\r\n\r\n#define BOOST_SPIRIT_DEBUG_NODES(seq) \\\r\n BOOST_PP_SEQ_FOR_EACH(BOOST_SPIRIT_DEBUG_NODE_A, _, seq) \\\r\n /***/\r\n\r\n#endif\r\n"} +{"text": "/*\n * Copyright 2018 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.springframework.batch.item.json.builder;\n\nimport org.springframework.batch.item.file.FlatFileFooterCallback;\nimport org.springframework.batch.item.file.FlatFileHeaderCallback;\nimport org.springframework.batch.item.json.JsonFileItemWriter;\nimport org.springframework.batch.item.json.JsonObjectMarshaller;\nimport org.springframework.core.io.Resource;\nimport org.springframework.util.Assert;\n\n/**\n * Builder for {@link JsonFileItemWriter}.\n *\n * @param type of objects to write as Json output.\n * @author Mahmoud Ben Hassine\n * @since 4.1\n */\npublic class JsonFileItemWriterBuilder {\n\n\tprivate Resource resource;\n\tprivate JsonObjectMarshaller jsonObjectMarshaller;\n\tprivate FlatFileHeaderCallback headerCallback;\n\tprivate FlatFileFooterCallback footerCallback;\n\n\tprivate String name;\n\tprivate String encoding = JsonFileItemWriter.DEFAULT_CHARSET;\n\tprivate String lineSeparator = JsonFileItemWriter.DEFAULT_LINE_SEPARATOR;\n\n\tprivate boolean append = false;\n\tprivate boolean forceSync = false;\n\tprivate boolean saveState = true;\n\tprivate boolean shouldDeleteIfExists = true;\n\tprivate boolean shouldDeleteIfEmpty = false;\n\tprivate boolean transactional = JsonFileItemWriter.DEFAULT_TRANSACTIONAL;\n\n\t/**\n\t * Configure if the state of the {@link org.springframework.batch.item.ItemStreamSupport}\n\t * should be persisted within the {@link org.springframework.batch.item.ExecutionContext}\n\t * for restart purposes.\n\t *\n\t * @param saveState defaults to true\n\t * @return The current instance of the builder.\n\t */\n\tpublic JsonFileItemWriterBuilder saveState(boolean saveState) {\n\t\tthis.saveState = saveState;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * The name used to calculate the key within the\n\t * {@link org.springframework.batch.item.ExecutionContext}. Required if\n\t * {@link #saveState(boolean)} is set to true.\n\t *\n\t * @param name name of the reader instance\n\t * @return The current instance of the builder.\n\t * @see org.springframework.batch.item.ItemStreamSupport#setName(String)\n\t */\n\tpublic JsonFileItemWriterBuilder name(String name) {\n\t\tthis.name = name;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * A flag indicating that changes should be force-synced to disk on flush. Defaults\n\t * to false.\n\t *\n\t * @param forceSync value to set the flag to\n\t * @return The current instance of the builder.\n\t * @see JsonFileItemWriter#setForceSync(boolean)\n\t */\n\tpublic JsonFileItemWriterBuilder forceSync(boolean forceSync) {\n\t\tthis.forceSync = forceSync;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * String used to separate lines in output. Defaults to the System property\n\t * line.separator.\n\t *\n\t * @param lineSeparator value to use for a line separator\n\t * @return The current instance of the builder.\n\t * @see JsonFileItemWriter#setLineSeparator(String)\n\t */\n\tpublic JsonFileItemWriterBuilder lineSeparator(String lineSeparator) {\n\t\tthis.lineSeparator = lineSeparator;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the {@link JsonObjectMarshaller} to use to marshal objects to json.\n\t *\n\t * @param jsonObjectMarshaller to use\n\t * @return The current instance of the builder.\n\t * @see JsonFileItemWriter#setJsonObjectMarshaller(JsonObjectMarshaller)\n\t */\n\tpublic JsonFileItemWriterBuilder jsonObjectMarshaller(JsonObjectMarshaller jsonObjectMarshaller) {\n\t\tthis.jsonObjectMarshaller = jsonObjectMarshaller;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * The {@link Resource} to be used as output.\n\t *\n\t * @param resource the output of the writer.\n\t * @return The current instance of the builder.\n\t * @see JsonFileItemWriter#setResource(Resource)\n\t */\n\tpublic JsonFileItemWriterBuilder resource(Resource resource) {\n\t\tthis.resource = resource;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Encoding used for output.\n\t *\n\t * @param encoding encoding type.\n\t * @return The current instance of the builder.\n\t * @see JsonFileItemWriter#setEncoding(String)\n\t */\n\tpublic JsonFileItemWriterBuilder encoding(String encoding) {\n\t\tthis.encoding = encoding;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * If set to true, once the step is complete, if the resource previously provided is\n\t * empty, it will be deleted.\n\t *\n\t * @param shouldDelete defaults to false\n\t * @return The current instance of the builder\n\t * @see JsonFileItemWriter#setShouldDeleteIfEmpty(boolean)\n\t */\n\tpublic JsonFileItemWriterBuilder shouldDeleteIfEmpty(boolean shouldDelete) {\n\t\tthis.shouldDeleteIfEmpty = shouldDelete;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * If set to true, upon the start of the step, if the resource already exists, it will\n\t * be deleted and recreated.\n\t *\n\t * @param shouldDelete defaults to true\n\t * @return The current instance of the builder\n\t * @see JsonFileItemWriter#setShouldDeleteIfExists(boolean)\n\t */\n\tpublic JsonFileItemWriterBuilder shouldDeleteIfExists(boolean shouldDelete) {\n\t\tthis.shouldDeleteIfExists = shouldDelete;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * If set to true and the file exists, the output will be appended to the existing\n\t * file.\n\t *\n\t * @param append defaults to false\n\t * @return The current instance of the builder\n\t * @see JsonFileItemWriter#setAppendAllowed(boolean)\n\t */\n\tpublic JsonFileItemWriterBuilder append(boolean append) {\n\t\tthis.append = append;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * A callback for header processing.\n\t *\n\t * @param callback {@link FlatFileHeaderCallback} implementation\n\t * @return The current instance of the builder\n\t * @see JsonFileItemWriter#setHeaderCallback(FlatFileHeaderCallback)\n\t */\n\tpublic JsonFileItemWriterBuilder headerCallback(FlatFileHeaderCallback callback) {\n\t\tthis.headerCallback = callback;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * A callback for footer processing.\n\t *\n\t * @param callback {@link FlatFileFooterCallback} implementation\n\t * @return The current instance of the builder\n\t * @see JsonFileItemWriter#setFooterCallback(FlatFileFooterCallback)\n\t */\n\tpublic JsonFileItemWriterBuilder footerCallback(FlatFileFooterCallback callback) {\n\t\tthis.footerCallback = callback;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * If set to true, the flushing of the buffer is delayed while a transaction is active.\n\t *\n\t * @param transactional defaults to true\n\t * @return The current instance of the builder\n\t * @see JsonFileItemWriter#setTransactional(boolean)\n\t */\n\tpublic JsonFileItemWriterBuilder transactional(boolean transactional) {\n\t\tthis.transactional = transactional;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Validate the configuration and build a new {@link JsonFileItemWriter}.\n\t *\n\t * @return a new instance of the {@link JsonFileItemWriter}\n\t */\n\tpublic JsonFileItemWriter build() {\n\t\tAssert.notNull(this.resource, \"A resource is required.\");\n\t\tAssert.notNull(this.jsonObjectMarshaller, \"A json object marshaller is required.\");\n\n\t\tif (this.saveState) {\n\t\t\tAssert.hasText(this.name, \"A name is required when saveState is true\");\n\t\t}\n\n\t\tJsonFileItemWriter jsonFileItemWriter = new JsonFileItemWriter<>(this.resource, this.jsonObjectMarshaller);\n\n\t\tjsonFileItemWriter.setName(this.name);\n\t\tjsonFileItemWriter.setAppendAllowed(this.append);\n\t\tjsonFileItemWriter.setEncoding(this.encoding);\n\t\tif (this.headerCallback != null) {\n\t\t\tjsonFileItemWriter.setHeaderCallback(this.headerCallback);\n\t\t}\n\t\tif (this.footerCallback != null) {\n\t\t\tjsonFileItemWriter.setFooterCallback(this.footerCallback);\n\t\t}\n\t\tjsonFileItemWriter.setForceSync(this.forceSync);\n\t\tjsonFileItemWriter.setLineSeparator(this.lineSeparator);\n\t\tjsonFileItemWriter.setSaveState(this.saveState);\n\t\tjsonFileItemWriter.setShouldDeleteIfEmpty(this.shouldDeleteIfEmpty);\n\t\tjsonFileItemWriter.setShouldDeleteIfExists(this.shouldDeleteIfExists);\n\t\tjsonFileItemWriter.setTransactional(this.transactional);\n\n\t\treturn jsonFileItemWriter;\n\t}\n}\n"} +{"text": "#include \"obj_thread.h\"\n#include \"vm.h\"\n\n//为运行函数准备桢栈\nvoid prepareFrame(ObjThread* objThread, ObjClosure* objClosure, Value* stackStart) {\n ASSERT(objThread->frameCapacity > objThread->usedFrameNum, \"frame not enough!!\"); \n //objThread->usedFrameNum是最新可用的frame\n Frame* frame = &(objThread->frames[objThread->usedFrameNum++]);\n\n //thread中的各个frame是共享thread的stack \n //frame用frame->stackStart指向各自frame在thread->stack中的起始地址\n frame->stackStart = stackStart;\n frame->closure = objClosure;\n frame->ip = objClosure->fn->instrStream.datas;\n}\n\n//重置thread\nvoid resetThread(ObjThread* objThread, ObjClosure* objClosure) {\n objThread->esp = objThread->stack; \n objThread->openUpvalues = NULL;\n objThread->caller = NULL;\n objThread->errorObj = VT_TO_VALUE(VT_NULL);\n objThread->usedFrameNum = 0;\n\n ASSERT(objClosure != NULL, \"objClosure is NULL in function resetThread\");\n prepareFrame(objThread, objClosure, objThread->stack);\n}\n\n//新建线程\nObjThread* newObjThread(VM* vm, ObjClosure* objClosure) {\n ASSERT(objClosure != NULL, \"objClosure is NULL!\");\n\n Frame* frames = ALLOCATE_ARRAY(vm, Frame, INITIAL_FRAME_NUM);\n\n //加1是为接收者的slot\n uint32_t stackCapacity = ceilToPowerOf2(objClosure->fn->maxStackSlotUsedNum + 1); \n Value* newStack = ALLOCATE_ARRAY(vm, Value, stackCapacity); \n\n ObjThread* objThread = ALLOCATE(vm, ObjThread);\n initObjHeader(vm, &objThread->objHeader, OT_THREAD, vm->threadClass);\n\n objThread->frames = frames;\n objThread->frameCapacity = INITIAL_FRAME_NUM;\n objThread->stack = newStack;\n objThread->stackCapacity = stackCapacity;\n\n resetThread(objThread, objClosure);\n return objThread;\n}\n"} +{"text": "{\n \"action\": {\n \"error\": {\n \"variety\": [\n \"Misdelivery\"\n ],\n \"vector\": [\n \"Unknown\"\n ]\n }\n },\n \"actor\": {\n \"internal\": {\n \"motive\": [\n \"NA\"\n ],\n \"variety\": [\n \"Unknown\"\n ]\n }\n },\n \"asset\": {\n \"assets\": [\n {\n \"variety\": \"U - Desktop\"\n },\n {\n \"variety\": \"U - Desktop or laptop\"\n }\n ],\n \"cloud\": [\n \"Unknown\"\n ]\n },\n \"attribute\": {\n \"confidentiality\": {\n \"data\": [\n {\n \"amount\": 407,\n \"variety\": \"Personal\"\n }\n ],\n \"data_disclosure\": \"Yes\",\n \"data_total\": 407,\n \"data_victim\": [\n \"Student\"\n ],\n \"notes\": \"SSNs were contained in a hidden column in the xls.\",\n \"state\": [\n \"Stored unencrypted\"\n ]\n }\n },\n \"discovery_method\": {\n \"internal\": {\n \"variety\": [\n \"Nids\"\n ]\n }\n },\n \"impact\": {\n \"overall_rating\": \"Unknown\"\n },\n \"incident_id\": \"5BB117D1-E49C-4190-8346-9CBF00F1450E\",\n \"plus\": {\n \"analysis_status\": \"First pass\",\n \"analyst\": \"whbaker\",\n \"attribute\": {\n \"confidentiality\": {\n \"credit_monitoring\": \"Yes\",\n \"credit_monitoring_years\": 1\n }\n },\n \"created\": \"2013-09-25T15:49:00Z\",\n \"github\": \"341\",\n \"master_id\": \"5BB117D1-E49C-4190-8346-9CBF00F1450E\",\n \"modified\": \"2014-05-10T00:58:19Z\",\n \"timeline\": {\n \"notification\": {\n \"day\": 19,\n \"month\": 4,\n \"year\": 2013\n }\n }\n },\n \"reference\": \" http://www.oag.state.md.us/idtheft/Breach%20Notices/itu-230863.pdf ; http://www.databreaches.net/oh-those-hidden-fields-in-excel-spreadsheets-columbia-university-medical-center-notifies-students-of-breach/ ; http://www.esecurityplanet.com/network-security/columbia-university-medical-center-admits-data-breach.html \",\n \"schema_version\": \"1.3.4\",\n \"security_incident\": \"Confirmed\",\n \"source_id\": \"vcdb\",\n \"summary\": \"Columbia University Medical Center inadvertently exposed the Social Security numbers of 407 medical students in an Excel spreadsheet emailed to faculty, students, and staff.\",\n \"timeline\": {\n \"compromise\": {\n \"unit\": \"NA\"\n },\n \"containment\": {\n \"unit\": \"NA\"\n },\n \"discovery\": {\n \"unit\": \"Minutes\"\n },\n \"exfiltration\": {\n \"unit\": \"NA\"\n },\n \"incident\": {\n \"day\": 15,\n \"month\": 3,\n \"year\": 2013\n }\n },\n \"victim\": {\n \"country\": [\n \"US\"\n ],\n \"employee_count\": \"1001 to 10000\",\n \"industry\": \"621112\",\n \"locations_affected\": 1,\n \"region\": [\n \"019021\"\n ],\n \"state\": \"NY\",\n \"victim_id\": \"Columbia University Medical Center\"\n }\n}"} +{"text": "using FirClient.Data;\nusing System;\nusing UnityEngine;\n\nnamespace FirClient.Logic.Event\n{\n /// \n /// 出生英雄NPC\n /// \n public class EvSpawnHero : BaseSceneEvent\n {\n public override void OnExecute(string param, Action moveNext)\n {\n Debug.Log(\"EvSpawnHero...\" + param);\n battleHandlerMgr.SpawnHeros(moveNext);\n }\n }\n}\n\n"} +{"text": "2 2 1\n7 7 1\n9 9 1\n10 10 1\n13 13 1\n15 15 1\n21 1 2\n22 2 2\n27 7 2\n30 10 2\n31 11 2\n33 13 2\n34 14 2\n"} +{"text": "//jDownloader - Downloadmanager\r\n//Copyright (C) 2017 JD-Team support@jdownloader.org\r\n//\r\n//This program is free software: you can redistribute it and/or modify\r\n//it under the terms of the GNU General Public License as published by\r\n//the Free Software Foundation, either version 3 of the License, or\r\n//(at your option) any later version.\r\n//\r\n//This program is distributed in the hope that it will be useful,\r\n//but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n//GNU General Public License for more details.\r\n//\r\n//You should have received a copy of the GNU General Public License\r\n//along with this program. If not, see .\r\npackage jd.plugins.hoster;\r\n\r\nimport org.appwork.utils.StringUtils;\r\nimport org.jdownloader.controlling.filter.CompiledFiletypeFilter;\r\nimport org.jdownloader.plugins.components.antiDDoSForHost;\r\n\r\nimport jd.PluginWrapper;\r\nimport jd.http.Browser;\r\nimport jd.http.URLConnectionAdapter;\r\nimport jd.nutils.encoding.Encoding;\r\nimport jd.parser.Regex;\r\nimport jd.plugins.DownloadLink;\r\nimport jd.plugins.DownloadLink.AvailableStatus;\r\nimport jd.plugins.HostPlugin;\r\nimport jd.plugins.LinkStatus;\r\nimport jd.plugins.PluginException;\r\n\r\n@HostPlugin(revision = \"$Revision$\", interfaceVersion = 3, names = { \"flowyourvideo.com\" }, urls = { \"https?://(?:stream|jwplayer)\\\\.flowyourvideo\\\\.com/embed/([a-z0-9]+)\" })\r\npublic class FlowyourvideoCom extends antiDDoSForHost {\r\n public FlowyourvideoCom(PluginWrapper wrapper) {\r\n super(wrapper);\r\n }\r\n /* DEV NOTES */\r\n // Tags: Porn plugin\r\n // other:\r\n\r\n /* Extension which will be used if no correct extension is found */\r\n private static final String default_extension = \".mp4\";\r\n /* Connection stuff */\r\n private static final boolean free_resume = true;\r\n private static final int free_maxchunks = 0;\r\n private static final int free_maxdownloads = -1;\r\n private String dllink = null;\r\n private boolean server_issues = false;\r\n\r\n @Override\r\n public String getAGBLink() {\r\n return \"http://www.flowyourvideo.com/tos\";\r\n }\r\n\r\n @Override\r\n public String getLinkID(final DownloadLink link) {\r\n final String linkid = getFID(link);\r\n if (linkid != null) {\r\n return this.getHost() + \"://\" + linkid;\r\n } else {\r\n return super.getLinkID(link);\r\n }\r\n }\r\n\r\n private String getFID(final DownloadLink link) {\r\n return new Regex(link.getPluginPatternMatcher(), this.getSupportedLinks()).getMatch(0);\r\n }\r\n\r\n public static boolean isOffline(final Browser br) {\r\n return br.getHttpConnection().getResponseCode() == 404;\r\n }\r\n\r\n @Override\r\n public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {\r\n return requestFileInformation(link, false);\r\n }\r\n\r\n private AvailableStatus requestFileInformation(final DownloadLink link, final boolean isDownload) throws Exception {\r\n link.setMimeHint(CompiledFiletypeFilter.VideoExtensions.MP4);\r\n dllink = null;\r\n server_issues = false;\r\n this.setBrowserExclusive();\r\n br.setFollowRedirects(true);\r\n getPage(link.getPluginPatternMatcher());\r\n if (isOffline(br)) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n String filename = this.getFID(link);\r\n dllink = br.getRegex(\"file\\\\s*:\\\\s*\\\\'(//[^<>\\\"\\\\']+)'\").getMatch(0);\r\n filename = Encoding.htmlDecode(filename);\r\n filename = filename.trim();\r\n filename = encodeUnicode(filename);\r\n String ext;\r\n if (!StringUtils.isEmpty(dllink)) {\r\n ext = getFileNameExtensionFromString(dllink, default_extension);\r\n if (ext != null && !ext.matches(\"\\\\.(?:flv|mp4)\")) {\r\n ext = default_extension;\r\n }\r\n } else {\r\n ext = default_extension;\r\n }\r\n if (!filename.endsWith(ext)) {\r\n filename += ext;\r\n }\r\n link.setFinalFileName(filename);\r\n if (!StringUtils.isEmpty(dllink) && !isDownload) {\r\n if (dllink.startsWith(\"//\")) {\r\n dllink = \"https:\" + dllink;\r\n }\r\n URLConnectionAdapter con = null;\r\n try {\r\n con = openAntiDDoSRequestConnection(br, br.createHeadRequest(dllink));\r\n if (con.getContentType().contains(\"text\") || !con.isOK() || con.getLongContentLength() == -1) {\r\n server_issues = true;\r\n } else {\r\n link.setDownloadSize(con.getLongContentLength());\r\n }\r\n } finally {\r\n try {\r\n con.disconnect();\r\n } catch (final Throwable e) {\r\n }\r\n }\r\n }\r\n return AvailableStatus.TRUE;\r\n }\r\n\r\n @Override\r\n public void handleFree(final DownloadLink downloadLink) throws Exception {\r\n requestFileInformation(downloadLink, true);\r\n if (server_issues) {\r\n throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, \"Unknown server error\", 10 * 60 * 1000l);\r\n } else if (StringUtils.isEmpty(dllink)) {\r\n throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);\r\n }\r\n dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, free_resume, free_maxchunks);\r\n if (dl.getConnection().getContentType().contains(\"html\")) {\r\n if (dl.getConnection().getResponseCode() == 403) {\r\n throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, \"Server error 403\", 60 * 60 * 1000l);\r\n } else if (dl.getConnection().getResponseCode() == 404) {\r\n throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, \"Server error 404\", 60 * 60 * 1000l);\r\n }\r\n br.followConnection();\r\n try {\r\n dl.getConnection().disconnect();\r\n } catch (final Throwable e) {\r\n }\r\n throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);\r\n }\r\n dl.startDownload();\r\n }\r\n\r\n @Override\r\n public int getMaxSimultanFreeDownloadNum() {\r\n return free_maxdownloads;\r\n }\r\n\r\n @Override\r\n public void reset() {\r\n }\r\n\r\n @Override\r\n public void resetPluginGlobals() {\r\n }\r\n\r\n @Override\r\n public void resetDownloadlink(DownloadLink link) {\r\n }\r\n}\r\n"} +{"text": "require('../../modules/es6.reflect.is-extensible');\nmodule.exports = require('../../modules/$.core').Reflect.isExtensible;"} +{"text": " //\n// available at http://getid3.sourceforge.net //\n// or http://www.getid3.org //\n/////////////////////////////////////////////////////////////////\n// See readme.txt for more details //\n/////////////////////////////////////////////////////////////////\n// //\n// module.misc.par2.php //\n// module for analyzing PAR2 files //\n// dependencies: NONE //\n// ///\n/////////////////////////////////////////////////////////////////\n\n\nclass getid3_par2 extends getid3_handler\n{\n\n\tfunction Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$info['fileformat'] = 'par2';\n\n\t\t$info['error'][] = 'PAR2 parsing not enabled in this version of getID3()';\n\t\treturn false;\n\n\t}\n\n}\n\n\n?>"} +{"text": "\"\"\"\nTest the napalm_formula execution module.\n\"\"\"\n\nimport textwrap\n\nimport salt.modules.napalm_formula as napalm_formula\nfrom salt.utils.immutabletypes import freeze\nfrom tests.support.mixins import LoaderModuleMockMixin\nfrom tests.support.mock import MagicMock, patch\nfrom tests.support.unit import TestCase\n\n\nclass TestModulesNAPALMFormula(TestCase, LoaderModuleMockMixin):\n @classmethod\n def setUpClass(cls):\n cls.model = freeze(\n {\n \"interfaces\": {\n \"interface\": {\n \"Ethernet1\": {\n \"config\": {\n \"name\": \"Ethernet1\",\n \"description\": \"Interface Ethernet1\",\n },\n \"subinterfaces\": {\n \"subinterface\": {\n \"0\": {\n \"config\": {\n \"index\": 0,\n \"description\": \"Subinterface Ethernet1.0\",\n }\n },\n \"100\": {\n \"config\": {\n \"index\": 100,\n \"description\": \"Subinterface Ethernet1.100\",\n }\n },\n \"900\": {\n \"config\": {\n \"index\": 900,\n \"description\": \"Subinterface Ethernet1.900\",\n }\n },\n }\n },\n },\n \"Ethernet2\": {\n \"config\": {\n \"name\": \"Ethernet2\",\n \"description\": \"Interface Ethernet2\",\n },\n \"subinterfaces\": {\n \"subinterface\": {\n \"400\": {\n \"config\": {\n \"index\": 400,\n \"description\": \"Subinterface Ethernet2.400\",\n }\n }\n }\n },\n },\n }\n }\n }\n )\n\n cls.defaults = freeze(\n {\n \"interfaces\": {\n \"interface\": {\n \"*\": {\n \"config\": {\"mtu\": 2048, \"enabled\": True},\n \"subinterfaces\": {\n \"subinterface\": {\"*\": {\"config\": {\"enabled\": True}}}\n },\n }\n }\n }\n }\n )\n\n def setup_loader_modules(self):\n patcher = patch(\"salt.utils.napalm.is_proxy\", MagicMock(return_value=True))\n patcher.start()\n self.addCleanup(patcher.stop)\n return {napalm_formula: {\"__grains__\": {\"os\": \"eos\"}}}\n\n def test_container_path(self):\n paths = [\n \"interfaces:interface:Ethernet1:config\",\n \"interfaces:interface:Ethernet1:subinterfaces:subinterface:0:config\",\n \"interfaces:interface:Ethernet1:subinterfaces:subinterface:100:config\",\n \"interfaces:interface:Ethernet2:subinterfaces:subinterface:400:config\",\n \"interfaces:interface:Ethernet1:subinterfaces:subinterface:900:config\",\n \"interfaces:interface:Ethernet2:config\",\n ]\n ret = napalm_formula.container_path(self.model.copy())\n self.assertEqual(set(ret), set(paths))\n\n def test_setval(self):\n dict_ = {\"foo\": {\"bar\": {\"baz\": True}}}\n self.assertEqual(dict_, napalm_formula.setval(\"foo:bar:baz\", True))\n\n def test_defaults(self):\n expected_result = {\n \"interfaces\": {\n \"interface\": {\n \"Ethernet1\": {\n \"config\": {\n \"name\": \"Ethernet1\",\n \"description\": \"Interface Ethernet1\",\n \"mtu\": 2048,\n \"enabled\": True,\n },\n \"subinterfaces\": {\n \"subinterface\": {\n \"0\": {\n \"config\": {\n \"index\": 0,\n \"description\": \"Subinterface Ethernet1.0\",\n \"enabled\": True,\n }\n },\n \"100\": {\n \"config\": {\n \"index\": 100,\n \"description\": \"Subinterface Ethernet1.100\",\n \"enabled\": True,\n }\n },\n \"900\": {\n \"config\": {\n \"index\": 900,\n \"description\": \"Subinterface Ethernet1.900\",\n \"enabled\": True,\n }\n },\n }\n },\n },\n \"Ethernet2\": {\n \"config\": {\n \"name\": \"Ethernet2\",\n \"description\": \"Interface Ethernet2\",\n \"mtu\": 2048,\n \"enabled\": True,\n },\n \"subinterfaces\": {\n \"subinterface\": {\n \"400\": {\n \"config\": {\n \"index\": 400,\n \"description\": \"Subinterface Ethernet2.400\",\n \"enabled\": True,\n }\n }\n }\n },\n },\n }\n }\n }\n ret = napalm_formula.defaults(self.model.copy(), self.defaults.copy())\n self.assertEqual(ret, expected_result)\n\n def test_render_field(self):\n config = {\"description\": \"Interface description\"}\n ret = napalm_formula.render_field(config, \"description\", quotes=True)\n self.assertEqual(ret, 'description \"Interface description\"')\n\n def test_render_field_junos(self):\n config = {\"description\": \"Interface description\"}\n with patch.dict(napalm_formula.__grains__, {\"os\": \"junos\"}):\n ret = napalm_formula.render_field(config, \"description\", quotes=True)\n self.assertEqual(ret, 'description \"Interface description\";')\n\n def test_render_fields(self):\n config = {\"mtu\": 2048, \"description\": \"Interface description\"}\n expected_render = textwrap.dedent(\n '''\\\n mtu \"2048\"\n description \"Interface description\"'''\n )\n ret = napalm_formula.render_fields(config, \"mtu\", \"description\", quotes=True)\n self.assertEqual(ret, expected_render)\n"} +{"text": "StartChar: uni08A0.init_BaaBaaIsol\nEncoding: 70090 -1 5642\nWidth: 247\nFlags: HW\nAnchorPoint: \"TashkilAbove\" 0 801 basechar 0\nAnchorPoint: \"TashkilBelow\" 93 -405 basechar 0\nLayerCount: 3\nFore\nRefer: 251 -1 N 1 0 0 1 93 161 2\nRefer: 150 -1 N 1 0 0 1 0 0 3\nEndChar\n"} +{"text": "/*\n * Copyright (C) 2010-2019 The ESPResSo project\n * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010\n * Max-Planck-Institute for Polymer Research, Theory Group\n *\n * This file is part of ESPResSo.\n *\n * ESPResSo is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * ESPResSo is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n#ifndef hat_H\n#define hat_H\n\n/** \\file\n * Routines to calculate the hat potential between particle pairs.\n *\n * Implementation in \\ref hat.cpp.\n */\n\n#include \"config.hpp\"\n\n#ifdef HAT\n\n#include \"nonbonded_interaction_data.hpp\"\n\nint hat_set_params(int part_type_a, int part_type_b, double Fmax, double r);\n\n/** Resultant force due to a hat potential between two\n * particles at interatomic separation dist.\n */\ninline double hat_force_r(double Fmax, double r, double dist) {\n return dist < r ? Fmax * (1 - dist / r) : 0.0;\n}\n\n/** Potential energy due to a hat potential between two\n * particles at interatomic separation dist.\n */\ninline double hat_energy_r(double Fmax, double r, double dist) {\n return dist < r ? Fmax * (dist - r) * ((dist + r) / (2.0 * r) - 1.0) : 0.0;\n}\n\n/** Calculate hat force factor */\ninline double hat_pair_force_factor(IA_parameters const &ia_params,\n double dist) {\n if (dist > 0. && dist < ia_params.hat.r) {\n return hat_force_r(ia_params.hat.Fmax, ia_params.hat.r, dist) / dist;\n }\n return 0.0;\n}\n\n/** Calculate hat force */\ninline Utils::Vector3d hat_pair_force(IA_parameters const &ia_params,\n Utils::Vector3d const &d, double dist) {\n return d * hat_pair_force_factor(ia_params, dist);\n}\n\n/** Calculate hat energy */\ninline double hat_pair_energy(IA_parameters const &ia_params, double dist) {\n if (dist < ia_params.hat.r) {\n return hat_energy_r(ia_params.hat.Fmax, ia_params.hat.r, dist);\n }\n return 0.0;\n}\n\n#endif /* ifdef HAT */\n#endif\n"} +{"text": "// Package cmd 命令入口\npackage cmd\n\nimport \"github.com/spf13/cobra\"\n\nvar rootCmd = &cobra.Command{\n\tUse:\"mars\",\n\tShort:\"HTTP(S) proxy\",\n}\n\n// Execute 执行命令\nfunc Execute() {\n\terr := rootCmd.Execute()\n\tif err != nil {\n\n\t}\n}\n"} +{"text": "/*\n * Copyright (c) 2001-2004 Swedish Institute of Computer Science.\n * All rights reserved. \n * \n * Redistribution and use in source and binary forms, with or without modification, \n * are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED \n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF \n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT \n * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \n * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING \n * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY \n * OF SUCH DAMAGE.\n *\n * This file is part of the lwIP TCP/IP stack.\n * \n * Author: Adam Dunkels \n *\n */\n#ifndef __LWIP_DEF_H__\n#define __LWIP_DEF_H__\n\n/* arch.h might define NULL already */\n#include \"lwip/arch.h\"\n#include \"lwip/opt.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y))\n#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y))\n\n#ifndef NULL\n#define NULL ((void *)0)\n#endif\n\n/* Endianess-optimized shifting of two u8_t to create one u16_t */\n#if BYTE_ORDER == LITTLE_ENDIAN\n#define LWIP_MAKE_U16(a, b) ((a << 8) | b)\n#else\n#define LWIP_MAKE_U16(a, b) ((b << 8) | a)\n#endif \n\n#ifndef LWIP_PLATFORM_BYTESWAP\n#define LWIP_PLATFORM_BYTESWAP 0\n#endif\n\n#ifndef LWIP_PREFIX_BYTEORDER_FUNCS\n/* workaround for naming collisions on some platforms */\n\n#ifdef htons\n#undef htons\n#endif /* htons */\n#ifdef htonl\n#undef htonl\n#endif /* htonl */\n#ifdef ntohs\n#undef ntohs\n#endif /* ntohs */\n#ifdef ntohl\n#undef ntohl\n#endif /* ntohl */\n\n#define htons(x) lwip_htons(x)\n#define ntohs(x) lwip_ntohs(x)\n#define htonl(x) lwip_htonl(x)\n#define ntohl(x) lwip_ntohl(x)\n#endif /* LWIP_PREFIX_BYTEORDER_FUNCS */\n\n#if BYTE_ORDER == BIG_ENDIAN\n#define lwip_htons(x) (x)\n#define lwip_ntohs(x) (x)\n#define lwip_htonl(x) (x)\n#define lwip_ntohl(x) (x)\n#define PP_HTONS(x) (x)\n#define PP_NTOHS(x) (x)\n#define PP_HTONL(x) (x)\n#define PP_NTOHL(x) (x)\n#else /* BYTE_ORDER != BIG_ENDIAN */\n#if LWIP_PLATFORM_BYTESWAP\n#define lwip_htons(x) LWIP_PLATFORM_HTONS(x)\n#define lwip_ntohs(x) LWIP_PLATFORM_HTONS(x)\n#define lwip_htonl(x) LWIP_PLATFORM_HTONL(x)\n#define lwip_ntohl(x) LWIP_PLATFORM_HTONL(x)\n#else /* LWIP_PLATFORM_BYTESWAP */\nu16_t lwip_htons(u16_t x);\nu16_t lwip_ntohs(u16_t x);\nu32_t lwip_htonl(u32_t x);\nu32_t lwip_ntohl(u32_t x);\n#endif /* LWIP_PLATFORM_BYTESWAP */\n\n/* These macros should be calculated by the preprocessor and are used\n with compile-time constants only (so that there is no little-endian\n overhead at runtime). */\n#define PP_HTONS(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))\n#define PP_NTOHS(x) PP_HTONS(x)\n#define PP_HTONL(x) ((((x) & 0xff) << 24) | \\\n (((x) & 0xff00) << 8) | \\\n (((x) & 0xff0000UL) >> 8) | \\\n (((x) & 0xff000000UL) >> 24))\n#define PP_NTOHL(x) PP_HTONL(x)\n\n#endif /* BYTE_ORDER == BIG_ENDIAN */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __LWIP_DEF_H__ */\n\n"} +{"text": "/*\n * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan\n * (Royal Institute of Technology, Stockholm, Sweden).\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the Institute nor the names of its contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include \n\n#include \n\n#if !HAVE_DECL_ENVIRON\nextern char **environ;\n#endif\n\n/*\n * putenv --\n *\tString points to a string of the form name=value.\n *\n * Makes the value of the environment variable name equal to\n * value by altering an existing variable or creating a new one.\n */\n\nROKEN_LIB_FUNCTION int ROKEN_LIB_CALL\nputenv(const char *string)\n{\n int i;\n const char *eq = (const char *)strchr(string, '=');\n int len;\n\n if (eq == NULL)\n\treturn 1;\n len = eq - string;\n\n if(environ == NULL) {\n\tenviron = malloc(sizeof(char*));\n\tif(environ == NULL)\n\t return 1;\n\tenviron[0] = NULL;\n }\n\n for(i = 0; environ[i] != NULL; i++)\n\tif(strncmp(string, environ[i], len) == 0) {\n\t environ[i] = string;\n\t return 0;\n\t}\n environ = realloc(environ, sizeof(char*) * (i + 2));\n if(environ == NULL)\n\treturn 1;\n environ[i] = string;\n environ[i+1] = NULL;\n return 0;\n}\n"} +{"text": "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import print_function\n\nimport os\nimport unittest\nimport tempfile\nfrom test_dist_fleet_heter_base import TestFleetHeterBase\nimport paddle\n\npaddle.enable_static()\n\n\nclass TestDistHeterPyreaderAsync2x2(TestFleetHeterBase):\n def _setup_config(self):\n self._mode = \"async\"\n self._reader = \"pyreader\"\n\n def check_with_place(self,\n model_file,\n delta=1e-3,\n check_error_log=False,\n need_envs={}):\n required_envs = {\n \"PATH\": os.getenv(\"PATH\", \"\"),\n \"PYTHONPATH\": os.getenv(\"PYTHONPATH\", \"\"),\n \"LD_LIBRARY_PATH\": os.getenv(\"LD_LIBRARY_PATH\", \"\"),\n \"FLAGS_rpc_deadline\": \"5000\", # 5sec to fail fast\n \"http_proxy\": \"\",\n \"CPU_NUM\": \"3\"\n }\n\n required_envs.update(need_envs)\n\n if check_error_log:\n required_envs[\"GLOG_v\"] = \"3\"\n required_envs[\"GLOG_logtostderr\"] = \"1\"\n\n tr0_losses, tr1_losses = self._run_cluster(model_file, required_envs)\n\n def test_dist_train(self):\n self.check_with_place(\n \"dist_fleet_heter_ctr.py\", delta=1e-5, check_error_log=True)\n\n\nif __name__ == \"__main__\":\n unittest.main()\n"} +{"text": "/*******************************************************************************\n * thrill/net/tcp/select_dispatcher.cpp\n *\n * Lightweight wrapper around BSD socket API.\n *\n * Part of Project Thrill - http://project-thrill.org\n *\n * Copyright (C) 2015 Timo Bingmann \n *\n * All rights reserved. Published under the BSD-2 license in the LICENSE file.\n ******************************************************************************/\n\n#include \n\n#include \n\nnamespace thrill {\nnamespace net {\nnamespace tcp {\n\n//! Run one iteration of dispatching select().\nvoid SelectDispatcher::DispatchOne(const std::chrono::milliseconds& timeout) {\n\n // copy select fdset\n Select fdset = select_;\n\n if (self_verify_)\n {\n for (int fd = 3; fd < static_cast(watch_.size()); ++fd) {\n Watch& w = watch_[fd];\n\n if (!w.active) continue;\n\n assert((w.read_cb.size() == 0) != select_.InRead(fd));\n assert((w.write_cb.size() == 0) != select_.InWrite(fd));\n }\n }\n\n if (debug)\n {\n std::ostringstream oss;\n oss << \"| \";\n\n for (int fd = 3; fd < static_cast(watch_.size()); ++fd) {\n Watch& w = watch_[fd];\n\n if (!w.active) continue;\n\n if (select_.InRead(fd))\n oss << \"r\" << fd << \" \";\n if (select_.InWrite(fd))\n oss << \"w\" << fd << \" \";\n if (select_.InException(fd))\n oss << \"e\" << fd << \" \";\n }\n\n LOG << \"Performing select() on \" << oss.str();\n }\n\n int r = fdset.select_timeout(static_cast(timeout.count()));\n\n if (r < 0) {\n // if we caught a signal, this is intended to interrupt a select().\n if (errno == EINTR) {\n LOG << \"Dispatch(): select() was interrupted due to a signal.\";\n return;\n }\n\n throw Exception(\"Dispatch::Select() failed!\", errno);\n }\n if (r == 0) return;\n\n // start running through the table at fd 3. 0 = stdin, 1 = stdout, 2 =\n // stderr.\n\n for (int fd = 3; fd < static_cast(watch_.size()); ++fd)\n {\n // we use a pointer into the watch_ table. however, since the\n // std::vector may regrow when callback handlers are called, this\n // pointer is reset a lot of times.\n Watch* w = &watch_[fd];\n\n if (!w->active) continue;\n\n if (fdset.InRead(fd))\n {\n if (w->read_cb.size()) {\n // run read callbacks until one returns true (in which case\n // it wants to be called again), or the read_cb list is\n // empty.\n while (w->read_cb.size() && w->read_cb.front()() == false) {\n w = &watch_[fd];\n w->read_cb.pop_front();\n }\n w = &watch_[fd];\n\n if (w->read_cb.size() == 0) {\n // if all read callbacks are done, listen no longer.\n select_.ClearRead(fd);\n if (w->write_cb.size() == 0 && !w->except_cb) {\n // if also all write callbacks are done, stop\n // listening.\n select_.ClearWrite(fd);\n select_.ClearException(fd);\n w->active = false;\n }\n }\n }\n else {\n LOG << \"SelectDispatcher: got read event for fd \"\n << fd << \" without a read handler.\";\n\n select_.ClearRead(fd);\n }\n }\n\n if (fdset.InWrite(fd))\n {\n if (w->write_cb.size()) {\n // run write callbacks until one returns true (in which case\n // it wants to be called again), or the write_cb list is\n // empty.\n while (w->write_cb.size() && w->write_cb.front()() == false) {\n w = &watch_[fd];\n w->write_cb.pop_front();\n }\n w = &watch_[fd];\n\n if (w->write_cb.size() == 0) {\n // if all write callbacks are done, listen no longer.\n select_.ClearWrite(fd);\n if (w->read_cb.size() == 0 && !w->except_cb) {\n // if also all write callbacks are done, stop\n // listening.\n select_.ClearRead(fd);\n select_.ClearException(fd);\n w->active = false;\n }\n }\n }\n else {\n LOG << \"SelectDispatcher: got write event for fd \"\n << fd << \" without a write handler.\";\n\n select_.ClearWrite(fd);\n }\n }\n\n if (fdset.InException(fd))\n {\n if (w->except_cb) {\n if (!w->except_cb()) {\n // callback returned false: remove fd from set\n select_.ClearException(fd);\n }\n }\n else {\n DefaultExceptionCallback();\n }\n }\n }\n}\n\nvoid SelectDispatcher::Interrupt() {\n // there are multiple very platform-dependent ways to do this. we'll try\n // to use the self-pipe trick for now. The select() method waits on\n // another fd, which we write one byte to when we need to interrupt the\n // select().\n\n // another method would be to send a signal() via pthread_kill() to the\n // select thread, but that had a race condition for waking up the other\n // thread. -tb\n\n // send one byte to wake up the select() handler.\n ssize_t wb;\n while ((wb = write(self_pipe_[1], this, 1)) == 0) {\n LOG1 << \"WakeUp: error sending to self-pipe: \" << errno;\n }\n die_unless(wb == 1);\n}\n\nbool SelectDispatcher::SelfPipeCallback() {\n while (read(self_pipe_[0],\n self_pipe_buffer_, sizeof(self_pipe_buffer_)) > 0) {\n /* repeat, until empty pipe */\n }\n return true;\n}\n\n} // namespace tcp\n} // namespace net\n} // namespace thrill\n\n/******************************************************************************/\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\npackage org.apache.skywalking.apm.plugin.activemq.define;\n\nimport net.bytebuddy.description.method.MethodDescription;\nimport net.bytebuddy.matcher.ElementMatcher;\nimport org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;\nimport org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;\nimport org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;\nimport org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;\nimport org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch;\n\nimport static net.bytebuddy.matcher.ElementMatchers.named;\nimport static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;\n\n/**\n * {@link ActiveMQConsumerInstrumentation} presents that skywalking intercepts {@link\n * org.apache.activemq.ActiveMQMessageConsumer}.\n */\npublic class ActiveMQConsumerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {\n public static final String INTERCEPTOR_CLASS = \"org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerInterceptor\";\n public static final String ENHANCE_CLASS_CONSUMER = \"org.apache.activemq.ActiveMQMessageConsumer\";\n public static final String CONSTRUCTOR_INTERCEPTOR_CLASS = \"org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerConstructorInterceptor\";\n public static final String ENHANCE_METHOD_DISPATCH = \"dispatch\";\n public static final String CONSTRUCTOR_INTERCEPT_TYPE = \"org.apache.activemq.ActiveMQSession\";\n\n @Override\n public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {\n return new ConstructorInterceptPoint[] {\n new ConstructorInterceptPoint() {\n @Override\n public ElementMatcher getConstructorMatcher() {\n return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_TYPE);\n }\n\n @Override\n public String getConstructorInterceptor() {\n return CONSTRUCTOR_INTERCEPTOR_CLASS;\n }\n }\n };\n }\n\n @Override\n public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {\n return new InstanceMethodsInterceptPoint[] {\n new InstanceMethodsInterceptPoint() {\n @Override\n public ElementMatcher getMethodsMatcher() {\n return named(ENHANCE_METHOD_DISPATCH);\n }\n\n @Override\n public String getMethodsInterceptor() {\n return INTERCEPTOR_CLASS;\n }\n\n @Override\n public boolean isOverrideArgs() {\n return false;\n }\n }\n };\n }\n\n @Override\n protected ClassMatch enhanceClass() {\n return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS_CONSUMER);\n }\n}"} +{"text": "#!/bin/bash\n\nfind src -name \"*.java\" -print0 | xargs -0 \\\nsed -i -e '/Copyright/,/Licensed under the Apache License, Version 2.0/c\\\n/*\\\n * Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\\\n *\\\n * Licensed under the Apache License, Version 2.0 (the \"License\").\\\n * You may not use this file except in compliance with the License.\\\n * A copy of the License is located at\\\n *\\\n * http://aws.amazon.com/apache2.0\\\n *\\\n * or in the \"license\" file accompanying this file. This file is distributed\\\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\\\n * express or implied. See the License for the specific language governing\\\n * permissions and limitations under the License.\\\n */\\\n'\nfind src | grep \"java\\-e\" | xargs rm\n"} +{"text": "\n * [user-info@]host[:port]\n * \n *\n * If the port component is not set or is the standard port for the current\n * scheme, it SHOULD NOT be included.\n *\n * @see https://tools.ietf.org/html/rfc3986#section-3.2\n * @return string The URI authority, in \"[user-info@]host[:port]\" format.\n */\n public function getAuthority();\n\n /**\n * Retrieve the user information component of the URI.\n *\n * If no user information is present, this method MUST return an empty\n * string.\n *\n * If a user is present in the URI, this will return that value;\n * additionally, if the password is also present, it will be appended to the\n * user value, with a colon (\":\") separating the values.\n *\n * The trailing \"@\" character is not part of the user information and MUST\n * NOT be added.\n *\n * @return string The URI user information, in \"username[:password]\" format.\n */\n public function getUserInfo();\n\n /**\n * Retrieve the host component of the URI.\n *\n * If no host is present, this method MUST return an empty string.\n *\n * The value returned MUST be normalized to lowercase, per RFC 3986\n * Section 3.2.2.\n *\n * @see http://tools.ietf.org/html/rfc3986#section-3.2.2\n * @return string The URI host.\n */\n public function getHost();\n\n /**\n * Retrieve the port component of the URI.\n *\n * If a port is present, and it is non-standard for the current scheme,\n * this method MUST return it as an integer. If the port is the standard port\n * used with the current scheme, this method SHOULD return null.\n *\n * If no port is present, and no scheme is present, this method MUST return\n * a null value.\n *\n * If no port is present, but a scheme is present, this method MAY return\n * the standard port for that scheme, but SHOULD return null.\n *\n * @return null|int The URI port.\n */\n public function getPort();\n\n /**\n * Retrieve the path component of the URI.\n *\n * The path can either be empty or absolute (starting with a slash) or\n * rootless (not starting with a slash). Implementations MUST support all\n * three syntaxes.\n *\n * Normally, the empty path \"\" and absolute path \"/\" are considered equal as\n * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically\n * do this normalization because in contexts with a trimmed base path, e.g.\n * the front controller, this difference becomes significant. It's the task\n * of the user to handle both \"\" and \"/\".\n *\n * The value returned MUST be percent-encoded, but MUST NOT double-encode\n * any characters. To determine what characters to encode, please refer to\n * RFC 3986, Sections 2 and 3.3.\n *\n * As an example, if the value should include a slash (\"/\") not intended as\n * delimiter between path segments, that value MUST be passed in encoded\n * form (e.g., \"%2F\") to the instance.\n *\n * @see https://tools.ietf.org/html/rfc3986#section-2\n * @see https://tools.ietf.org/html/rfc3986#section-3.3\n * @return string The URI path.\n */\n public function getPath();\n\n /**\n * Retrieve the query string of the URI.\n *\n * If no query string is present, this method MUST return an empty string.\n *\n * The leading \"?\" character is not part of the query and MUST NOT be\n * added.\n *\n * The value returned MUST be percent-encoded, but MUST NOT double-encode\n * any characters. To determine what characters to encode, please refer to\n * RFC 3986, Sections 2 and 3.4.\n *\n * As an example, if a value in a key/value pair of the query string should\n * include an ampersand (\"&\") not intended as a delimiter between values,\n * that value MUST be passed in encoded form (e.g., \"%26\") to the instance.\n *\n * @see https://tools.ietf.org/html/rfc3986#section-2\n * @see https://tools.ietf.org/html/rfc3986#section-3.4\n * @return string The URI query string.\n */\n public function getQuery();\n\n /**\n * Retrieve the fragment component of the URI.\n *\n * If no fragment is present, this method MUST return an empty string.\n *\n * The leading \"#\" character is not part of the fragment and MUST NOT be\n * added.\n *\n * The value returned MUST be percent-encoded, but MUST NOT double-encode\n * any characters. To determine what characters to encode, please refer to\n * RFC 3986, Sections 2 and 3.5.\n *\n * @see https://tools.ietf.org/html/rfc3986#section-2\n * @see https://tools.ietf.org/html/rfc3986#section-3.5\n * @return string The URI fragment.\n */\n public function getFragment();\n\n /**\n * Return an instance with the specified scheme.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified scheme.\n *\n * Implementations MUST support the schemes \"http\" and \"https\" case\n * insensitively, and MAY accommodate other schemes if required.\n *\n * An empty scheme is equivalent to removing the scheme.\n *\n * @param string $scheme The scheme to use with the new instance.\n * @return static A new instance with the specified scheme.\n * @throws \\InvalidArgumentException for invalid or unsupported schemes.\n */\n public function withScheme($scheme);\n\n /**\n * Return an instance with the specified user information.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified user information.\n *\n * Password is optional, but the user information MUST include the\n * user; an empty string for the user is equivalent to removing user\n * information.\n *\n * @param string $user The user name to use for authority.\n * @param null|string $password The password associated with $user.\n * @return static A new instance with the specified user information.\n */\n public function withUserInfo($user, $password = null);\n\n /**\n * Return an instance with the specified host.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified host.\n *\n * An empty host value is equivalent to removing the host.\n *\n * @param string $host The hostname to use with the new instance.\n * @return static A new instance with the specified host.\n * @throws \\InvalidArgumentException for invalid hostnames.\n */\n public function withHost($host);\n\n /**\n * Return an instance with the specified port.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified port.\n *\n * Implementations MUST raise an exception for ports outside the\n * established TCP and UDP port ranges.\n *\n * A null value provided for the port is equivalent to removing the port\n * information.\n *\n * @param null|int $port The port to use with the new instance; a null value\n * removes the port information.\n * @return static A new instance with the specified port.\n * @throws \\InvalidArgumentException for invalid ports.\n */\n public function withPort($port);\n\n /**\n * Return an instance with the specified path.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified path.\n *\n * The path can either be empty or absolute (starting with a slash) or\n * rootless (not starting with a slash). Implementations MUST support all\n * three syntaxes.\n *\n * If the path is intended to be domain-relative rather than path relative then\n * it must begin with a slash (\"/\"). Paths not starting with a slash (\"/\")\n * are assumed to be relative to some base path known to the application or\n * consumer.\n *\n * Users can provide both encoded and decoded path characters.\n * Implementations ensure the correct encoding as outlined in getPath().\n *\n * @param string $path The path to use with the new instance.\n * @return static A new instance with the specified path.\n * @throws \\InvalidArgumentException for invalid paths.\n */\n public function withPath($path);\n\n /**\n * Return an instance with the specified query string.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified query string.\n *\n * Users can provide both encoded and decoded query characters.\n * Implementations ensure the correct encoding as outlined in getQuery().\n *\n * An empty query string value is equivalent to removing the query string.\n *\n * @param string $query The query string to use with the new instance.\n * @return static A new instance with the specified query string.\n * @throws \\InvalidArgumentException for invalid query strings.\n */\n public function withQuery($query);\n\n /**\n * Return an instance with the specified URI fragment.\n *\n * This method MUST retain the state of the current instance, and return\n * an instance that contains the specified URI fragment.\n *\n * Users can provide both encoded and decoded fragment characters.\n * Implementations ensure the correct encoding as outlined in getFragment().\n *\n * An empty fragment value is equivalent to removing the fragment.\n *\n * @param string $fragment The fragment to use with the new instance.\n * @return static A new instance with the specified fragment.\n */\n public function withFragment($fragment);\n\n /**\n * Return the string representation as a URI reference.\n *\n * Depending on which components of the URI are present, the resulting\n * string is either a full URI or relative reference according to RFC 3986,\n * Section 4.1. The method concatenates the various components of the URI,\n * using the appropriate delimiters:\n *\n * - If a scheme is present, it MUST be suffixed by \":\".\n * - If an authority is present, it MUST be prefixed by \"//\".\n * - The path can be concatenated without delimiters. But there are two\n * cases where the path has to be adjusted to make the URI reference\n * valid as PHP does not allow to throw an exception in __toString():\n * - If the path is rootless and an authority is present, the path MUST\n * be prefixed by \"/\".\n * - If the path is starting with more than one \"/\" and no authority is\n * present, the starting slashes MUST be reduced to one.\n * - If a query is present, it MUST be prefixed by \"?\".\n * - If a fragment is present, it MUST be prefixed by \"#\".\n *\n * @see http://tools.ietf.org/html/rfc3986#section-4.1\n * @return string\n */\n public function __toString();\n}\n"} +{"text": "#ifndef BLUE_H\r\n#define BLUE_H\r\n\r\nextern void qblue_pic(void);\r\nextern void qunblue_pic(void);\r\nextern void insert_tween(void);\r\nextern void clean_tween(void);\r\nextern void qnext_changes(void);\r\nextern void qnext_blue(void);\r\n\r\n#endif\r\n"} +{"text": "name = 'netcdf4-python'\nversion = '1.3.1'\nversionsuffix = '-Python-%(pyver)s-HDF5-1.8.19'\n\nhomepage = 'https://unidata.github.io/netcdf4-python/'\ndescription = \"\"\"Python/numpy interface to netCDF.\"\"\"\n\ntoolchain = {'name': 'intel', 'version': '2017b'}\ntoolchainopts = {'usempi': True}\n\nsource_urls = ['https://github.com/Unidata/netcdf4-python/archive/']\nsources = ['v%(version)srel.tar.gz']\npatches = ['netcdf4-python-1.1.8-avoid-diskless-test.patch']\nchecksums = [\n 'a1674d281d54af9dd83e38f1be2dabed7de0f1bc8165adcd39c8dfddc4ec20b4', # v1.3.1rel.tar.gz\n # netcdf4-python-1.1.8-avoid-diskless-test.patch\n 'a8b262fa201d55f59015e1bc14466c1d113f807543bc1e05a22481ab0d216d72',\n]\n\ndependencies = [\n ('Python', '3.6.3'),\n ('netCDF', '4.4.1.1', '-HDF5-1.8.19'),\n ('cURL', '7.56.0'),\n]\n\nmoduleclass = 'data'\n"} +{"text": "//\n// ATCChatThreadsViewController.swift\n// ChatApp\n//\n// Created by Florian Marcu on 8/20/18.\n// Copyright © 2018 Instamobile. All rights reserved.\n//\n\nimport UIKit\n\nclass ATCChatThreadsViewController: ATCGenericCollectionViewController {\n \n init(configuration: ATCGenericCollectionViewControllerConfiguration,\n selectionBlock: ATCollectionViewSelectionBlock?,\n viewer: ATCUser) {\n super.init(configuration: configuration, selectionBlock: selectionBlock)\n self.use(adapter: ATCChatThreadAdapter(uiConfig: configuration.uiConfig, viewer: viewer), for: \"ATChatMessage\")\n }\n \n required init?(coder aDecoder: NSCoder) {\n fatalError(\"init(coder:) has not been implemented\")\n }\n \n static func mockThreadsVC(uiConfig: ATCUIGenericConfigurationProtocol,\n dataSource: ATCGenericCollectionViewControllerDataSource,\n viewer: ATCUser) -> ATCChatThreadsViewController {\n let collectionVCConfiguration = ATCGenericCollectionViewControllerConfiguration(\n pullToRefreshEnabled: false,\n pullToRefreshTintColor: .white,\n collectionViewBackgroundColor: .white,\n collectionViewLayout: ATCLiquidCollectionViewLayout(),\n collectionPagingEnabled: false,\n hideScrollIndicators: false,\n hidesNavigationBar: false,\n headerNibName: nil,\n scrollEnabled: false,\n uiConfig: uiConfig\n )\n \n let vc = ATCChatThreadsViewController(configuration: collectionVCConfiguration, selectionBlock: ATCChatThreadsViewController.selectionBlock(viewer: viewer), viewer: ATCChatMockStore.users[0])\n vc.genericDataSource = dataSource\n return vc\n }\n \n static func selectionBlock(viewer: ATCUser) -> ATCollectionViewSelectionBlock? {\n return { (navController, object) in\n let uiConfig = ATCChatUIConfiguration(primaryColor: UIColor(hexString: \"#0084ff\"),\n secondaryColor: UIColor(hexString: \"#f0f0f0\"),\n inputTextViewBgColor: UIColor(hexString: \"#f4f4f6\"),\n inputTextViewTextColor: .black,\n inputPlaceholderTextColor: UIColor(hexString: \"#979797\"))\n if let lastMessage = object as? ATChatMessage {\n let otherUser = viewer.uid == lastMessage.atcSender.uid ? lastMessage.recipient : lastMessage.atcSender\n let vc = ATCChatThreadViewController(user: viewer, channel: ATCChatChannel(id: lastMessage.channelId, name: otherUser.fullName()), uiConfig: uiConfig)\n navController?.pushViewController(vc, animated: true)\n }\n }\n }\n}\n"} +{"text": "use crate::cursor::{Cursor, FuncCursor};\nuse crate::dominator_tree::DominatorTree;\nuse crate::inst_predicates::is_safepoint;\nuse crate::ir::{Function, InstBuilder};\nuse crate::isa::TargetIsa;\nuse crate::regalloc::live_value_tracker::LiveValueTracker;\nuse crate::regalloc::liveness::Liveness;\nuse alloc::vec::Vec;\n\nfn insert_and_encode_safepoint<'f>(\n pos: &mut FuncCursor<'f>,\n tracker: &LiveValueTracker,\n isa: &dyn TargetIsa,\n) {\n // Iterate through all live values, collect only the references.\n let live_ref_values = tracker\n .live()\n .iter()\n .filter(|live_value| pos.func.dfg.value_type(live_value.value).is_ref())\n .map(|live_val| live_val.value)\n .collect::>();\n\n if !live_ref_values.is_empty() {\n pos.ins().safepoint(&live_ref_values);\n // Move cursor to the new safepoint instruction to encode it.\n if let Some(inst) = pos.prev_inst() {\n let ok = pos.func.update_encoding(inst, isa).is_ok();\n debug_assert!(ok);\n }\n // Restore cursor position.\n pos.next_inst();\n }\n}\n\n// The emit_stack_maps() function analyzes each instruction to retrieve the liveness of\n// the defs and operands by traversing a function's blocks in layout order.\npub fn emit_stack_maps(\n func: &mut Function,\n domtree: &DominatorTree,\n liveness: &Liveness,\n tracker: &mut LiveValueTracker,\n isa: &dyn TargetIsa,\n) {\n let mut curr = func.layout.entry_block();\n\n while let Some(block) = curr {\n tracker.block_top(block, &func.dfg, liveness, &func.layout, domtree);\n tracker.drop_dead_params();\n let mut pos = FuncCursor::new(func);\n\n // From the top of the block, step through the instructions.\n pos.goto_top(block);\n\n while let Some(inst) = pos.next_inst() {\n if is_safepoint(&pos.func, inst) {\n insert_and_encode_safepoint(&mut pos, tracker, isa);\n }\n\n // Process the instruction and get rid of dead values.\n tracker.process_inst(inst, &pos.func.dfg, liveness);\n tracker.drop_dead(inst);\n }\n curr = func.layout.next_block(block);\n }\n}\n"} +{"text": "#!/bin/bash\n\n# Test script to check uintptr_t and 64-bit types for warnings\n#\n# It builds a few boards with different toolchains. If there are no warnings\n# then all is well.\n#\n# Usage:\n#\n# Make sure that your toolchains are correct at the bottom of this file\n#\n# Then:\n#\t./test/stdint/test-includes.sh\n\nout=/tmp/test-includes.tmp\n\ntry_test() {\n\tlocal board=$1\n\tlocal arch=$2\n\tlocal soc=$3\n\tlocal gcc=$4\n\tlocal flags=\"$5\"\n\n\techo $@\n\tif ! which ${gcc} >/dev/null 2>&1; then\n\t\techo \"Not found: ${gcc}\"\n\t\treturn\n\tfi\n\n\trm -rf ${out}\n\tmkdir -p ${out}\n\ttouch ${out}/config.h\n\tmkdir -p ${out}/generated\n\ttouch ${out}/generated/generic-asm-offsets.h\n\tmkdir -p ${out}/include/asm\n\tln -s $(pwd)/arch/${arch}/include/asm/arch-${soc} \\\n\t\t\t${out}/include/asm/arch\n\n\tcmd=\"${gcc} -c -D__KERNEL__ ${flags} \\\n\t\t-fno-builtin -ffreestanding \\\n\t\t-Iarch/${arch}/include \\\n\t\t-Iinclude \\\n\t\t-I${out} -I${out}/include \\\n\t\t-include configs/${board}.h test/stdint/int-types.c \\\n\t\t-o /dev/null\"\n\t$cmd\n}\n\n# Run a test with and without CONFIG_USE_STDINT\ntry_both() {\n\ttry_test $@\n\ttry_test $@ -DCONFIG_USE_STDINT\n}\n\n# board arch soc path-to-gcc\ntry_both sandbox sandbox - gcc\ntry_both coreboot x86 - x86_64-linux-gnu-gcc\ntry_both seaboard arm tegra20 /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin/arm-linux-gnueabihf-gcc\n"} +{"text": ".assembly extern mscorlib\n{\n .publickeytoken = (B7 7A 5C 56 19 34 E0 89)\n .ver 2:0:0:0\n}\n\n.assembly CaEmptyBlob {}\n\n.module CaEmptyBlob.dll\n\n.class public auto ansi CustomAttribute extends [mscorlib]System.Attribute\n{\n\t.custom instance void CustomAttribute::.ctor() = ()\n\n\t.method public hidebysig specialname rtspecialname instance void .ctor()\n\t{\n\t\tldarg.0\n\t\tcall instance void [mscorlib]System.Attribute::.ctor()\n\t\tret\n\t}\n}\n"} +{"text": "#ifdef __OBJC__\n#import \n#else\n#ifndef FOUNDATION_EXPORT\n#if defined(__cplusplus)\n#define FOUNDATION_EXPORT extern \"C\"\n#else\n#define FOUNDATION_EXPORT extern\n#endif\n#endif\n#endif\n\n\nFOUNDATION_EXPORT double Pods_RocketChatRNVersionNumber;\nFOUNDATION_EXPORT const unsigned char Pods_RocketChatRNVersionString[];\n\n"} +{"text": "/*******************************************************************************\n * Copyright (c) 2010 itemis AG (http://www.itemis.eu)\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n * Contributors:\n * Jan Koehnlein - Initial API and implementation\n *******************************************************************************/\npackage com.github.jknack.antlr4ide.ui.railroad.figures.primitives;\n\n/**\n * Enum for the possible types of nodes.\n *\n * @author Jan Koehnlein - Initial contribution and API\n */\npublic enum NodeType {\n ROUNDED, RECTANGLE, LABEL, EMPTY_ALT;\n}"} +{"text": "import sys\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom .base_model import BaseModel\n\nsys.path.append('..')\n\nfrom utils.opencvhelper import SiftWrapper\n\n\nclass RootsiftModel(BaseModel):\n default_config = {'n_feature': 0, \"n_sample\": 0,\n 'batch_size': 512, 'sift_wrapper': None, 'upright': False, 'scale_diff': False,\n 'dense_desc': False, 'sift_desc': False, 'peak_thld': 0.0067, 'max_dim': 1280}\n\n def _init_model(self):\n self.sift_wrapper = SiftWrapper(\n n_feature=self.config['n_feature'],\n n_sample=self.config['n_sample'],\n peak_thld=self.config['peak_thld'])\n self.sift_wrapper.standardize = False # the network has handled this step.\n self.sift_wrapper.ori_off = self.config['upright']\n self.sift_wrapper.pyr_off = not self.config['scale_diff']\n self.sift_wrapper.create()\n\n def _run(self, data):\n assert data.shape[-1] == 1\n gray_img = np.squeeze(data, axis=-1).astype(np.uint8)\n # detect SIFT keypoints.\n npy_kpts, cv_kpts = self.sift_wrapper.detect(gray_img)\n sift_desc = self.sift_wrapper.compute(gray_img, cv_kpts)\n return npy_kpts, sift_desc\n\n def _construct_network(self):\n \"\"\"Model for patch description.\"\"\"\n return"} +{"text": "/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails jeffmo@fb.com\n */\n\nrequire('mock-modules').autoMockOff();\n\ndescribe('jstransform', function() {\n var transformFn;\n var Syntax = require('esprima-fb').Syntax;\n\n beforeEach(function() {\n require('mock-modules').dumpCache();\n transformFn = require('../jstransform').transform;\n });\n\n function _runVisitor(source, nodeCount, visitor) {\n var actualVisitationCount = 0;\n function shimVisitor(traverse, node, path, state) {\n actualVisitationCount++;\n return visitor(traverse, node, path, state);\n }\n shimVisitor.test = visitor.test;\n transformFn([shimVisitor], source);\n expect(actualVisitationCount).toBe(nodeCount);\n }\n\n function testScopeBoundary(source, localIdents, nodeCount, visitorTest) {\n function visitor(traverse, node, path, state) {\n var actualLocalIdents = Object.keys(state.localScope.identifiers);\n expect(actualLocalIdents.sort()).toEqual(localIdents.sort());\n }\n visitor.test = visitorTest;\n _runVisitor(source, nodeCount, visitor);\n }\n\n function testParentScope(source, parentIdents, nodeCount, visitorTest) {\n function visitor(traverse, node, path, state) {\n parentIdents = parentIdents && parentIdents.sort();\n var parentScope = state.localScope.parentScope;\n var actualParentIdents =\n parentScope && Object.keys(parentScope.identifiers).sort();\n expect(actualParentIdents).toEqual(parentIdents);\n }\n visitor.test = visitorTest;\n _runVisitor(source, nodeCount, visitor);\n }\n\n describe('closure scope boundaries', function() {\n it('creates a scope boundary around Program scope', function() {\n var source =\n 'var foo;' +\n 'var bar, baz;' +\n 'function blah() {}';\n var idents = ['foo', 'bar', 'baz', 'blah'];\n\n testScopeBoundary(source, idents, 3, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n });\n\n it('creates a scope boundary around FunctionDeclarations', function() {\n var source =\n 'var foo;' +\n 'function blah() {' +\n ' var bar;' +\n ' function nested() {' +\n ' var baz;' +\n ' }' +\n '}';\n var programIdents = ['foo', 'blah'];\n var blahIdents = ['arguments', 'bar', 'nested'];\n var nestedIdents = ['arguments', 'baz'];\n\n testScopeBoundary(source, programIdents, 2, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, blahIdents, 2, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'blah';\n });\n\n testScopeBoundary(source, nestedIdents, 1, function(node, path) {\n // All direct children of nested()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'nested';\n });\n });\n\n it('creates a scope boundary around MethodDefinitions', function() {\n var source =\n 'var foo;' +\n 'class ClassA {' +\n ' blah() {' +\n ' var bar;' +\n ' }' +\n ' another() {' +\n ' var baz;' +\n ' }' +\n '}';\n var programIdents = ['foo', 'ClassA'];\n var blahIdents = ['arguments', 'bar'];\n var anotherIdents = ['arguments', 'baz'];\n\n testScopeBoundary(source, programIdents, 2, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, blahIdents, 1, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionExpression &&\n path[2] && path[2].type === Syntax.MethodDefinition &&\n path[2].key.name === 'blah';\n });\n\n testScopeBoundary(source, anotherIdents, 1, function(node, path) {\n // All direct children of another()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionExpression &&\n path[2] && path[2].type === Syntax.MethodDefinition &&\n path[2].key.name === 'another';\n });\n });\n\n it('creates a scope boundary around concise ArrowFunc exprs', function() {\n var source =\n 'var foo;' +\n 'var bar = baz => baz;';\n\n var programIdents = ['foo', 'bar'];\n var barIdents = ['arguments', 'baz'];\n\n testScopeBoundary(source, programIdents, 2, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, barIdents, 1, function(node, path) {\n return path[0] && path[0].type === Syntax.ArrowFunctionExpression\n && path[0].body === node;\n });\n });\n\n it('uses VariableDeclarations to determine scope boundary', function() {\n var source =\n 'var foo = 1;' +\n 'function bar() {' +\n ' foo++;' +\n ' function baz() {' +\n ' var foo = 2;' +\n ' }' +\n '}';\n var programIdents = ['foo', 'bar'];\n var barIdents = ['arguments', 'baz'];\n var bazIdents = ['arguments', 'foo'];\n\n testScopeBoundary(source, programIdents, 2, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, barIdents, 2, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'bar';\n });\n\n testScopeBoundary(source, bazIdents, 1, function(node, path) {\n // All direct children of baz()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'baz';\n });\n });\n\n it('includes function args in functions scope boundary', function() {\n var source =\n 'var foo;' +\n 'function blah(bar) {' +\n ' var baz;' +\n '}' +\n 'var blah2 = bar2 => {var baz;};' +\n 'var blah3 = bar3 => bar3;';\n var programIdents = ['foo', 'blah', 'blah2', 'blah3'];\n var blahIdents = ['arguments', 'bar', 'baz'];\n var blah2Idents = ['arguments', 'bar2', 'baz'];\n var blah3Idents = ['arguments', 'bar3'];\n\n testScopeBoundary(source, programIdents, 4, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, blahIdents, 1, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'blah';\n });\n\n testScopeBoundary(source, blah2Idents, 1, function(node, path) {\n // All direct children of blah2()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.ArrowFunctionExpression &&\n path[2].id.name === 'blah2';\n });\n\n testScopeBoundary(source, blah3Idents, 1, function(node, path) {\n // All direct children of blah3()\n return path[0] && path[0].type === Syntax.ArrowFunctionExpression &&\n path[0].body === node &&\n path[1].id.name === 'blah3';\n });\n });\n\n it('includes rest param args in function scope boundaries', function() {\n var source =\n 'var foo;' +\n 'function blah(...bar) {' +\n ' var baz;' +\n '}' +\n 'var blah2 = (...bar2) => {var baz;};' +\n 'var blah3 = (...bar3) => bar3;';\n var programIdents = ['foo', 'blah', 'blah2', 'blah3'];\n var blahIdents = ['arguments', 'bar', 'baz'];\n var blah2Idents = ['arguments', 'bar2', 'baz'];\n var blah3Idents = ['arguments', 'bar3'];\n\n testScopeBoundary(source, programIdents, 4, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, blahIdents, 1, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'blah';\n });\n\n testScopeBoundary(source, blah2Idents, 1, function(node, path) {\n // All direct children of blah2()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.ArrowFunctionExpression &&\n path[2].id.name === 'blah2';\n });\n\n testScopeBoundary(source, blah3Idents, 1, function(node, path) {\n // All direct children of blah3()\n return path[0] && path[0].type === Syntax.ArrowFunctionExpression &&\n path[0].body === node &&\n path[1].id.name === 'blah3';\n });\n });\n\n it('puts FunctionExpression names within function scope', function() {\n var source =\n 'var foo;' +\n 'var bar = function baz() {' +\n ' var blah;' +\n '};';\n var programIdents = ['foo', 'bar'];\n var bazIdents = ['arguments', 'baz', 'blah'];\n\n testScopeBoundary(source, programIdents, 2, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, bazIdents, 1, function(node, path) {\n // All direct children of baz()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionExpression &&\n path[1].id.name === 'baz';\n });\n });\n });\n\n describe('block scope boundaries', function() {\n it('creates a scope boundary around CatchClauses with params', function() {\n var source =\n 'var blah = 0;' +\n 'try {' +\n '} catch (e) {' +\n ' blah++;' +\n '}';\n var programIdents = ['blah'];\n var catchIdents = ['e'];\n\n testScopeBoundary(source, programIdents, 2, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, catchIdents, 1, function(node, path) {\n // All direct children of catch(e) block\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.CatchClause;\n });\n });\n\n it('includes vars defined in CatchClauses in the parent scope', function() {\n var source =\n 'try {' +\n '} catch (e) {' +\n ' var blah;' +\n '}';\n var programIdents = ['blah'];\n var catchIdents = ['e'];\n\n testScopeBoundary(source, programIdents, 1, function(node, path) {\n return path[0] && path[0].type === Syntax.Program;\n });\n\n testScopeBoundary(source, catchIdents, 1, function(node, path) {\n // All direct children of catch(e) block\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.CatchClause;\n });\n });\n });\n\n describe('scope chain linking', function() {\n it('links parent scope boundaries', function() {\n var source =\n 'var foo;' +\n 'function blah() {' +\n ' var bar;' +\n ' function nested() {' +\n ' var baz;' +\n ' }' +\n '}';\n var programIdents = ['foo', 'blah'];\n var blahIdents = ['arguments', 'bar', 'nested'];\n\n testParentScope(source, programIdents, 2, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'blah';\n });\n\n testParentScope(source, blahIdents, 1, function(node, path) {\n // All direct children of nested()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionDeclaration &&\n path[1].id.name === 'nested';\n });\n });\n\n it('nests MethodDefinition boundaries under parent scope', function() {\n var source =\n 'var foo;' +\n 'class ClassA {' +\n ' blah() {' +\n ' var bar;' +\n ' }' +\n '}';\n var programIdents = ['foo', 'ClassA'];\n\n testParentScope(source, programIdents, 1, function(node, path) {\n // All direct children of blah()\n return path[0] && path[0].type === Syntax.BlockStatement &&\n path[1] && path[1].type === Syntax.FunctionExpression &&\n path[2] && path[2].type === Syntax.MethodDefinition &&\n path[2].key.name === 'blah';\n });\n });\n });\n\n describe('\"use strict\" tracking', function() {\n function testStrictness(expectedStrict, source) {\n var visitedNodes = 0;\n function visitor(traverse, node, path, state) {\n visitedNodes++;\n expect(state.scopeIsStrict).toBe(expectedStrict);\n }\n visitor.test = function(node, path, state) {\n return node.type === Syntax.Literal\n && node.value === 'testStr';\n };\n transformFn([visitor], source);\n expect(visitedNodes).toBe(1);\n }\n\n it('detects program-level strictness', function() {\n testStrictness(false, '\"testStr\";');\n testStrictness(true, '\"use strict\"; \"testStr\";');\n });\n\n it('detects non-inherited strictness', function() {\n testStrictness(true, [\n 'function foo() {',\n ' \"use strict\";',\n ' \"testStr\";',\n '}'\n ].join('\\n'));\n });\n\n it('detects program-inherited strictness', function() {\n testStrictness(true, [\n '\"use strict\";',\n 'function foo() {',\n ' \"testStr\";',\n '}'\n ].join('\\n'));\n });\n\n it('detects function-inherited strictness', function() {\n testStrictness(true, [\n 'function foo() {',\n ' \"use strict\";',\n ' function bar() {',\n ' \"testStr\";',\n ' }',\n '}'\n ].join('\\n'));\n });\n\n it('does not detect sibling strictness', function() {\n testStrictness(false, [\n 'function foo() {',\n ' \"use strict\";',\n '}',\n 'function bar() {',\n ' \"testStr\";',\n '}'\n ].join('\\n'));\n });\n });\n\n describe('visitors', function() {\n it('should visit nodes in order', function() {\n var source = [\n '// Foo comment',\n 'function foo() {}',\n '',\n '// Bar comment',\n 'function bar() {}'\n ].join('\\n');\n\n var actualNodes = [];\n\n function visitFunction(traverse, node, path, state) {\n actualNodes.push([node.id.name, node.range[0]]);\n }\n visitFunction.test = function(node, path, state) {\n return node.type === Syntax.FunctionDeclaration;\n };\n\n function visitComments(traverse, node, path, state) {\n actualNodes.push([node.value, node.range[0]]);\n }\n visitComments.test = function(node, path, state) {\n return node.type === 'Line';\n };\n\n transformFn([visitComments, visitFunction], source);\n\n expect(actualNodes).toEqual([\n [' Foo comment', 0],\n ['foo', 15],\n [' Bar comment', 34],\n ['bar', 49]\n ]);\n });\n });\n});\n"} +{"text": "\n\n\n \n\n\n
\n
float right
\n
Long text long text long text long text long text long text long text long text long text long text long text long text long text
\n
\n \n \n\n\n"} +{"text": "# zora\n\nFast javascript testing library for **nodejs** and **browsers**\n\n[![CircleCI](https://badgen.net/circleci/github/lorenzofox3/zora)](https://circleci.com/gh/lorenzofox3/zora)\n[![npm](https://badgen.net/npm/v/zora)](https://www.npmjs.com/package/zora)\n[![install size](https://badgen.net/packagephobia/install/zora)](https://packagephobia.now.sh/result?p=zora)\n\n[Gitlab mirror](https://gitlab.com/zora-test/zora)\n\n## installation\n\n``npm i --save-dev zora``\n\nIf you are interested in a test runner for Nodejs, checkout [pta](https://github.com/lorenzofox3/zora-node) built on top of zora\nIf you are interested in a test runner for the Browser environment, checkout [playwright-test](https://github.com/hugomrdias/playwright-test) which supports zora out of the box\n\n## (Un)Opinions and Design\n\nThese are the following rules and ideas I have followed while developing zora. Whether they are right or not is an entire different topic ! :D\nNote I have decided to develop zora specially because I was not able to find a tool which complies entirely with these ideas.\n\nInteresting reading related to zora:\n* [Tools and the design of a testing experience](https://dev.to/lorenzofox3/tools-and-the-design-of-a-testing-experience-2mdc)\n* [High concurrency and performances in a testing experience](https://dev.to/lorenzofox3/there-is-beauty-in-simplicity-1npe)\n\n### Tests are regular Javascript programs.\n\nYou don't need a specific test runner, a specific platform or any build step to run your `zora` tests. They are only regular valid EcmaScript 2018 programs.\nIf you have the following test.\n```Javascript\nimport {test} from 'path/to/zora';\n\ntest('should result to the answer', t => {\n const answer = 42;\n t.equal(answer, 42, 'answer should be 42');\n});\n```\n\nYou can run your test with\n1. Node: ``node ./myTestFile.js``\n2. In the browser ```` identically\n\nMoreover zora does not use specific platform API which should make it transparent to most of your tools such module bundlers or transpilers.\n\nIn few words:\n> Zora is EcmaScript, no less, no more.\n\n### Tests are fast\n\nTests are part of our daily routine as software developers. Performance is part of the user experience and there is no reason you should wait seconds for your tests to run.\nZora is by far the **fastest** Javascript test runner in the ecosystem.\n\n#### Benchmark\n\nThis repository includes a benchmark which consists on running N test files, with M tests in each and where one test lasts T milliseconds.\nAbout 5% of tests should fail.\n\n1. profile library: N = 5, M = 8, T = 25ms\n2. profile web app: N = 10, M = 8, T = 40ms\n3. profile api: N =12, M = 10, T = 100ms\n\nEach framework runs with its default settings.\n\nHere are the result of different test frameworks on my developer machine (MacBook Pro, 2.7GH i5) with node 12 :\n\n| | zora@3.1.8 | pta@0.1.3 | tape@4.13.0 | Jest@25.1.0 | AvA@3.0.0 | Mocha@7.0.0|\n|--------|:------------:|:------------:|:------------:|:-------------:|:------------:|:----------:|\n|Library | 109ms | 225ms | 1236ms | 2636ms | 1311ms | 1427ms |\n|Web app | 130ms | 261ms | 3602ms | 5595ms | 2034ms | 3716ms |\n|API | 212ms | 329ms | 12569ms | 6606ms | 2496ms | 12764ms |\n\nOf course as any benchmark, it may not cover your use case and you should probably run your own tests before you draw any conclusion.\n\n### Focus on tests only\n\nzora does one thing but hopefully does it well: **test**.\n\nIn my opinions:\n1. Pretty reporting (I have not said *efficient reporting*) should be handled by a specific tool.\n2. Transpilation and other code transformation should be handled by a specific tool.\n3. File watching and caching should be handled by a specific tool.\n4. File serving should be handled by a specific tool.\n5. Coffee should be made by a specific tool.\n\nAs a result zora is much smaller of an install according to [packagephobia](https://packagephobia.now.sh) than all the others test frameworks\n\n| | zora | pta |tape | Jest | AvA | Mocha|\n|--------|:------------:|:------------:|:-----------:|:-------------:|:------------:|:------------:|\n|Install size | [![zora](https://packagephobia.now.sh/badge?p=zora)](https://packagephobia.now.sh/result?p=zora) | [![pta](https://packagephobia.now.sh/badge?p=pta)](https://packagephobia.now.sh/result?p=pta) | [![tape](https://packagephobia.now.sh/badge?p=tape)](https://packagephobia.now.sh/result?p=tape) | [![jes](https://packagephobia.now.sh/badge?p=jest)](https://packagephobia.now.sh/result?p=jest) | [![ava](https://packagephobia.now.sh/badge?p=ava)](https://packagephobia.now.sh/result?p=ava) | [![mocha](https://packagephobia.now.sh/badge?p=mocha)](https://packagephobia.now.sh/result?p=mocha) |\n\n### Reporting is handled with another process (TAP aware)\n\nWhen you run a test you usually want to know whether there is any failure, where and why in order to debug and solve the issue as fast as possible.\nWhether you want it to be printed in red, yellow etc is a matter of preference.\n\nFor this reason, zora output [TAP](http://testanything.org/) (Test Anything Protocol) by default. This protocol is \"machine friendly\" and widely used: [there are plenty of tools](https://github.com/sindresorhus/awesome-tap) to parse and deal with it the way **you** want.\n\n## Usage\n\n### Basics\n\nYou can use the top level assertion methods\n\n```Javascript\nimport {equal, ok, isNot} from 'zora';\n\nok(true,'true is truthy');\n\nequal('bar','bar', 'that both string are equivalent');\n\nisNot({},{},'those are not the same reference');\n\n//etc\n```\n\nIf you run the previous program, test report will start on its own by default with the following console output:\n\n
\n output.txt\n\n```TAP\nTAP version 13\nok 1 - true is truthy\nok 2 - that both string are equivalent\nok 3 - those are not the same reference\n1..3\n\n# ok\n# success: 3\n# skipped: 0\n# failure: 0\n```\n\n
\n\nHowever one will usually want to group assertions within a sub test: the ``test`` method can be used.\n\n```Javascript\nimport {test} from 'zora';\n\ntest('some grouped assertions', t => {\n t.ok(true, 'true is truthy');\n t.equal('bar', 'bar', 'that both string are equivalent');\n t.isNot({}, {}, 'those are not the same reference');\n});\n```\n\nwith the following result\n\n
\n output.txt\n\n```TAP\nTAP version 13\n# some grouped assertions\nok 1 - true is truthy\nok 2 - that both string are equivalent\nok 3 - those are not the same reference\n1..3\n\n# ok\n# success: 3\n# skipped: 0\n# failure: 0\n```\n\n
\n\nYou can also group tests within a parent test:\n\n```Javascript\nimport {test} from 'zora';\n\ntest('some grouped assertions', t => {\n t.ok(true, 'true is truthy');\n\n t.test('a group inside another one', t=>{\n t.equal('bar', 'bar', 'that both string are equivalent');\n t.isNot({}, {}, 'those are not the same reference');\n });\n});\n```\n
\n output.txt\n \n```TAP\nTAP version 13\n# some grouped assertions\nok 1 - true is truthy\n# a group inside another one\nok 2 - that both string are equivalent\nok 3 - those are not the same reference\n1..3\n\n# ok\n# success: 3\n# skipped: 0\n# failure: 0\n```\n
\n\n### Asynchronous tests and control flow\n\nAsynchronous tests are simply handled with async function:\n\n```Javascript\ntest('with getUsers an asynchronous function returning a Promise',async t => {\n const users = await getUsers();\n t.eq(users.length, 2,'we should have 2 users');\n});\n```\n\nNotice that each test runs in its own micro task in parallel (for performance). It implies your tests should not depend on each other.\nIt is often a good practice!\nHowever, you'll be able to group your tests if you wish to conserve some state between them or wait one to finish before you start another one (ideal with tests running against real database).\n\nThe sequence is simply controlled by AsyncFunction (and await keyboard), the ``test`` function return the result of its spec function argument, so you can control whether you want a specific test to complete before moving on\n\n```Javascript\nlet state = 0;\n\ntest('test 1', t => {\n t.ok(true);\n state++;\n});\n\ntest('test 2', t => {\n //Maybe yes maybe no, you have no guarantee ! In this case it will work as everything is sync\n t.equal(state, 1);\n});\n\n//Same thing here even in nested tests\ntest('grouped', t => {\n let state = 0;\n\n t.test('test 1', t => {\n t.ok(true);\n state++;\n });\n\n t.test('test 2', t => {\n //Maybe yes maybe no, you have no guarantee ! In this case it will work as everything is sync\n t.equal(state, 1);\n });\n});\n\n//And\ntest('grouped', t=>{\n let state = 0;\n\n t.test('test 1', async t=>{\n t.ok(true);\n await wait(100);\n state++;\n });\n\n test('test 2', t=>{\n t.equal(state, 0, 'see the old state value as it will have started to run before test 1 is done');\n });\n});\n\n//But\ntest('grouped', async t => {\n let state = 0;\n\n //specifically wait the end of this test before continuing !\n await t.test('test 1', async t => {\n t.ok(true);\n await wait(100);\n state++;\n });\n\n test('test 2', t => {\n t.equal(state, 1, 'see the updated value!');\n });\n});\n```\n\n### Changing TAP format\n\nTAP protocol is loosely defined in the sense that diagnostic is quite a free space and there is no well defined format to explicit a sub tests.\nIn Javascript community most of the TAP parsers and tools were designed for [tape](https://github.com/substack/tape) which implies a TAP comment for a sub test header and every assertion is on the same level.\nIn the same way these aforementioned tools expect diagnostics with a ``expected``, ``actual``, etc properties\nIt is the one we have used in our previous examples.\n\nIf you run the following program\n```Javascript\nimport {test} from 'zora';\n\ntest('tester 1', t => {\n\n t.ok(true, 'assert1');\n\n t.test('some nested tester', t => {\n t.ok(true, 'nested 1');\n t.ok(true, 'nested 2');\n });\n\n t.test('some nested tester bis', t => {\n t.ok(true, 'nested 1');\n\n t.test('deeply nested', t => {\n t.ok(true, 'deeply nested really');\n t.ok(true, 'deeply nested again');\n });\n\n t.notOk(true, 'nested 2'); // This one will fail\n });\n\n t.ok(true, 'assert2');\n});\n\ntest('tester 2', t => {\n t.ok(true, 'assert3');\n\n t.test('nested in two', t => {\n t.ok(true, 'still happy');\n });\n\n t.ok(true, 'assert4');\n});\n```\n
\n output.txt\n \n```TAP\nTAP version 13\n# tester 1\nok 1 - assert1\n# some nested tester\nok 2 - nested 1\nok 3 - nested 2\n# some nested tester bis\nok 4 - nested 1\n# deeply nested\nok 5 - deeply nested really\nok 6 - deeply nested again\nnot ok 7 - nested 2\n ---\n actual: true\n expected: \"falsy value\"\n operator: \"notOk\"\n at: \" t.test.t (/Volumes/Data/code/zora/test/samples/cases/nested.js:20:11)\"\n ...\nok 8 - assert2\n# tester 2\nok 9 - assert3\n# nested in two\nok 10 - still happy\nok 11 - assert4\n1..11\n\n# not ok\n# success: 10\n# skipped: 0\n# failure: 1\n```\n\n
\n\nAnother common structure is the one used by [node-tap](http://node-tap.org/). The structure can be parsed with common tap parser (such as [tap-parser](https://github.com/tapjs/tap-parser)) And will be parsed as well by tap parser which\ndo not understand the indentation. However to take full advantage of the structure you should probably use a formatter (such [tap-mocha-reporter](https://www.npmjs.com/package/tap-mocha-reporter)) aware of this specific structure to get the whole benefit\nof the format.\n\n![tap output in a BDD format](./media/bsd.png)\n\nYou can ask zora to indent sub tests with configuration flag: \n1. setting node environment variable ``INDENT=true node ./path/to/test/program`` if you run the test program with node\n2. setting a global variable on the window object if you use the browser to run the test program \n```markup\n\n\n```\n\n```Javascript\nconst {test} = require('zora.js');\n\ntest('tester 1', t => {\n\n t.ok(true, 'assert1');\n\n t.test('some nested tester', t => {\n t.ok(true, 'nested 1');\n t.ok(true, 'nested 2');\n });\n\n t.test('some nested tester bis', t => {\n t.ok(true, 'nested 1');\n\n t.test('deeply nested', t => {\n t.ok(true, 'deeply nested really');\n t.ok(true, 'deeply nested again');\n });\n\n t.notOk(true, 'nested 2'); // This one will fail\n });\n\n t.ok(true, 'assert2');\n});\n\ntest('tester 2', t => {\n t.ok(true, 'assert3');\n\n t.test('nested in two', t => {\n t.ok(true, 'still happy');\n });\n\n t.ok(true, 'assert4');\n});\n```\n\n
\n output.txt\n\n```TAP\nTAP version 13\n# Subtest: tester 1\n ok 1 - assert1\n # Subtest: some nested tester\n ok 1 - nested 1\n ok 2 - nested 2\n 1..2\n ok 2 - some nested tester # 1ms\n # Subtest: some nested tester bis\n ok 1 - nested 1\n # Subtest: deeply nested\n ok 1 - deeply nested really\n ok 2 - deeply nested again\n 1..2\n ok 2 - deeply nested # 1ms\n not ok 3 - nested 2\n ---\n wanted: \"falsy value\"\n found: true\n at: \" t.test.t (/Volumes/Data/code/zora/test/samples/cases/nested.js:22:11)\"\n operator: \"notOk\"\n ...\n 1..3\n not ok 3 - some nested tester bis # 1ms\n ok 4 - assert2\n 1..4\nnot ok 1 - tester 1 # 1ms\n# Subtest: tester 2\n ok 1 - assert3\n # Subtest: nested in two\n ok 1 - still happy\n 1..1\n ok 2 - nested in two # 0ms\n ok 3 - assert4\n 1..3\nok 2 - tester 2 # 0ms\n1..2\n\n# not ok\n# success: 10\n# skipped: 0\n# failure: 1\n```\n\n
\n\n### Skip a test\n\nYou can decide to skip some tests if you wish not to run them, in that case they will be considered as _passing_. However the assertion summary at the end will tell you that some tests have been skipped\nand each skipped test will have a tap skip directive.\n\n```Javascript\nimport {ok, skip, test} from 'zora';\n\nok(true, 'hey hey');\nok(true, 'hey hey bis');\n\ntest('hello world', t => {\n t.ok(true);\n t.skip('blah', t => {\n t.ok(false);\n });\n t.skip('for some reason');\n});\n\nskip('failing text', t => {\n t.ok(false);\n});\n```\n\n
\n output.txt\n\n```TAP\nTAP version 13\nok 1 - hey hey\nok 2 - hey hey bis\n# hello world\nok 3 - should be truthy\n# blah\nok 4 - blah # SKIP\n# for some reason\nok 5 - for some reason # SKIP\n# failing text\nok 6 - failing text # SKIP\n1..6\n\n# ok\n# success: 3\n# skipped: 3\n# failure: 0\n```\n\n
\n\n### Run only some tests\n\nWhile developing, you may want to only run some tests. You can do so by using the ``only`` function. If the test you want to run has\nsome sub tests, you will also have to call ``assertion.only`` to make a given sub test run.\nYou will also have to set the ``RUN_ONLY`` flag to ``true`` (in the same way as ``INDENT``). ``only`` is a convenience \nfor a developer while working, it has not real meaning for the testing program, so if you use only in the testing program and run it without the RUN_ONLY mode, it will bailout.\n\n```javascript\ntest('should not run', t => {\n t.fail('I should not run ');\n});\n\nonly('should run', t => {\n t.ok(true, 'I ran');\n\n t.only('keep running', t => {\n t.only('keeeeeep running', t => {\n t.ok(true, ' I got there');\n });\n });\n\n t.test('should not run', t => {\n t.fail('shouldn ot run');\n });\n});\n\nonly('should run but nothing inside', t => {\n t.test('will not run', t => {\n t.fail('should not run');\n });\n t.test('will not run', t => {\n t.fail('should not run');\n });\n});\n```\n\nIf you run the following program with node ``RUN_ONLY node ./path/to/program.js``, you will get the following output:\n\n
\n output.txt\n \n```tap\nTAP version 13\n# should not run\nok 1 - should not run # SKIP\n# should run\nok 2 - I ran\n# keep running\n# keeeeeep running\nok 3 - I got there\n# should not run\nok 4 - should not run # SKIP\n# should run but nothing inside\n# will not run\nok 5 - will not run # SKIP\n# will not run\nok 6 - will not run # SKIP\n1..6\n\n# ok\n# success: 2\n# skipped: 4\n# failure: 0\n```\n\n
\n\n\n### Assertion API\n\n- equal(actual: T, expected: T, message?: string) verify if two values/instances are equivalent. It is often described as *deepEqual* in assertion libraries.\naliases: eq, equals, deepEqual\n- notEqual(actual: T, expected: T, message?: string) opposite of equal.\naliases: notEquals, notEq, notDeepEqual\n- is(actual: T, expected: T, message ?: string) verify whether two instances are the same (basically it is Object.is)\naliases: same\n- isNot(actual: T, expected: T, message ?: string)\naliases: notSame\n- ok(actual: T, message?: string) verify whether a value is truthy\naliases: truthy\n- notOk(actual: T, message?:string) verify whether a value is falsy\naliases: falsy\n- fail(message?:string) an always failing test, usually when you want a branch of code not to be traversed\n- throws(fn: Function, expected?: string | RegExp | Function, description ?: string) expect an error to be thrown, you check the expected error by Regexp, Constructor or name\n- doesNotThrow(fn: Function, expected?: string | RegExp | Function, description ?: string) expect an error not to be thrown, you check the expected error by Regexp, Constructor or name\n\n### Create manually a test harness\n\nYou can discard the default test harness and create your own. This has various effects:\n- the reporting won't start automatically, you will have to trigger it yourself but it also lets you know when the reporting is over\n- you can pass a custom reporter. Zora produces a stream of messages which are then transformed into a TAP stream. If you create the test harness yourself\nyou can directly pass your custom reporter to transform the raw messages stream.\n\n```Javascript\nconst {createHarness} = require('zora');\nconst {indentedTapReporter} = require('zora-tap-reporter');\n\nconst harness = createHarness();\nconst {test} = harness;\n\ntest('a first sub test', t => {\n t.ok(true);\n\n t.test('inside', t => {\n t.ok(true);\n });\n});\n\ntest('a first sub test', t => {\n t.ok(true);\n\n t.test('inside', t => {\n t.ok(false, 'oh no!');\n });\n});\n\nharness\n .report(indentedTapReporter())\n .then(() => {\n // reporting is over: we can release some pending resources\n console.log('DONE !');\n // or in this case, our test program is for node so we want to set the exit code ourselves in case of failing test.\n const exitCode = harness.pass === true ? 0 : 1;\n process.exit(exitCode);\n });\n```\n\nIn practice you won't use this method unless you have specific requirements or want to build your own test runner on top of zora.\n\n## Nodejs test runner\n\nIf you want a little bit more opiniated test runner based on zora you can check [pta](https://github.com/lorenzofox3/zora-node)\n\n## In the browser\n\nZora itself does not depend on native Nodejs modules (such file system, processes, etc) so the code you will get is regular EcmaScript.\n\n### drop in file\nYou can simply drop the dist file in the browser and write your script below (or load it).\nYou can for example play with this [codepen](https://codepen.io/lorenzofox3/pen/YBWJrJ)\n\n```Html\n\n\n\n\n\n```\n\n### Test runners\n\nThere are few test runners which allow you to run testing programs in a browser environment (not emulated with JSDOM).\n* [playwright-test](https://karma-runner.github.io/4.0/index.html)\n* [Karma](https://karma-runner.github.io/4.0/index.html)\n* [zora-dev-server](https://github.com/lorenzofox3/zora-dev-server) - work in progress\n\n### As part of CI (example with rollup)\n\nI will use [rollup](http://rollupjs.org/) for this example, but you should not have any problem with [webpack](https://webpack.github.io/) or [browserify](http://browserify.org/). The idea is simply to create a test file your testing browsers will be able to run.\n\nassuming you have your entry point as follow :\n```Javascript\n//./test/index.js\nimport test1 from './test1.js'; // some tests here\nimport test2 from './test2.js'; // some more tests there\nimport test3 from './test3.js'; // another test plan\n```\n\nwhere for example ./test/test1.js is\n```Javascript\nimport test from 'zora';\n\ntest('mytest', (assertions) => {\n assertions.ok(true);\n})\n\ntest('mytest', (assertions) => {\n assertions.ok(true);\n});\n```\nyou can then bundle your test as single program.\n\n```Javascript\nconst node = require('rollup-plugin-node-resolve');\nconst commonjs = require('rollup-plugin-commonjs');\nmodule.exports = {\n input: './test/index.js',\n output: [{\n name: 'test',\n format: 'iife',\n sourcemap: 'inline' // ideal to debug\n }],\n plugins: [node(), commonjs()], //you can add babel plugin if you need transpilation\n};\n```\n\nYou can now drop the result into a debug file\n``rollup -c path/to/conf > debug.js``\n\nAnd read with your browser (from an html document for example).\n\n![tap output in the browser console](./media/console-sc.png)\n\nEven better, you can use tap reporter browser friendly such [tape-run](https://www.npmjs.com/package/tape-run) so you'll have a proper exit code depending on the result of your tests.\n\nso all together, in your package.json you can have something like that\n```Javascript\n{\n// ...\n \"scripts\": {\n \"test:ci\": \"rollup -c path/to/conf | tape-run\"\n }\n// ...\n}\n```\n\n## On exit codes\n\nWhether you have failing tests or not, unless you have an unexpected error, the process will return an exit code 0: zora considers its duty is to run the program to its end whether there is failing test or no.\nOften CI platforms require an exit code of 1 to mark a build as failed. That is not an issue, there are plenty of TAP reporters which when parsing a TAP stream will exit the process with code 1 if they encounter a failing test.\nHence you'll need to pipe zora output into one of those reporters to avoid false positive on your CI platform.\n\nFor example, one of package.json script can be\n``\"test:ci\": npm test | tap-set-exit``\n\n## Contributing\n\n1. Clone the repository with git ``git https://github.com/lorenzofox3/zora.git`` (or from Github/Gitlab UI)\n2. install dependencies ``npm i``\n3. build the source files ``npm run build``. Alternatively, if you are under \"heavy\" development you can run ``npm run dev`` it will build source files on every change\n4. run the tests ``npm t``\n"} +{"text": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distribution,\n# visible at http://tip.golang.org/AUTHORS.\n"} +{"text": "//\n// GCControllerButtonInput.h\n// GameController\n//\n// Copyright (c) 2012 Apple Inc. All rights reserved.\n//\n\n#import \n\n#import \n\nNS_ASSUME_NONNULL_BEGIN\n\nGAMECONTROLLER_EXPORT\n@interface GCControllerButtonInput : GCControllerElement\n\n/**\n Set this block if you want to be notified when the value on this button changes.\n \n @param button the element that has been modified.\n @param value the value the button was set to at the time the valueChangedHandler fired.\n @param pressed the pressed state of the button at the time the valueChangedHandler fired.\n @see value\n @see pressed\n */\ntypedef void (^GCControllerButtonValueChangedHandler)(GCControllerButtonInput *button, float value, BOOL pressed);\n@property (nonatomic, copy, nullable) GCControllerButtonValueChangedHandler valueChangedHandler;\n\n/**\n Set this block if you want to be notified when only the pressed state on this button changes. This\n will get called less often than the valueChangedHandler with the additional feature of the pressed state\n being different to the last time it was called.\n */\n@property (nonatomic, copy, nullable) GCControllerButtonValueChangedHandler pressedChangedHandler API_AVAILABLE(macos(10.10), ios(8.0), tvos(8.0));\n\n/**\n A normalized value for the input. Between 0 and 1 for button inputs. Values are saturated and thus never exceed the range of [0, 1].\n @see valueChangedHandler\n @see pressed\n */\n@property (nonatomic, readonly) float value;\n\n/**\n Buttons are mostly used in a digital sense, thus we have a recommended method for checking for pressed state instead of\n interpreting the value.\n \n As a general guideline a button is pressed if the value exceeds 0. However there may be hysterisis applied\n to counter noisy input values, thus incidental values around the threshold value may not trigger a change\n in pressed state.\n @see pressedChangedHandler\n @see value\n */\n@property (nonatomic, readonly, getter = isPressed) BOOL pressed;\n\n/**\n Sets the normalized value for the button input. Will update the pressed state of the button.\n\n @param value the value to set the input to.\n @note If the controller's snapshot flag is set to NO, this method has no effect.\n @see value\n */\n- (void)setValue:(float)value;\n\n@end\n\nNS_ASSUME_NONNULL_END\n\n"} +{"text": "\n\n\n\n\n\nUses of Class com.ctc.wstx.sr.CompactNsContext (Woodstox 6.2.0 API)\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
com.ctc.wstx.sr.CompactNsContext

\n
\n
No usage of com.ctc.wstx.sr.CompactNsContext
\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

Copyright © 2020 FasterXML. All rights reserved.

\n\n\n"} +{"text": "package defs\n\nimport (\n\t\"go/ast\"\n\t\"go/types\"\n\t\"strings\"\n\n\t\"github.com/matthewmueller/joy/internal/paths\"\n\t\"github.com/pkg/errors\"\n\n\t\"golang.org/x/tools/go/loader\"\n\n\t\"github.com/matthewmueller/joy/internal/compiler/def\"\n\t\"github.com/matthewmueller/joy/internal/compiler/index\"\n\t\"github.com/matthewmueller/joy/internal/compiler/util\"\n)\n\n// Functioner interface\ntype Functioner interface {\n\tdef.Definition\n\tIsAsync() (bool, error)\n\tIsVariadic() bool\n\tNode() *ast.FuncDecl\n\tRewrite() def.Rewrite\n\tParams() []string\n\tResults() []def.FunctionResult\n}\n\nvar _ Functioner = (*functions)(nil)\n\ntype functions struct {\n\tinfo *loader.PackageInfo\n\tindex *index.Index\n\tid string\n\tpath string\n\tname string\n\tkind types.Type\n\tnode *ast.FuncDecl\n\texported bool\n\ttag util.JSTag\n\truntime bool\n\tprocessed bool\n\tdeps []def.Definition\n\trewrite def.Rewrite\n\tresults []def.FunctionResult\n\tasync bool\n\timports map[string]string\n\tomit bool\n\tparams []string\n\tvariadic bool\n\trename string\n}\n\ntype result struct {\n\tname string\n\tdef def.Definition\n}\n\nfunc (r *result) Name() string {\n\treturn r.name\n}\n\nfunc (r *result) Definition() def.Definition {\n\treturn r.def\n}\n\n// Function fn\nfunc Function(index *index.Index, info *loader.PackageInfo, n *ast.FuncDecl) (def.Definition, error) {\n\tobj := info.ObjectOf(n.Name)\n\tpackagePath := obj.Pkg().Path()\n\tname := n.Name.Name\n\tidParts := []string{packagePath, name}\n\tid := strings.Join(idParts, \" \")\n\n\t// TODO: scoping\n\t// scope := info.Scopes[n.Type]\n\n\tvar params []string\n\tvar variadic bool\n\tfor _, param := range n.Type.Params.List {\n\t\tfor _, ident := range param.Names {\n\t\t\tparams = append(params, ident.Name)\n\t\t}\n\t\tif _, ok := param.Type.(*ast.Ellipsis); ok {\n\t\t\tvariadic = true\n\t\t}\n\t}\n\n\tvar results []def.FunctionResult\n\tif n.Type.Results != nil {\n\t\tfor _, r := range n.Type.Results.List {\n\t\t\tdef, err := index.DefinitionOf(packagePath, r.Type)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif len(r.Names) == 0 {\n\t\t\t\tresults = append(results, &result{\n\t\t\t\t\tdef: def,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tfor _, id := range r.Names {\n\t\t\t\tresults = append(results, &result{\n\t\t\t\t\tname: id.Name,\n\t\t\t\t\tdef: def,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t// if it's a method don't export,\n\t// if it's the main() function\n\t// export either way\n\texported := obj.Exported()\n\tif n.Recv != nil {\n\t\texported = false\n\t} else if name == \"main\" {\n\t\texported = true\n\t}\n\n\ttag, e := util.JSTagFromComment(n.Doc)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\truntimePath, err := paths.Runtime()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error getting runtime path\")\n\t}\n\tfromRuntime := strings.HasSuffix(runtimePath, packagePath)\n\n\treturn &functions{\n\t\tindex: index,\n\t\tinfo: info,\n\t\tid: id,\n\t\texported: exported,\n\t\tpath: packagePath,\n\t\truntime: fromRuntime,\n\t\tname: name,\n\t\tnode: n,\n\t\tkind: info.TypeOf(n.Name),\n\t\timports: map[string]string{},\n\t\tparams: params,\n\t\tresults: results,\n\t\tvariadic: variadic,\n\t\ttag: tag,\n\t}, nil\n}\n\nfunc (d *functions) process() (err error) {\n\tstate, e := process(d.index, d, d.node)\n\tif e != nil {\n\t\treturn e\n\t}\n\n\t// copy state into function\n\td.processed = true\n\td.async = state.async\n\td.deps = state.deps\n\td.imports = state.imports\n\td.omit = state.omit\n\td.rewrite = state.rewrite\n\td.rename = state.rename\n\n\tif d.tag.Rename == \"\" {\n\t\td.tag = state.tag\n\t}\n\n\treturn nil\n}\n\nfunc (d *functions) ID() string {\n\treturn d.id\n}\n\nfunc (d *functions) Name() string {\n\tif d.tag.Rename != \"\" {\n\t\treturn d.tag.Rename\n\t}\n\tif d.rename != \"\" {\n\t\treturn d.rename\n\t}\n\treturn d.name\n}\n\nfunc (d *functions) OriginalName() string {\n\treturn d.name\n}\n\nfunc (d *functions) Path() string {\n\treturn d.path\n}\n\nfunc (d *functions) Dependencies() (deps []def.Definition, err error) {\n\tif d.processed {\n\t\treturn d.deps, nil\n\t}\n\te := d.process()\n\tif e != nil {\n\t\treturn deps, e\n\t}\n\n\treturn d.deps, nil\n}\n\nfunc (d *functions) Exported() bool {\n\treturn d.exported\n}\n\nfunc (d *functions) Omitted() bool {\n\tif d.tag.Omit {\n\t\treturn true\n\t}\n\treturn d.omit\n}\n\nfunc (d *functions) Node() *ast.FuncDecl {\n\treturn d.node\n}\n\nfunc (d *functions) Type() types.Type {\n\treturn d.kind\n}\n\nfunc (d *functions) Kind() string {\n\treturn \"FUNCTION\"\n}\n\nfunc (d *functions) IsAsync() (bool, error) {\n\tif d.processed {\n\t\treturn d.async, nil\n\t}\n\te := d.process()\n\tif e != nil {\n\t\treturn false, e\n\t}\n\treturn d.async, nil\n}\n\n// Rewrite fn\nfunc (d *functions) Rewrite() def.Rewrite {\n\treturn d.rewrite\n}\n\n// Params fn\nfunc (d *functions) Params() []string {\n\treturn d.params\n}\n\nfunc (d *functions) Imports() map[string]string {\n\t// combine def imports with file imports\n\timports := map[string]string{}\n\tfor alias, path := range d.imports {\n\t\timports[alias] = path\n\t}\n\tfor alias, path := range d.index.GetImports(d.path) {\n\t\timports[alias] = path\n\t}\n\treturn imports\n}\n\nfunc (d *functions) FromRuntime() bool {\n\treturn d.runtime\n}\n\nfunc (d *functions) maybeAsync(def def.Definition) error {\n\tif d.async || d.ID() == def.ID() {\n\t\treturn nil\n\t}\n\n\tfn, ok := def.(Functioner)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\tasync, e := fn.IsAsync()\n\tif e != nil {\n\t\treturn e\n\t}\n\td.async = async\n\n\treturn nil\n}\n\nfunc (d *functions) IsVariadic() bool {\n\treturn d.variadic\n}\n\nfunc (d *functions) Results() []def.FunctionResult {\n\treturn d.results\n}\n"} +{"text": "Possible upgrades to gzfilebuf:\n\n- The ability to do putback (e.g. putbackfail)\n\n- The ability to seek (zlib supports this, but could be slow/tricky)\n\n- Simultaneous read/write access (does it make sense?)\n\n- Support for ios_base::ate open mode\n\n- Locale support?\n\n- Check public interface to see which calls give problems\n (due to dependence on library internals)\n\n- Override operator<<(ostream&, gzfilebuf*) to allow direct copying\n of stream buffer to stream ( i.e. os << is.rdbuf(); )\n"} +{"text": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.7 on 2018-07-01 00:49\nfrom __future__ import unicode_literals\n\nimport datetime\nfrom django.conf import settings\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n initial = True\n\n dependencies = [\n migrations.swappable_dependency(settings.AUTH_USER_MODEL),\n ]\n\n operations = [\n migrations.CreateModel(\n name='ActivityImagesModel',\n fields=[\n ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n ('image', models.ImageField(blank=True, null=True, upload_to='ActivityImagesModel/%y/%d/68725fe16db64938a3ae2b3275ad64a0', verbose_name='活动图片')),\n ('addtime', models.DateTimeField(default=datetime.datetime.now, verbose_name='上传时间')),\n ],\n options={\n 'verbose_name': '活动图片管理',\n 'verbose_name_plural': '活动图片管理',\n },\n ),\n migrations.CreateModel(\n name='ActivityModel',\n fields=[\n ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n ('cover_image', models.ImageField(blank=True, null=True, upload_to='Activity/%y/%d/68725fe16db64938a3ae2b3275ad64a0', verbose_name='封面图片')),\n ('title', models.CharField(max_length=50, verbose_name='活动标题')),\n ('content', models.TextField(max_length=500, verbose_name='活动内容')),\n ('startdate', models.DateTimeField(default=datetime.datetime.now, verbose_name='开始时间')),\n ('enddate', models.DateTimeField(default=datetime.datetime.now, verbose_name='结束时间')),\n ('address', models.CharField(max_length=255, verbose_name='活动地点')),\n ('limitnum', models.IntegerField(default=10, verbose_name='限制人数')),\n ('username', models.CharField(max_length=3, verbose_name='真实姓名')),\n ('wechat', models.CharField(max_length=20, verbose_name='微信号')),\n ('groupcode', models.ImageField(blank=True, null=True, upload_to='Activity/qr/%y/%d/68725fe16db64938a3ae2b3275ad64a0', verbose_name='群二维码')),\n ('istrue', models.BooleanField(default=False, verbose_name='是否同意协议')),\n ('thedraft', models.BooleanField(default=False, verbose_name='是否发布')),\n ],\n options={\n 'verbose_name': '发布活动管理',\n 'verbose_name_plural': '发布活动管理',\n },\n ),\n migrations.CreateModel(\n name='ActivityTypeModel',\n fields=[\n ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n ('name', models.CharField(max_length=50, verbose_name='类别名称')),\n ('Introduction', models.TextField(max_length=300, verbose_name='类别简介')),\n ('indexnum', models.IntegerField(default=0, verbose_name='排列顺序')),\n ('addtime', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),\n ],\n options={\n 'verbose_name': '活动类别管理',\n 'verbose_name_plural': '活动类别管理',\n },\n ),\n migrations.AddField(\n model_name='activitymodel',\n name='activitytype',\n field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activity.ActivityTypeModel', verbose_name='活动类别'),\n ),\n migrations.AddField(\n model_name='activitymodel',\n name='user',\n field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户'),\n ),\n migrations.AddField(\n model_name='activityimagesmodel',\n name='activity',\n field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activity.ActivityModel', verbose_name='活动'),\n ),\n ]\n"} +{"text": "# coding=utf-8\n# Copyright 2020 The Edward2 Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Edward2 probabilistic programming language with NumPy backend.\"\"\"\n\nfrom edward2.numpy import generated_random_variables\nfrom edward2.numpy.generated_random_variables import * # pylint: disable=wildcard-import\nfrom edward2.numpy.program_transformations import make_log_joint_fn\nfrom edward2.trace import get_next_tracer\nfrom edward2.trace import trace\nfrom edward2.trace import traceable\nfrom edward2.tracers import condition\nfrom edward2.tracers import tape\nfrom edward2.version import __version__\nfrom edward2.version import VERSION\n\nimport scipy\n\n__all__ = [\n \"condition\",\n \"get_next_tracer\",\n \"make_log_joint_fn\",\n \"tape\",\n \"trace\",\n \"traceable\",\n \"__version__\",\n \"VERSION\",\n]\nfor name in dir(generated_random_variables):\n if name in sorted(dir(scipy.stats)):\n __all__.append(name)\n"} +{"text": "# /* Copyright (C) 2001\n# * Housemarque Oy\n# * http://www.housemarque.com\n# *\n# * Distributed under the Boost Software License, Version 1.0. (See\n# * accompanying file LICENSE_1_0.txt or copy at\n# * http://www.boost.org/LICENSE_1_0.txt)\n# */\n#\n# /* Revised by Paul Mensonides (2002) */\n#\n# /* See http://www.boost.org for most recent version. */\n#\n# ifndef BOOST_PREPROCESSOR_LOGICAL_AND_HPP\n# define BOOST_PREPROCESSOR_LOGICAL_AND_HPP\n#\n# include \n# include \n# include \n#\n# /* BOOST_PP_AND */\n#\n# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()\n# define BOOST_PP_AND(p, q) BOOST_PP_BITAND(BOOST_PP_BOOL(p), BOOST_PP_BOOL(q))\n# else\n# define BOOST_PP_AND(p, q) BOOST_PP_AND_I(p, q)\n# define BOOST_PP_AND_I(p, q) BOOST_PP_BITAND(BOOST_PP_BOOL(p), BOOST_PP_BOOL(q))\n# endif\n#\n# endif\n"} +{"text": "//\n//\tindex.js for bitlash terminal shell server, suitable for Heroku deployment\n//\n//\tCopyright 2012 Bill Roy (MIT License)\n//\nvar opt = require('optimist');\nvar argv = opt.usage('Usage: $0 [flags]')\n\t.alias('p', 'port')\n\t.describe('p', 'http port (default 8080)')\n\t.argv;\n\nif (argv.help) {\n\topt.showHelp();\n\tprocess.exit();\n}\n\nvar port;\nif (process && process.env && process.env.PORT) port = process.env.PORT;\nelse port = argv.port || 8080;\n\nvar config = {\n\t'users': {\n\t\t'bitlash':'open sesame'\n\t},\n\t// 'hostname': '0.0.0.0',\t\t// to serve on all ports instead of just localhost\n\t'https': {\n\t\t'key': null,\n\t\t'cert': null\n\t},\n\t'port': port,\n\t'shell': 'src/bin/bitlash-linux-32-heroku',\n\t//'shellArgs': shellargs,\n\t//'limitGlobal': 1,\n\t//'limitPerUser': 1,\n\t'term': {}\n};\n\nvar tty = require('tty.js');\nvar app = tty.createServer(config);\napp.listen();\n\nmodule.exports = app;\n"} +{"text": "/*\n-----------------------------------------------------------------------------\nThis source file is part of OGRE\n (Object-oriented Graphics Rendering Engine)\nFor the latest info, see http://www.ogre3d.org/\n\nCopyright (c) 2000-2014 Torus Knot Software Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n-----------------------------------------------------------------------------\n*/\n#ifndef __Viewport_H__\n#define __Viewport_H__\n\n#include \"OgrePrerequisites.h\"\n#include \"OgreCommon.h\"\n#include \"OgreFrustum.h\"\n#include \"OgreHeaderPrefix.h\"\n\nnamespace Ogre {\n /** \\addtogroup Core\n * @{\n */\n /** \\addtogroup RenderSystem\n * @{\n */\n\n /** An abstraction of a viewport, i.e. a rendering region on a render\n target.\n @remarks\n A viewport is the meeting of a camera and a rendering surface -\n the camera renders the scene from a viewpoint, and places its\n results into some subset of a rendering target, which may be the\n whole surface or just a part of the surface. Each viewport has a\n single camera as source and a single target as destination. A\n camera only has 1 viewport, but a render target may have several.\n A viewport also has a Z-order, i.e. if there is more than one\n viewport on a single render target and they overlap, one must\n obscure the other in some predetermined way.\n */\n class _OgreExport Viewport : public ViewportAlloc\n {\n public:\n /// @copydoc MovableObject::mGlobalIndex\n size_t mGlobalIndex;\n\n /** The usual constructor.\n @param camera\n Pointer to a camera to be the source for the image.\n @param target\n Pointer to the render target to be the destination\n for the rendering.\n @param left, top, width, height\n Dimensions of the viewport, expressed as a value between\n 0 and 1. This allows the dimensions to apply irrespective of\n changes in the target's size: e.g. to fill the whole area,\n values of 0,0,1,1 are appropriate.\n @param ZOrder\n Relative Z-order on the target. Lower = further to\n the front.\n */\n Viewport(\n Real left, Real top,\n Real width, Real height );\n Viewport();\n\n /** Default destructor.\n */\n virtual ~Viewport();\n\n /** Notifies the viewport of a possible change in dimensions.\n @remarks\n Used by the target to update the viewport's dimensions\n (usually the result of a change in target size).\n @note\n Internal use by Ogre only.\n */\n void _updateDimensions(void);\n\n /** Instructs the viewport to updates its contents.\n */\n void _updateCullPhase01( Camera* renderCamera, Camera *cullCamera, const Camera *lodCamera,\n uint8 firstRq, uint8 lastRq, bool reuseCullData );\n void _updateRenderPhase02( Camera* camera, const Camera *lodCamera,\n uint8 firstRq, uint8 lastRq );\n\n /** Gets one of the relative dimensions of the viewport,\n a value between 0.0 and 1.0.\n */\n Real getLeft(void) const;\n\n /** Gets one of the relative dimensions of the viewport, a value\n between 0.0 and 1.0.\n */\n Real getTop(void) const;\n\n /** Gets one of the relative dimensions of the viewport, a value\n between 0.0 and 1.0.\n */\n\n Real getWidth(void) const;\n /** Gets one of the relative dimensions of the viewport, a value\n between 0.0 and 1.0.\n */\n\n Real getHeight(void) const;\n /** Gets one of the actual dimensions of the viewport, a value in\n pixels.\n */\n\n int getActualLeft(void) const;\n /** Gets one of the actual dimensions of the viewport, a value in\n pixels.\n */\n\n int getActualTop(void) const;\n /** Gets one of the actual dimensions of the viewport, a value in\n pixels.\n */\n int getActualWidth(void) const;\n /** Gets one of the actual dimensions of the viewport, a value in\n pixels.\n */\n int getActualHeight(void) const;\n\n Real getScissorLeft(void) const { return mScissorRelLeft; }\n Real getScissorTop(void) const { return mScissorRelTop; }\n Real getScissorWidth(void) const { return mScissorRelWidth; }\n Real getScissorHeight(void) const { return mScissorRelHeight; }\n\n int getScissorActualLeft(void) const { return mScissorActLeft; }\n int getScissorActualTop(void) const { return mScissorActTop; }\n int getScissorActualWidth(void) const { return mScissorActWidth; }\n int getScissorActualHeight(void) const { return mScissorActHeight; }\n\n bool coversEntireTarget(void) const;\n bool scissorsMatchViewport(void) const;\n\n /** Sets the dimensions (after creation).\n @param left\n Left point of viewport.\n @param top\n Top point of the viewport.\n @param width\n Width of the viewport.\n @param height\n Height of the viewport.\n @param overrideScissors\n When true, the scissor dimensions will be the same as the viewport's\n @See setScissors\n @note\n Dimensions relative to the size of the target, represented as real values\n between 0 and 1. i.e. the full target area is 0, 0, 1, 1.\n */\n void setDimensions( TextureGpu *newTarget, const Vector4 &relativeVp,\n const Vector4 &scissors, uint8 mipLevel );\n\n TextureGpu* getCurrentTarget(void) const { return mCurrentTarget; }\n\n /** Only sets the scissor regions. The scissor rectangle must be fully inside\n the viewport rectangle. @See setDimensions for param description\n @remarks\n Only the scissor rect is set here; but the HLMS macroblock controls whether\n scissor testing is enabled or not (@See HlmsMacroblock). On some RenderSystem\n implementations (i.e. OpenGL), scissor testing needs to be enabled when\n clearing a region of the screen. In those cases, if scissor testing is disabled at\n the time of the clear, scissor testing will be temporarily enabled and then disabled.\n */\n void setScissors( Real left, Real top, Real width, Real height );\n\n /** Set the material scheme which the viewport should use.\n @remarks\n This allows you to tell the system to use a particular\n material scheme when rendering this viewport, which can \n involve using different techniques to render your materials.\n @see Technique::setSchemeName\n */\n void setMaterialScheme(const String& schemeName)\n { mMaterialSchemeName = schemeName; }\n \n /** Get the material scheme which the viewport should use.\n */\n const String& getMaterialScheme(void) const\n { return mMaterialSchemeName; }\n\n /** Access to actual dimensions (based on target size).\n */\n void getActualDimensions(\n int &left, int &top, int &width, int &height ) const;\n\n bool _isUpdated(void) const;\n void _clearUpdatedFlag(void);\n\n /** Tells this viewport whether it should display Overlay objects.\n @remarks\n Overlay objects are layers which appear on top of the scene. They are created via\n SceneManager::createOverlay and every viewport displays these by default.\n However, you probably don't want this if you're using multiple viewports,\n because one of them is probably a picture-in-picture which is not supposed to\n have overlays of it's own. In this case you can turn off overlays on this viewport\n by calling this method.\n @param enabled If true, any overlays are displayed, if false they are not.\n */\n void setOverlaysEnabled(bool enabled);\n\n /** Returns whether or not Overlay objects (created in the SceneManager) are displayed in this\n viewport. */\n bool getOverlaysEnabled(void) const;\n\n /** Sets a per-viewport visibility mask.\n @remarks\n The visibility mask is a way to exclude objects from rendering for\n a given viewport. For each object in the frustum, a check is made\n between this mask and the objects visibility flags \n (@see MovableObject::setVisibilityFlags), and if a binary 'and'\n returns zero, the object will not be rendered.\n @par\n Viewport's visibility mask assumes the user knows what he's doing\n with the reserved flags!\n */\n void _setVisibilityMask( uint32 mask, uint32 lightMask );\n\n /** Gets a per-viewport visibility mask.\n @see Viewport::setVisibilityMask\n */\n uint32 getVisibilityMask(void) const { return mVisibilityMask; }\n uint32 getLightVisibilityMask(void) const { return mLightVisibilityMask; }\n\n /** Convert oriented input point coordinates to screen coordinates. */\n void pointOrientedToScreen(const Vector2 &v, int orientationMode, Vector2 &outv);\n void pointOrientedToScreen(Real orientedX, Real orientedY, int orientationMode,\n Real &screenX, Real &screenY);\n\n /** Sets the draw buffer type for the next frame.\n @remarks\n Specifies the particular buffer that will be\n targeted by the render target. Should be used if\n the render target supports quad buffer stereo. If\n the render target does not support stereo (ie. left\n and right), then only back and front will be used.\n @param\n buffer Specifies the particular buffer that will be\n targeted by the render target.\n */\n void setDrawBuffer(ColourBufferType colourBuffer);\n\n /** Returns the current colour buffer type for this viewport.*/\n ColourBufferType getDrawBuffer() const;\n\n protected:\n /// Relative dimensions, irrespective of target dimensions (0..1)\n float mRelLeft, mRelTop, mRelWidth, mRelHeight;\n /// Actual dimensions, based on target dimensions\n int mActLeft, mActTop, mActWidth, mActHeight;\n\n TextureGpu *mCurrentTarget;\n uint8 mCurrentMip;\n\n /// Relative dimensions, irrespective of target dimensions (0..1), scissor rect\n float mScissorRelLeft, mScissorRelTop, mScissorRelWidth, mScissorRelHeight;\n /// Actual dimensions, based on target dimensions, scissor rect\n int mScissorActLeft, mScissorActTop, mScissorActWidth, mScissorActHeight;\n bool mCoversEntireTarget;\n bool mScissorsMatchViewport;\n\n /// Z-order\n int mZOrder;\n /// Background options\n bool mUpdated;\n bool mShowOverlays;\n uint32 mVisibilityMask;\n uint32 mLightVisibilityMask;\n /// Material scheme\n String mMaterialSchemeName;\n ColourBufferType mColourBuffer;\n };\n /** @} */\n /** @} */\n\n}\n\n#include \"OgreHeaderSuffix.h\"\n\n#endif\n"} +{"text": "/*\n * incm - incorporating new mails\n *\n * Author: Yasunari Momoi \n * Created: 2000/10/19\n */\n\n#include \"mew.h\"\n\nprivate char version_message[] = \"version 6.8 20180607 Kazu Yamamoto\";\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#if TIME_WITH_SYS_TIME\n# include \n# include \n#else\n# if HAVE_SYS_TIME_H\n# include \n# else\n# include \n# endif\n#endif\n\n#if HAVE_DIRENT_H\n# include \n#endif\n\n#if HAVE_FCNTL_H\n# include \n#endif\n\n#if HAVE_PWD_H\n# include \n#endif\n\n#if HAVE_SYS_FILE_H\n# include \n#endif\n\n#if HAVE_UNISTD_H\n# include \n#endif\n\nenum MBOXTYPE {\n\tT_UNKNOWN,\n\tT_MAILDIR,\n\tT_MBOX,\n\tT_STDIN,\n};\n\nenum MBOXSTATE {\n\tST_UNKNOWN,\n\tST_HEADER,\n\tST_BODY_AFTER_EMPTY_LINE,\n\tST_BODY,\n};\n\n#define FBUFSIZ\t\t(BUFSIZ * 32)\n#ifndef PATH_MAX\n# define PATH_MAX\t1024\n#endif\n\nprivate char\tFileBuf[FBUFSIZ];\nprivate char\tMbox[PATH_MAX];\nprivate char\tMboxLock[PATH_MAX];\nprivate char\t*InboxDir = NULL;\nprivate char\t*Suffix = NULL;\nprivate int\tUse_Suffix = FALSE;\nprivate int\tSuffix_len;\nprivate int\tMboxType;\nprivate int\tBackup;\nprivate int\tGetCur;\nprivate int\tUseCL;\nprivate int\tPreserveUnixFrom;\nprivate int\tCreateMTime = TRUE;\nprivate int\tFileMode = S_IRUSR | S_IWUSR;\nprivate int\tExit = 0;\n\n/****************************************************************\n *\n * prototype\n *\n */\n\nprivate void\terror(const char *, ...);\nprivate void\tusage(const char *);\nprivate void\thelp(const char *);\nprivate void\tversion(const char *);\nprivate void\tinit_env(int, char **);\nprivate int\tget_number(char *);\nprivate int\tget_last_seq(void);\nprivate int\tcompare_string(char **, char **);\nprivate int\tcopyfile(char *, char *);\nprivate void\tmovefile(char *, char *, char *, int);\nprivate int\tmaildir_names(const char *, char **, char **, char **);\nprivate int\tnew_inbox_file(int, char[]);\nprivate FILE\t*open_new_inbox_file(int *, char[]);\nprivate int\tget_from_dir(int, char *, char *, int);\nprivate int\tprocess_maildir(int);\nprivate int\tlock_mbox(char *);\nprivate void\tunlock_mbox(char *);\nprivate int\tprocess_mbox(int);\nprivate int\tprocess_stdin(int);\nprivate void\tprocess(void);\nprivate int\tcheck_mbox_type(const char *);\nprivate void\tsanity_check(void);\n\n\n#if !HAVE_FLOCK\n# if HAVE_LOCKF\n# define flock(a, b)\tlockf(a, b, 0)\n# define LOCK_EX\tF_LOCK\n# endif\n#endif\n\n#ifndef S_ISDIR\n# define S_ISDIR(m)\t(((m) & S_IFMT) == S_IFDIR)\n#endif\n#ifndef S_ISREG\n# define S_ISREG(m)\t(((m) & S_IFMT) == S_IFREG)\n#endif\n\nprivate char *\nGetlogin(void)\n{\n#ifdef HAVE_GETLOGIN\n\t{\n\t\tchar *user;\n\t\tif ((user = getlogin()) != NULL)\n\t\t\treturn user;\n\t}\n#endif\n#ifdef HAVE_GETPWUID\n\t{\n\t\tstruct passwd *pw;\n\t\tif ((pw = getpwuid(getuid())) == NULL)\n\t\t\treturn NULL;\n\t\telse\n\t\t\treturn pw->pw_name;\n\t}\n#endif\n\treturn NULL;\n}\n\nprivate char *\nGethomedir(void)\n{\n\tchar *home;\n\n\tif ((home = getenv(\"HOME\")) != NULL)\n\t\treturn home;\n#ifdef HAVE_GETPWUID\n\t{\n\t\tstruct passwd *pw;\n\t\tif ((pw = getpwuid(getuid())) != NULL)\n\t\t\treturn pw->pw_dir;\n\t}\n#endif\n\treturn NULL;\n}\n\nprivate void\nerror(const char *fmt, ...)\n{\n\tva_list ap;\n\tif (warn_prog != NULL)\n\t\tfprintf(stderr, \"%s: \", warn_prog);\n\tva_start(ap, fmt);\n\tif (fmt != NULL)\n\t\tvfprintf(stderr, fmt, ap);\n\tva_end(ap);\n\tfprintf(stderr, \"\\n\");\n\tif (strlen(MboxLock) > 0)\n\t\tunlock_mbox(MboxLock);\n\texit(EXIT_FAILURE);\n}\n\n/****************************************************************\n * \n * options and usages\n *\n */\n\n\n#define LOCK_SUFFIX\t\".lock\"\n#define MAILDIR\t\t\"Maildir\"\n#define MAILDIR_NEW\t\"new\"\n#define MAILDIR_CUR\t\"cur\"\n#define MAILDIR_TMP\t\"tmp\"\n\nprivate void\nusage(const char *progname) {\n\tfprintf(stderr, \"Usage: %s [-abchosv] [-d maildir] [-i inboxdir] [-x suffix]\\n\", progname);\n}\n\nprivate const char *\nhelp_message[] = {\n\t\" -h Display this help message.\",\n\t\" -v Display the version.\",\n\t\" -d Path to mbox/maildir.\",\n\t\" -m Path to mbox/maildir.\",\n\t\" -s Read one mail from stdin instead of mbox/maildir.\",\n\t\" -i Path to inboxdir.\",\n\t\" -b Backup mail.\",\n\t\" mbox: No truncate mbox file.\",\n\t\" maildir: To maildir/cur directory.\",\n\t\" -a Retrieve all mail from maildir/{cur,new} directory.\",\n\t\" (no backup) (for maildir)\",\n\t\" -c Use Content-Length: field. (for mbox)\",\n\t\" -u Don't create inboxdir/.mew-mtime file.\",\n\t\" -f Preserve Unix From (Envelope Sender). (for mbox)\",\n\t\" -p Specify file permission. (for mbox)\",\n\t\" -o Use the suffix when creating messages.\",\n\t\" -x Use this suffix.\",\n\tNULL\n};\n\nprivate void\nhelp(const char *progname) {\n\tconst char **p = help_message;\n\n\tfprintf(stderr, \"Help: %s\\n\\n\", progname);\n\tfprintf(stderr, \" Incorporating new mails.\\n\\n\");\n\tusage(progname);\n\twhile (*p) fprintf(stderr, \"%s\\n\", *p++);\n}\n\nprivate void\nversion(const char *progname) {\n\tfprintf(stderr, \"%s %s\\n\", progname, version_message);\n}\n\nprivate int\ncheck_mbox_type(const char *path)\n{\n\tstruct stat sb;\n\n\tif (stat(path, &sb))\n\t\treturn T_UNKNOWN;\n\tif (S_ISDIR(sb.st_mode)) {\n\t\tchar* newdir;\n\t\tchar* curdir;\n\n\t\tif (maildir_names(path, &newdir, &curdir, NULL))\n\t\t\terror(\"maildir name is not set (%s)\", path);\n\t\tif (stat(newdir, &sb))\n\t\t\treturn T_UNKNOWN;\n\t\tif (!S_ISDIR(sb.st_mode) || access(newdir, R_OK|W_OK|X_OK))\n\t\t\treturn T_UNKNOWN;\n\n\t\tif (Backup) {\n\t\t\tif (stat(curdir, &sb))\n\t\t\t\treturn T_UNKNOWN;\n\t\t\tif (!S_ISDIR(sb.st_mode) || access(curdir, W_OK))\n\t\t\t\treturn T_UNKNOWN;\n\t\t}\n\t\treturn T_MAILDIR;\n\t}\n\telse if (S_ISREG(sb.st_mode))\n\t\treturn T_MBOX;\n\telse\n\t\treturn T_UNKNOWN;\n}\n\nprivate const char *\nmbox_path_list[] = {\n\t\"/var/mail/\",\n\t\"/var/spool/mail/\",\n\t\"/usr/spool/mail/\",\n\tNULL\n};\n\nprivate void\nsearch_mbox_path(void)\n{\n\tchar *home, *mail, *user;\n\n\tif ((home = Gethomedir()) != NULL) {\n\t\tif (strlen(home) + 9 > PATH_MAX)\n\t\t\terror(\"pathname too long (%s)\", home);\n\t\tsnprintf(Mbox, sizeof(Mbox), \"%s/%s\", home, MAILDIR);\n\t\tif (check_mbox_type(Mbox) != T_UNKNOWN)\n\t\t\treturn;\n\t}\n\tif ((mail = getenv(\"MAIL\")) != NULL) {\n\t\tif (strlen(mail) + 1 > PATH_MAX)\n\t\t\terror(\"pathname too long (%s)\", mail);\n\t\tSTRCPY(Mbox, mail);\n\t\tif (check_mbox_type(Mbox) != T_UNKNOWN)\n\t\t\treturn;\n\t}\n\tif ((user = Getlogin()) != NULL) {\n\t\tint i;\n\t\tfor (i = 0; mbox_path_list[i] != NULL; i++) {\n\t\t\tif (strlen(mbox_path_list[i]) + strlen(user) + 1\n\t\t\t > PATH_MAX)\n\t\t\t\terror(\"pathname too long (%s)\", user);\n\t\t\tsnprintf(Mbox, sizeof(Mbox), \"%s%s\", mbox_path_list[i], user);\n\t\t\tif (check_mbox_type(Mbox) != T_UNKNOWN)\n\t\t\t\treturn;\n\t\t}\n\t}\n\tsnprintf(Mbox, sizeof(Mbox), \".\");\n\treturn;\n}\n\nvoid\nsig_exit(int signo)\n{\n\tExit = 1;\n}\n\nvoid\nsig_ignore(int signo)\n{\n\t/* ignore signal */\n}\n\nprivate void\nset_sighandler(void)\n{\n#if HAVE_SIGHUP\n\tif (signal(SIGHUP, sig_ignore) == SIG_ERR)\n\t\terror(\"can't catch SIGHUP\\n\");\n#endif\n\tif (signal(SIGINT, sig_exit) == SIG_ERR)\n\t\terror(\"can't catch SIGINT\\n\");\n#if HAVE_SIGHUP\n\tif (signal(SIGALRM, sig_ignore) == SIG_ERR)\n\t\terror(\"can't catch SIGALRM\\n\");\n#endif\n\tif (signal(SIGTERM, sig_ignore) == SIG_ERR)\n\t\terror(\"can't catch SIGTERM\\n\");\n}\n\nprivate void\ninit_env(int argc, char **argv)\n{\n\tset_sighandler();\n\tSTRDUP(InboxDir, \".\");\n\tMboxType = T_UNKNOWN;\n\tBackup = FALSE;\n\tUseCL = FALSE;\n\tsearch_mbox_path();\n\tSTRDUP(Suffix, SUFFIX);\n\tSuffix_len = strlen(Suffix);\n}\n\nprivate int\nget_number(char *s)\n{\n\tint num = 0;\n\tunsigned char c;\n\n\twhile ((c = *s) != NUL && isdigit(c)) {\n\t\tnum = num * 10 + c - '0';\n\t\ts++;\n\t}\n\n\tif (num == 0)\n\t\treturn 0;\n\telse if (*s == NUL)\n\t\treturn num;\n\telse if (strncmp(s, Suffix, Suffix_len) == 0 && s[Suffix_len] == NUL)\n\t\treturn num;\n\telse\n\t\treturn 0;\n}\n\nprivate int\nget_last_seq(void)\n{\n\tstruct dirent *dp;\n\tDIR *dirp;\n\tint last = 0;\n\tint seq;\n\n\tif ((dirp = opendir(InboxDir)) == NULL)\n\t\terror(\"opendir(%s)\", InboxDir);\n\twhile ((dp = readdir(dirp)) != NULL) {\n\t\tif ((seq = get_number(dp->d_name)) == 0)\n\t\t\tcontinue;\n\t\tlast = last > seq ? last : seq;\n\t}\n\tclosedir(dirp);\n\treturn last;\n}\n\nprivate int\ncompare_string(char **i, char **j)\n{\n\treturn strcmp(*i, *j);\n}\n\nprivate int\ncopyfile(char *src, char *dst)\n{\n\tstruct timeval tv[2];\n\tstruct stat sb;\n\tint srcfd, dstfd;\n\tssize_t rlen, wlen;\n\n\tif ((srcfd = open(src, O_RDONLY, 0)) < 0)\n\t\terror(\"open(%s) for read\", src);\n\tif (fstat(srcfd, &sb))\n\t\terror(\"fstat(%s)\", src);\n\tif ((dstfd = open(dst, O_EXCL | O_CREAT | O_WRONLY | O_TRUNC, 0)) < 0)\n\t\terror(\"open(%s) for write\", dst);\n\twhile ((rlen = read(srcfd, FileBuf, FBUFSIZ)) > 0) {\n\t\tif ((wlen = write(dstfd, FileBuf, rlen)) != rlen) {\n\t\t\tif (close(dstfd))\n\t\t\t\tgoto werr;\n\t\t\tunlink(dst);\n\t\t\terror(\"write(%s) (read %d bytes/write %d bytes)\",\n\t\t\t dst, rlen, wlen);\n\t\t}\n\t}\n\tif (rlen < 0) {\n\t\tif (close(dstfd))\n\t\t\tgoto werr;\n\t\tunlink(dst);\n\t\terror(\"read(%s)\", src);\n\t}\n\tclose(srcfd);\n\n\ttv[0].tv_sec = sb.st_atime;\n\ttv[0].tv_usec = 0;\n\ttv[1].tv_sec = sb.st_mtime;\n\ttv[1].tv_usec = 0;\n#if HAVE_FUTIMES\n\tif (futimes(dstfd, tv))\n\t\twarning(\"futimes(%s) failed\", dst);\n#endif\n#if HAVE_FCHMOD\n\tif (fchmod(dstfd, sb.st_mode))\n\t\twarning(\"fchmod(%s) failed\", dst);\n#endif\n\tclose(dstfd);\n#if !HAVE_FUTIMES && HAVE_UTIMES\n\tif (utimes(dst, tv))\n\t\twarning(\"utimes(%s) failed\", dst);\n#endif\n#if !HAVE_FCHMOD && HAVE_CHMOD\n\tif (chmod(dst, sb.st_mode))\n\t\twarning(\"chmod(%s) failed\", dst);\n#endif\n\treturn 0;\n\n werr:\n\tclose(srcfd);\n\treturn -1;\n}\n\nprivate void\nmovefile(char *fromfile, char *tofile, char *backupfile, int backup)\n{\n\tif (backup && backupfile != NULL) {\n\t\tif (copyfile(fromfile, tofile))\n\t\t\terror(\"copyfile(%s, %s)\", fromfile, tofile);\n\t\tif (rename(fromfile, backupfile))\n\t\t\terror(\"rename(%s, %s)\", fromfile, backupfile);\n\t}\n\telse if (backup) {\n\t\tif (copyfile(fromfile, tofile))\n\t\t\terror(\"copyfile(%s, %s)\", fromfile, tofile);\n\t}\n\telse {\n\t\tif (rename(fromfile, tofile)) {\n\t\t\tif (errno != EXDEV)\n\t\t\t\terror(\"rename(%s, %s)\", fromfile, tofile);\n\t\t\tif (copyfile(fromfile, tofile))\n\t\t\t\terror(\"copyfile(%s, %s)\", fromfile, tofile);\n\t\t\tif (unlink(fromfile))\n\t\t\t\terror(\"unlink(%s)\", fromfile);\n\t\t}\n\t}\n}\n\n/* maildir has {new,cur,tmp} subdirectory. */\nprivate int\nmaildir_names(const char *maildir, char **newdir, char **curdir, char **tmpdir)\n{\n\tint len = strlen(maildir) + strlen(MAILDIR_NEW) + 2;\n\n\tif (maildir == NULL || strlen(maildir) <= 0)\n\t\treturn -1;\n\tif (newdir != NULL) {\n\t\tMALLOC(*newdir, len);\n\t\tsnprintf(*newdir, len, \"%s/%s\", maildir, MAILDIR_NEW);\n\t}\n\tif (curdir != NULL) {\n\t\tMALLOC(*curdir, len);\n\t\tsnprintf(*curdir, len, \"%s/%s\", maildir, MAILDIR_CUR);\n\t}\n\tif (tmpdir != NULL) {\n\t\tMALLOC(*tmpdir, len);\n\t\tsnprintf(*tmpdir, len, \"%s/%s\", maildir, MAILDIR_TMP);\n\t}\n\treturn 0;\n}\n\n/* *WARNING* inboxfile requires PATH_MAX bytes */\nprivate int\nnew_inbox_file(int seq, char inboxfile[])\n{\n\tchar num[PATH_MAX];\n\tchar *suffix = (Use_Suffix == YES) ? Suffix : \"\";\n\n\tdo {\n\t\tsnprintf(num, sizeof(num), \"%d%s\", ++seq, suffix);\n\t\tif (strlen(InboxDir) + strlen(num) + 2 > PATH_MAX)\n\t\t\terror(\"pathname too long (%s/%s)\", InboxDir, num);\n\t\tsnprintf(inboxfile, PATH_MAX, \"%s/%s\", InboxDir, num);\n\t\tif (access(inboxfile, F_OK) && errno == ENOENT)\n\t\t\tbreak;\n\t} while (TRUE);\n\treturn seq;\n}\n\n/* *WARNING* inboxfile requires PATH_MAX bytes */\nprivate FILE *\nopen_new_inbox_file(int *seq, char inboxfile[]) \n{\n\tchar num[PATH_MAX];\n\tint flag = O_EXCL | O_CREAT | O_WRONLY;\n\tint fd;\n\tFILE *fp = NULL;\n\tchar *suffix = (Use_Suffix == YES) ? Suffix : \"\";\n\n\tfor (;;) {\n\t\tsnprintf(num, sizeof(num), \"%d%s\", ++*seq, suffix);\n\t\tif (strlen(InboxDir) + strlen(num) + 2 > PATH_MAX)\n\t\t\terror(\"pathname too long (%s/%s)\", InboxDir, num);\n\t\tsnprintf(inboxfile, PATH_MAX, \"%s/%s\", InboxDir, num);\n\t\tif ((fd = open(inboxfile, flag, FileMode)) >= 0 ||\n\t\t errno != EEXIST)\n\t\t\tbreak;\n\t\tusleep(rand() % 199);\n\t}\n\tif (fd < 0)\n\t\twarning(\"open(%s) for write\", inboxfile);\n\telse {\n\t\tif ((fp = fdopen(fd, FDWRITE)) == NULL)\n\t\t\twarning(\"open(%s) for write\", inboxfile);\n\t}\n\treturn fp;\n}\n\nprivate int\nget_from_dir(int seq, char *fromdir, char *backupdir, int backup)\n{\n\tstruct stat sb;\n\tstruct dirent *dp;\n\tDIR *dirp;\n\tchar mailfile[PATH_MAX];\n\tchar inboxfile[PATH_MAX];\n\tchar backupfile[PATH_MAX];\n\tchar **list;\n\tint listsize = BUFSIZ;\n\tint listend = 0;\n\tint i;\n\n\tMALLOC(list, sizeof(char *)*listsize);\n\tif ((dirp = opendir(fromdir)) == NULL)\n\t\terror(\"opendir(%s)\", fromdir);\n\twhile ((dp = readdir(dirp)) != NULL) {\n\t\tif (strlen(fromdir) + strlen(dp->d_name) + 2 > PATH_MAX)\n\t\t\terror(\"pathname too long (%s/%s)\",\n\t\t\t fromdir, dp->d_name);\n\t\tsnprintf(mailfile, sizeof(mailfile), \"%s/%s\", fromdir, dp->d_name);\n\t\tif (stat(mailfile, &sb))\n\t\t\tcontinue;\n\t\tif (!(S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)))\n\t\t\tcontinue;\n\t\tif (listend >= listsize) {\n\t\t\tlistsize *= 2;\n\t\t\tif ((list = (char **)\n\t\t\t realloc(list, sizeof(char *)*listsize)) == NULL)\n\t\t\t\terror(\"realloc\");\n\t\t}\n\t\tSTRDUP(list[listend++], dp->d_name);\n\t}\n\tclosedir(dirp);\n\n\tqsort(list, listend, sizeof(char *),\n\t (int (*)(const void *, const void *))compare_string);\n\n\tfor (i = 0; i < listend; i++) {\n\t\tseq = new_inbox_file(seq, inboxfile);\n\t\tif (strlen(fromdir) + strlen(list[i]) + 2 > PATH_MAX)\n\t\t\terror(\"pathname too long (%s/%s)\",\n\t\t\t fromdir, list[i]);\n\t\tsnprintf(mailfile, sizeof(mailfile), \"%s/%s\", fromdir, list[i]);\n\t\tif (backup && backupdir != NULL) {\n\t\t\tif (strlen(backupdir) + strlen(list[i]) + 6 > PATH_MAX)\n\t\t\t\terror(\"pathname too long (%s/%s)\",\n\t\t\t\t backupdir, list[i]);\n\t\t\tsnprintf(backupfile, sizeof(backupfile), \"%s/%s:2,S\", backupdir, list[i]);\n\t\t\tmovefile(mailfile, inboxfile, backupfile, backup);\n\t\t}\n\t\telse\n\t\t\tmovefile(mailfile, inboxfile, NULL, backup);\n\t\tprintf(\"%d\\n\", seq);\n\t}\n\treturn seq;\n}\n\nprivate int\nprocess_maildir(int seq)\n{\n\tchar *newdir, *curdir;\n\tif (maildir_names(Mbox, &newdir, &curdir, NULL))\n\t\terror(\"maildir name is not set (%s)\", Mbox);\n\tif (GetCur)\n\t\tseq = get_from_dir(seq, curdir, NULL, Backup);\n\treturn get_from_dir(seq, newdir, curdir, Backup);\n}\n\nprivate int\nlock_mbox(char *lockfile)\n{\n\tint fd;\n\tint retry = 5;\n\n\twhile (TRUE) {\n\t if ((fd = open(lockfile, O_WRONLY | O_CREAT | O_EXCL, 0666)) < 0) {\n\t\t\tif (errno == EACCES || errno == EROFS)\n\t\t\t\treturn 1; /* doesn't need a lockfile, maybe. */\n\t\t\telse if (errno != EEXIST)\n\t\t\t\terror(\"open(%s)\", lockfile);\n\t\t\tif (retry-- <= 0) {\n\t\t\t\tchar buf[PATH_MAX];\n\t\t\t\tSTRCPY(buf, lockfile);\n\t\t\t\tMboxLock[0] = '\\0'; /* no unlinking lockfile */\n\t\t\t\terror(\"can't get lock(%s)\", buf);\n\t\t\t} else {\n\t\t\t\tif (warn_prog != NULL)\n\t\t\t\t\tfprintf(stderr, \"%s: \", warn_prog);\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"waiting for lockfile (%s) \"\n\t\t\t\t\t\"released (%d)\\n\",\n\t\t\t\t\tlockfile, retry);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/* lock succeeded. */\n\t\t\twrite(fd, \"0\", 1);\n\t\t\tclose(fd);\n\t\t\treturn 0;\n\t\t}\n\t\tsleep(2);\n\t}\n}\n\nprivate void\nunlock_mbox(char *lockfile)\n{\n\tif (strlen(lockfile) > 0)\n\t\tunlink(lockfile);\n}\n\nprivate int\nprocess_mbox(int seq)\n{\n\tchar inboxfile[PATH_MAX];\n\tchar emptyline[3];\n\tchar *ln;\n\tint srcfd, oflag;\n\tFILE *srcfp = NULL;\n\tFILE *dstfp = NULL;\n\tint state = ST_UNKNOWN;\n\tint bytes = -1;\t\t/* UseCL (Content-Length:) */\n\n\tif (strlen(Mbox) + strlen(LOCK_SUFFIX) + 1 > PATH_MAX)\n\t\terror(\"pathname too long (%s%s)\", Mbox, LOCK_SUFFIX);\n\tsnprintf(MboxLock, sizeof(MboxLock), \"%s%s\", Mbox, LOCK_SUFFIX);\n\tif (lock_mbox(MboxLock))\n\t\tMboxLock[0] = '\\0'; /* doesn't need a lockfile, maybe. */\n\n\toflag = O_RDWR;\n#if defined(O_EXLOCK)\n\toflag |= O_EXLOCK;\n#endif\n\tif ((srcfd = open(Mbox, oflag, 0)) < 0) {\n\t\twarning(\"open(%s) for rw/truncate\", Mbox); goto rerr;\n\t}\n#if !defined(O_EXLOCK) && (HAVE_FLOCK || HAVE_LOCKF)\n\tif (flock(srcfd, LOCK_EX) < 0) {\n\t\twarning(\"flock(%s)\", Mbox); goto rerr;\n\t}\n#endif\n\tif ((srcfp = fdopen(srcfd, FDREAD)) == NULL) {\n\t\twarning(\"fdopen(%s) for read\", Mbox); goto rerr;\n\t}\n\n\twhile ((ln = Getline(srcfp)) != NULL) {\n\t\tif (Exit)\n\t\t\tgoto werr;\n\t\tswitch (state) {\n\t\tcase ST_UNKNOWN:\n\t\t\tif (strncmp(ln, \"From \", 5) == 0) {\n\t\t\t\tdstfp = open_new_inbox_file(&seq, inboxfile);\n\t\t\t\tif (dstfp == NULL)\n\t\t\t\t\tgoto rerr;\n\t\t\t\tif (PreserveUnixFrom &&\n\t\t\t\t fputs(ln, dstfp) == EOF) {\n\t\t\t\t\twarning(\"fputs(%s)\", inboxfile);\n\t\t\t\t\tgoto werr;\n\t\t\t\t}\n\t\t\t\tstate = ST_HEADER;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ST_HEADER:\n\t\t\tif (strlen(ln) < 3 &&\n\t\t\t (ln[0] == '\\n' || ln[0] == '\\r')) {\n\t\t\t\tSTRCPY(emptyline, ln);\n\t\t\t\tstate = ST_BODY_AFTER_EMPTY_LINE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (fputs(ln, dstfp) == EOF) {\n\t\t\t\twarning(\"fputs(%s)\", inboxfile); goto werr;\n\t\t\t}\n\t\t\tif (UseCL &&\n\t\t\t strncasecmp(ln, \"Content-Length\", 14) == 0) {\n\t\t\t\tint i;\n\t\t\t\tfor (i = 14; i < strlen(ln); i++)\n\t\t\t\t\tif (isdigit((unsigned char)ln[i]))\n\t\t\t\t\t\tbreak;\n\t\t\t\tbytes = atoi(&ln[i]);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ST_BODY_AFTER_EMPTY_LINE:\n\t\t\tif (bytes < 0 && strncmp(ln, \"From \", 5) == 0) {\n\t\t\t\tif (fclose(dstfp))\n\t\t\t\t\tgoto rerr;\n\t\t\t\tprintf(\"%d\\n\", seq);\n\n\t\t\t\tdstfp = open_new_inbox_file(&seq, inboxfile);\n\t\t\t\tif (dstfp == NULL)\n\t\t\t\t\tgoto rerr;\n\t\t\t\tif (PreserveUnixFrom &&\n\t\t\t\t fputs(ln, dstfp) == EOF) {\n\t\t\t\t\twarning(\"fputs(%s)\", inboxfile);\n\t\t\t\t\tgoto werr;\n\t\t\t\t}\n\t\t\t\tstate = ST_HEADER;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (fputs(emptyline, dstfp) == EOF)\n\t\t\t\tgoto werr;\n\t\t\t/* FALLTHRU */\n\t\tcase ST_BODY:\n\t\t\tif (strlen(ln) < 3 &&\n\t\t\t (ln[0] == '\\n' || ln[0] == '\\r')) {\n\t\t\t\tSTRCPY(emptyline, ln);\n\t\t\t\tstate = ST_BODY_AFTER_EMPTY_LINE;\n\t\t\t}\n\t\t\telse\n\t\t\t\tstate = ST_BODY;\n\n\t\t\tif (state == ST_BODY && fputs(ln, dstfp) == EOF)\n\t\t\t\tgoto werr;\n\t\t\tif (bytes >= 0) {\n\t\t\t\tbytes -= strlen(ln);\n\t\t\t\tif (bytes <= 0) {\n\t\t\t\t\tif (fclose(dstfp))\n\t\t\t\t\t\tgoto rerr;\n\t\t\t\t\tdstfp = NULL;\n\t\t\t\t\tprintf(\"%d\\n\", seq);\n\t\t\t\t\tstate = ST_UNKNOWN;\n\t\t\t\t\tbytes = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tfree(ln);\n\t}\n\tif (dstfp) {\n\t\tif (fclose(dstfp))\n\t\t\tgoto rerr;\n\t\tprintf(\"%d\\n\", seq);\n\t}\n\tif (!Backup && ftruncate(srcfd, 0)) {\n\t\tunlock_mbox(MboxLock);\n\t\terror(\"ftruncate\");\n\t}\n\tfclose(srcfp);\n\tunlock_mbox(MboxLock);\n\treturn seq;\n\n werr:\n\tif (dstfp)\n\t\tfclose(dstfp);\n\tunlink(inboxfile);\n rerr:\n\tif (srcfp)\n\t\tfclose(srcfp);\n\tunlock_mbox(MboxLock);\n\terror(\"process_mbox(%s)\", Mbox);\n\treturn -1;\t\t/* error. not reached */\n}\n\nprivate int\nprocess_stdin(int seq)\n{\n\tchar inboxfile[PATH_MAX];\n\tchar *ln;\n\tFILE *srcfp = stdin;\n\tFILE *dstfp;\n\n\tif ((dstfp = open_new_inbox_file(&seq, inboxfile)) == NULL)\n\t\tgoto rerr;\n\n\twhile ((ln = Getline(srcfp)) != NULL) {\n\t\tif (Exit)\n\t\t\tgoto werr;\n\t\tif (fputs(ln, dstfp) == EOF) {\n\t\t\twarning(\"fputs(%s)\", inboxfile); goto werr;\n\t\t}\n\t\tfree(ln);\n\t}\n\n\tif (dstfp) {\n\t\tfclose(dstfp);\n\t\tprintf(\"%d\\n\", seq);\n\t}\n\treturn seq;\n\n werr:\n\tif (dstfp)\n\t\tfclose(dstfp);\n\tunlink(inboxfile);\n rerr:\n\terror(\"process_stdin\");\n\treturn -1;\t\t/* error. not reached */\n}\n\nprivate void\nprocess(void)\n{\n\tchar mtimefile[PATH_MAX];\n\tFILE *fp;\n\tsize_t wb;\n\tint len = strlen(MEW_MTIME_PHRASE);\n\tint seq = get_last_seq();\n\tint newseq = 0;\n\n\tswitch (MboxType) {\n\tcase T_MAILDIR:\n\t\tnewseq = process_maildir(seq);\n\t\tbreak;\n\tcase T_MBOX:\n\t\tnewseq = process_mbox(seq);\n\t\tbreak;\n\tcase T_STDIN:\n\t\tnewseq = process_stdin(seq);\n\t\tbreak;\n\tdefault:\n\t\terror(\"unknown mbox type (%s)\", Mbox);\n\t}\n\n\t/* update .mew-mtime file if new mail arrived */\n\tif (!CreateMTime || newseq <= seq)\n\t\treturn;\t\t/* no new mail */\n\tif (strlen(InboxDir) + strlen(MEW_MTIME_FILE) + 1 > PATH_MAX)\n\t\terror(\"pathname too long (%s%s)\", InboxDir, MEW_MTIME_FILE);\n\tsnprintf(mtimefile, sizeof(mtimefile), \"%s/%s\", InboxDir, MEW_MTIME_FILE);\n\n\tif ((fp = fopen(mtimefile, FDWRITE)) == NULL)\n\t\terror(\"can't create file (%s)\", mtimefile);\n\tif ((wb = fwrite(MEW_MTIME_PHRASE, sizeof(char), len, fp)) != len) {\n\t\tfclose(fp);\n\t\terror(\"fwrite failed (%d, %s)\", wb, mtimefile);\n\t}\n\tfclose(fp);\n}\n\nprivate void\nsanity_check(void)\n{\n\tstruct stat sb;\n\n\t/* was directory exists? */\n\tif (stat(InboxDir, &sb))\n\t\terror(\"stat(%s)\", InboxDir);\n\tif (!S_ISDIR(sb.st_mode) || access(InboxDir, W_OK))\n\t\terror(\"can't write directory (%s)\", InboxDir);\n\n\t/* mbox type checking */\n\tif (MboxType == T_UNKNOWN &&\n\t (MboxType = check_mbox_type(Mbox)) == T_UNKNOWN)\n\t\terror(\"can't find mbox (%s)\", Mbox);\n}\n\nint\nmain(int argc, char **argv)\n{\n\textern char *Optarg;\n\textern int Optind;\n\tchar *progname = getprognm(argv[0]);\n\tint ch;\n\n\twarn_prog = progname;\n\tinit_env(argc, argv);\n\n\twhile ((ch = Getopt(argc, argv, \"abcd:fhi:m:op:suvx:\")) != EOF) {\n\t\tswitch (ch) {\n\t\tcase 'a':\n\t\t\tGetCur = TRUE;\n\t\t\tbreak;\n\t\tcase 'b':\n\t\t\tBackup = TRUE;\n\t\t\tbreak;\n\t\tcase 'c':\n\t\t\tUseCL = TRUE;\n\t\t\tbreak;\n\t\tcase 'd':\n\t\tcase 'm':\n\t\t\tif (strlen(Optarg) + 1 > PATH_MAX)\n\t\t\t\terror(\"pathname too long (%s)\", Optarg);\n\t\t\tsnprintf(Mbox, sizeof(Mbox), \"%s\", Optarg);\n\t\t\tbreak;\n\t\tcase 'f':\n\t\t\tPreserveUnixFrom = TRUE;\n\t\t\tbreak;\n\t\tcase 'i':\n\t\t\tSTRDUP(InboxDir, Optarg);\n\t\t\tbreak;\n\t\tcase 'o':\n\t\t\tUse_Suffix = TRUE;\n\t\t\tbreak;\n\t\tcase 'x':\n\t\t\tSTRDUP(Suffix, Optarg);\n\t\t\tSuffix_len = strlen(Suffix);\n\t\t\tbreak;\n\t\tcase 'p':\n\t\t\tsscanf(Optarg, \"%i\", &FileMode);\n\t\t\tbreak;\n\t\tcase 's':\n\t\t\tMboxType = T_STDIN;\n\t\t\tbreak;\n\t\tcase 'u':\n\t\t\tCreateMTime = FALSE;\n\t\t\tbreak;\n\t\tcase 'v':\n\t\t\tversion(progname);\n\t\t\texit(EXIT_SUCCESS);\n\t\tcase 'h':\n\t\t\thelp(progname);\n\t\t\texit(EXIT_SUCCESS);\n\t\tdefault:\n\t\t\tusage(progname);\n\t\t\texit(EXIT_SUCCESS);\n\t\t}\n\t}\n\targc -= Optind;\n\targv += Optind;\n\n\tsanity_check();\n\tprocess();\n\treturn EXIT_SUCCESS;\n}\n\n/* \n * Copyright (C) 2001-2005 Mew developing team.\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the team nor the names of its contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * incm.c ends here\n */\n"} +{"text": "--TEST--\nBug #43926 (isInstance() isn't equivalent to instanceof operator)\n--FILE--\nnewInstance();\n$cc = $rc->newInstance();\n$cd = $rd->newInstance();\n$ce = $re->newInstance();\n\nprint(\"Is? A \". ($ra->isInstance($ca) ? 'true' : 'false') .\", instanceof: \". (($ca instanceof A) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? C \". ($rc->isInstance($ca) ? 'true' : 'false') .\", instanceof: \". (($ca instanceof C) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? D \". ($rd->isInstance($ca) ? 'true' : 'false') .\", instanceof: \". (($ca instanceof D) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? E \". ($re->isInstance($ca) ? 'true' : 'false') .\", instanceof: \". (($ca instanceof E) ? 'true' : 'false') .\"\\n\");\nprint \"-\\n\";\nprint(\"Is? A \". ($ra->isInstance($cc) ? 'true' : 'false') .\", instanceof: \". (($cc instanceof A) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? C \". ($rc->isInstance($cc) ? 'true' : 'false') .\", instanceof: \". (($cc instanceof C) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? D \". ($rd->isInstance($cc) ? 'true' : 'false') .\", instanceof: \". (($cc instanceof D) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? E \". ($re->isInstance($cc) ? 'true' : 'false') .\", instanceof: \". (($cc instanceof E) ? 'true' : 'false') .\"\\n\");\nprint \"-\\n\";\nprint(\"Is? A \". ($ra->isInstance($cd) ? 'true' : 'false') .\", instanceof: \". (($cd instanceof A) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? C \". ($rc->isInstance($cd) ? 'true' : 'false') .\", instanceof: \". (($cd instanceof C) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? D \". ($rd->isInstance($cd) ? 'true' : 'false') .\", instanceof: \". (($cd instanceof D) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? E \". ($re->isInstance($cd) ? 'true' : 'false') .\", instanceof: \". (($cd instanceof E) ? 'true' : 'false') .\"\\n\");\nprint \"-\\n\";\nprint(\"Is? A \". ($ra->isInstance($ce) ? 'true' : 'false') .\", instanceof: \". (($ce instanceof A) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? C \". ($rc->isInstance($ce) ? 'true' : 'false') .\", instanceof: \". (($ce instanceof C) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? D \". ($rd->isInstance($ce) ? 'true' : 'false') .\", instanceof: \". (($ce instanceof D) ? 'true' : 'false') .\"\\n\");\nprint(\"Is? E \". ($re->isInstance($ce) ? 'true' : 'false') .\", instanceof: \". (($ce instanceof E) ? 'true' : 'false') .\"\\n\");\n\n?>\n--EXPECT--\nIs? A true, instanceof: true\nIs? C false, instanceof: false\nIs? D true, instanceof: true\nIs? E true, instanceof: true\n-\nIs? A true, instanceof: true\nIs? C true, instanceof: true\nIs? D true, instanceof: true\nIs? E true, instanceof: true\n-\nIs? A false, instanceof: false\nIs? C false, instanceof: false\nIs? D true, instanceof: true\nIs? E true, instanceof: true\n-\nIs? A false, instanceof: false\nIs? C false, instanceof: false\nIs? D false, instanceof: false\nIs? E true, instanceof: true\n"} +{"text": "# -*- coding: utf-8 -*-\n\nimport json\n\nfrom claf.config import args\nfrom claf.config.registry import Registry\nfrom claf.learn.mode import Mode\nfrom claf import utils as common_utils\n\n\nif __name__ == \"__main__\":\n registry = Registry()\n\n machine_config = args.config(mode=Mode.MACHINE)\n machine_name = machine_config.name\n config = getattr(machine_config, machine_name, {})\n\n claf_machine = registry.get(f\"machine:{machine_name}\")(config)\n\n while True:\n question = common_utils.get_user_input(f\"{getattr(machine_config, 'user_input', 'Question')}\")\n answer = claf_machine(question)\n answer = json.dumps(answer, indent=4, ensure_ascii=False)\n print(f\"{getattr(machine_config, 'system_response', 'Answer')}: {answer}\")\n"} +{"text": "package view.scene.raid\n{\n import flash.display.*;\n import flash.events.*;\n import flash.geom.*;\n import flash.filters.*;\n import flash.utils.*;\n import mx.core.*;\n import mx.controls.Label;\n import flash.text.TextField;\n import flash.text.TextFormat;\n import flash.text.TextFormatAlign;\n\n import org.libspark.thread.Thread;\n import org.libspark.thread.utils.ParallelExecutor;\n import org.libspark.thread.threads.between.BeTweenAS3Thread;\n\n import model.*;\n import model.events.*;\n\n import view.image.raid.*;\n import view.*;\n import view.scene.BaseScene;\n import view.utils.*;\n\n import controller.RaidCtrl;\n import controller.RaidChatCtrl;\n import controller.RaidDataCtrl;\n\n\n /**\n * 渦情報表示クラス\n *\n */\n public class RaidInfo extends BaseScene\n {\n CONFIG::LOCALE_JP\n private static const _TRANS_AREA_CLOSE_AT:String = \"残り[__CLOSE_TIME__]\";\n CONFIG::LOCALE_EN\n private static const _TRANS_AREA_CLOSE_AT:String = \"[__CLOSE_TIME__]\";\n CONFIG::LOCALE_TCN\n private static const _TRANS_AREA_CLOSE_AT:String = \"剩餘[__CLOSE_TIME__]\";\n CONFIG::LOCALE_SCN\n private static const _TRANS_AREA_CLOSE_AT:String = \"剩余[__CLOSE_TIME__]\";\n CONFIG::LOCALE_KR\n private static const _TRANS_AREA_CLOSE_AT:String = \"\";\n CONFIG::LOCALE_FR\n private static const _TRANS_AREA_CLOSE_AT:String = \"Reste [__CLOSE_TIME__]\";\n CONFIG::LOCALE_ID\n private static const _TRANS_AREA_CLOSE_AT:String = \"\";\n CONFIG::LOCALE_TH\n private static const _TRANS_AREA_CLOSE_AT:String = \"เวลาที่เหลือ[__CLOSE_TIME__]\";\n\n CONFIG::LOCALE_JP\n private static const _TRANS_BTL_CNT_MSG:String = \"戦闘行動中の渦の個数と最大個数です\";\n CONFIG::LOCALE_EN\n private static const _TRANS_BTL_CNT_MSG:String = \"The number of active and maximum possible vortex battles.\";\n CONFIG::LOCALE_TCN\n private static const _TRANS_BTL_CNT_MSG:String = \"戰鬥進行中的渦的數量以及最大數量\";\n CONFIG::LOCALE_SCN\n private static const _TRANS_BTL_CNT_MSG:String = \"战斗中的漩涡个数及个数上限值。\";\n CONFIG::LOCALE_KR\n private static const _TRANS_BTL_CNT_MSG:String = \"\";\n CONFIG::LOCALE_FR\n private static const _TRANS_BTL_CNT_MSG:String = \"Voici le nombre de Vortex et le nombre maximal de Vortex dans lesquels des combats ont lieu.\";\n CONFIG::LOCALE_ID\n private static const _TRANS_BTL_CNT_MSG:String = \"\";\n CONFIG::LOCALE_TH\n private static const _TRANS_BTL_CNT_MSG:String = \"จำนวนน้ำวนในขณะต่อสู้กับจำนวนสูงสุด\"; // 戦闘行動中の渦の個数と最大個数です\n\n CONFIG::LOCALE_JP\n private static const _TRANS_MAP_NAME_HEX:String = \"隠者の道\";\n CONFIG::LOCALE_JP\n private static const _TRANS_MAP_NAME_SHADOW:String = \"影斬り森\";\n CONFIG::LOCALE_JP\n private static const _TRANS_MAP_NAME_MOON:String = \"幻影城\";\n CONFIG::LOCALE_JP\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"翼竜の宝物庫\";\n CONFIG::LOCALE_JP\n private static const _TRANS_MAP_NAME_ANGEL:String = \"聖女の玉座\";\n\n CONFIG::LOCALE_EN\n private static const _TRANS_MAP_NAME_HEX:String = \"Hermit Road\";\n CONFIG::LOCALE_EN\n private static const _TRANS_MAP_NAME_SHADOW:String = \"Shadowthief Forest\";\n CONFIG::LOCALE_EN\n private static const _TRANS_MAP_NAME_MOON:String = \"The Phantom Castle\";\n CONFIG::LOCALE_EN\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"The Wyvern's Treasure\";\n CONFIG::LOCALE_EN\n private static const _TRANS_MAP_NAME_ANGEL:String = \"Throne of the saint\";\n\n CONFIG::LOCALE_TCN\n private static const _TRANS_MAP_NAME_HEX:String = \"隱者之道\";\n CONFIG::LOCALE_TCN\n private static const _TRANS_MAP_NAME_SHADOW:String = \"斬影森林\";\n CONFIG::LOCALE_TCN\n private static const _TRANS_MAP_NAME_MOON:String = \"幻影城\";\n CONFIG::LOCALE_TCN\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"翼龍的藏寶庫\";\n CONFIG::LOCALE_TCN\n private static const _TRANS_MAP_NAME_ANGEL:String = \"聖女的玉座\";\n\n CONFIG::LOCALE_SCN\n private static const _TRANS_MAP_NAME_HEX:String = \"隐士之道\";\n CONFIG::LOCALE_SCN\n private static const _TRANS_MAP_NAME_SHADOW:String = \"斩影之森\";\n CONFIG::LOCALE_SCN\n private static const _TRANS_MAP_NAME_MOON:String = \"幻影城\";\n CONFIG::LOCALE_SCN\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"翼龙的宝物库\";\n CONFIG::LOCALE_SCN\n private static const _TRANS_MAP_NAME_ANGEL:String = \"圣女的宝座\";\n\n CONFIG::LOCALE_KR\n private static const _TRANS_MAP_NAME_HEX:String = \"\";\n CONFIG::LOCALE_KR\n private static const _TRANS_MAP_NAME_SHADOW:String = \"\";\n CONFIG::LOCALE_KR\n private static const _TRANS_MAP_NAME_MOON:String = \"\";\n CONFIG::LOCALE_KR\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"\";\n CONFIG::LOCALE_KR\n private static const _TRANS_MAP_NAME_ANGEL:String = \"\";\n\n CONFIG::LOCALE_FR\n private static const _TRANS_MAP_NAME_HEX:String = \"Route des Ermites\";\n CONFIG::LOCALE_FR\n private static const _TRANS_MAP_NAME_SHADOW:String = \"Forêt voleuse d'ombres\";\n CONFIG::LOCALE_FR\n private static const _TRANS_MAP_NAME_MOON:String = \"Château du Fantôme\";\n CONFIG::LOCALE_FR\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"Coffre de Wyvern\";\n CONFIG::LOCALE_FR\n private static const _TRANS_MAP_NAME_ANGEL:String = \"Trône de Rrine\";\n\n CONFIG::LOCALE_ID\n private static const _TRANS_MAP_NAME_HEX:String = \"\";\n CONFIG::LOCALE_ID\n private static const _TRANS_MAP_NAME_SHADOW:String = \"\";\n CONFIG::LOCALE_ID\n private static const _TRANS_MAP_NAME_MOON:String = \"\";\n CONFIG::LOCALE_ID\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"\";\n CONFIG::LOCALE_ID\n private static const _TRANS_MAP_NAME_ANGEL:String = \"\";\n\n CONFIG::LOCALE_TH\n private static const _TRANS_MAP_NAME_HEX:String = \"ถนนลักซ่อน\"; // 隠者の道\n CONFIG::LOCALE_TH\n private static const _TRANS_MAP_NAME_SHADOW:String = \"ป่าตัดเงา\"; // 影斬り森\n CONFIG::LOCALE_TH\n private static const _TRANS_MAP_NAME_MOON:String = \"ปราสาทเงาลวง\"; // 幻影城\n CONFIG::LOCALE_TH\n private static const _TRANS_MAP_NAME_ANEMONEA:String = \"คลังสมบัติมังกรบิน\"; // 翼竜の宝物庫\n CONFIG::LOCALE_TH\n private static const _TRANS_MAP_NAME_ANGEL:String = \"ที่อยู่ของนักบุญหญิง\"; // 聖女の玉座\n\n private static const _MAP_NAME_LIST:Array = [\n _TRANS_MAP_NAME_HEX,\n _TRANS_MAP_NAME_SHADOW,\n _TRANS_MAP_NAME_MOON,\n _TRANS_MAP_NAME_ANEMONEA,\n _TRANS_MAP_NAME_ANGEL\n ];\n private static const _PAGE_MAX:int = 10;\n\n private static const _RANKING_UPDATE_TIME:int = 1000*60*3; // 3分毎に更新\n\n // コントローラー\n private var _ctrl:RaidCtrl = RaidCtrl.instance;\n\n protected var _container:UIComponent = new UIComponent(); // 表示コンテナ\n\n private var _infoImage:RaidInfoImage = new RaidInfoImage();\n\n // 選択中の渦\n private var _selectPrf:Profound = null;\n\n // 渦の情報\n private var _closeAtTimeLabel:Label = new Label();\n private var _prfName:Label = new Label();\n private var _bossName:Label = new Label();\n private var _bossHp:Label = new Label();\n private var _countLabel:Label = new Label();\n private var _hpGauge:BossHPGauge = new BossHPGauge();\n private var _timeGauge:TimeLimitGauge = new TimeLimitGauge();\n private var _timeGaugeUpdate:Boolean = false;\n private var _caption:TextField = new TextField();\n private var _itemsLabel:Label = new Label();\n\n private var _cntMsgText:TextField = new TextField();\n\n private var _time:Timer; // 消滅監視用タイマー\n\n // ランキング\n private var _ranking:ProfoundRankingList = new ProfoundRankingList();\n private var _rankPage:int = 0;\n private var _updateTime:Timer; // 更新用タイマー\n\n private const _Y:int = 32;\n\n private const _LABEL_X:int = 115;\n private const _LABEL_PRF_NAME_X:int = 70;\n private const _LABEL_CLOSE_AT_Y:int = 63;\n private const _LABEL_PRF_NAME_Y:int = 8;\n private const _LABEL_BOSS_X:int = 100;\n private const _LABEL_BOSS_NAME_Y:int = 25;\n private const _LABEL_BOSS_HP_X:int = 95;\n private const _LABEL_BOSS_HP_Y:int = 43;\n private const _LABEL_W:int = 160;\n private const _LABEL_PRF_NAME_W:int = 210;\n private const _LABEL_BOSS_W:int = 180;\n private const _LABEL_H:int = 20;\n private const _LABEL_ITEM_NAME_X:int = 338;\n private const _LABEL_ITEM_NAME_Y:int = _LABEL_PRF_NAME_Y;\n private const _LABEL_ITEM_NAME_W:int = 165;\n private const _URL_BTN_X:int = 540;\n private const _URL_BTN_Y:int = 260;\n\n private const _LABEL_CNT_X:int = 435;\n private const _LABEL_CNT_Y:int = 485;\n private const _LABEL_CNT_W:int = 50;\n private const _LABEL_CNT_H:int = 40;\n\n private const _CAPTION_X:int = 285;\n private const _CAPTION_Y:int = 43;\n private const _CAPTION_W:int = 220;\n private const _CAPTION_H:int = 50;\n\n /**\n * コンストラクタ\n *\n */\n public function RaidInfo()\n {\n }\n\n public override function init():void\n {\n y = _Y;\n\n _closeAtTimeLabel.x = _LABEL_X;\n _closeAtTimeLabel.y = _LABEL_CLOSE_AT_Y;\n _closeAtTimeLabel.width = _LABEL_W;\n _closeAtTimeLabel.height = _LABEL_H;\n _closeAtTimeLabel.setStyle(\"textAlign\", \"right\");\n _closeAtTimeLabel.setStyle(\"color\", \"0xFFFFFF\");\n _closeAtTimeLabel.text = \"\";\n\n _prfName.x = _LABEL_PRF_NAME_X;\n _prfName.y = _LABEL_PRF_NAME_Y;\n _prfName.width = _LABEL_PRF_NAME_W;\n _prfName.height = _LABEL_H;\n _prfName.setStyle(\"textAlign\", \"right\");\n _prfName.setStyle(\"color\", \"0xFFFFFF\");\n _prfName.text = \"\";\n\n _bossName.x = _LABEL_BOSS_X;\n _bossName.y = _LABEL_BOSS_NAME_Y;\n _bossName.width = _LABEL_BOSS_W;\n _bossName.height = _LABEL_H;\n _bossName.setStyle(\"textAlign\", \"right\");\n _bossName.setStyle(\"fontWeight\", \"bold\");\n _bossName.setStyle(\"color\", \"0xFFFFFF\");\n _bossName.text = \"\";\n\n _bossHp.x = _LABEL_BOSS_HP_X;\n _bossHp.y = _LABEL_BOSS_HP_Y;\n _bossHp.width = _LABEL_BOSS_W;\n _bossHp.height = _LABEL_H;\n _bossHp.setStyle(\"textAlign\", \"right\");\n _bossHp.setStyle(\"color\", \"0xFFFFFF\");\n _bossHp.text = \"\";\n\n _countLabel.x = _LABEL_CNT_X;\n _countLabel.y = _LABEL_CNT_Y;\n _countLabel.width = _LABEL_CNT_W;\n _countLabel.height = _LABEL_CNT_H;\n _countLabel.styleName = \"RaidCountLabel\";\n _countLabel.filters = [new GlowFilter(0x000000, 1, 1.5, 1.5, 16, 1),];\n _countLabel.text = ProfoundInventory.battleProfoundCount.toString();\n\n _caption.x = _CAPTION_X;\n _caption.y = _CAPTION_Y;\n _caption.width = _CAPTION_W;\n _caption.height = _CAPTION_H;\n _caption.textColor = 0xFFFFFF;\n _caption.mouseEnabled = false;\n _caption.wordWrap = true;\n _caption.multiline = true;\n _caption.alpha = 1.0;\n _caption.htmlText = \"\";\n\n _itemsLabel.x = _LABEL_ITEM_NAME_X;\n _itemsLabel.y = _LABEL_ITEM_NAME_Y;\n _itemsLabel.width = _LABEL_ITEM_NAME_W;\n _itemsLabel.height = _LABEL_H;\n _itemsLabel.setStyle(\"textAlign\", \"left\");\n _itemsLabel.setStyle(\"color\", \"0xFFFFFF\");\n _itemsLabel.text = \"\";\n\n var txtFormat:TextFormat = new TextFormat();\n txtFormat.align = TextFormatAlign.CENTER;\n _cntMsgText.defaultTextFormat = txtFormat;\n _cntMsgText.text = _TRANS_BTL_CNT_MSG;\n _cntMsgText.height = _LABEL_H;\n _cntMsgText.width = _cntMsgText.textWidth + 10;\n _cntMsgText.x = _LABEL_CNT_X - (_cntMsgText.textWidth / 3 * 2);\n _cntMsgText.y = _LABEL_CNT_Y + _LABEL_H;\n _cntMsgText.alpha = 1.0;\n _cntMsgText.background = true;\n _cntMsgText.backgroundColor = 0x000000;\n _cntMsgText.textColor = 0xFFFFFF;\n _cntMsgText.border = true;\n _cntMsgText.borderColor = 0x4CE1FF;\n _cntMsgText.visible = false;\n _countLabel.addEventListener(MouseEvent.MOUSE_OVER,cntLabelMouseOverHandler);\n _countLabel.addEventListener(MouseEvent.MOUSE_OUT,cntLabelMouseOutHandler);\n\n _hpGauge.setHP(0,0);\n _hpGauge.visible = false;\n\n _timeGauge.setTime(0,0);\n _timeGauge.visible = false;\n _infoImage.limit = false;\n\n setRankPage(_rankPage,true);\n _ranking.updateMyRank(0,true);\n\n _container.addChild(_infoImage);\n _container.addChild(_prfName);\n _container.addChild(_bossName);\n _container.addChild(_bossHp);\n //_container.addChild(_countLabel);\n _container.addChild(_cntMsgText);\n _container.addChild(_closeAtTimeLabel);\n _container.addChild(_hpGauge);\n _container.addChild(_timeGauge);\n _container.addChild(_caption);\n _container.addChild(_itemsLabel);\n _ranking.getShowThread(_container,20).start();\n addChild(_container);\n\n _infoImage.setRankButtonFunc(rankNextButtonHandler,rankBackButtonHandler);\n\n _time = new Timer(1000);\n _time.addEventListener(TimerEvent.TIMER, updateDuration);\n _time.start();\n _updateTime = new Timer(_RANKING_UPDATE_TIME);\n _updateTime.addEventListener(TimerEvent.TIMER, updateRankingHandler);\n _updateTime.start();\n\n RaidDataCtrl.instance.addEventListener(RaidDataCtrl.BOSS_HP_UPDATE,updateBossHPHandler);\n\n visible = false;\n }\n\n // 後始末処理\n public override function final():void\n {\n RaidDataCtrl.instance.removeEventListener(RaidDataCtrl.BOSS_HP_UPDATE,updateBossHPHandler);\n\n _updateTime.stop();\n _updateTime.removeEventListener(TimerEvent.TIMER, updateRankingHandler);\n\n _time.stop();\n _time.removeEventListener(TimerEvent.TIMER, updateDuration);\n\n _countLabel.removeEventListener(MouseEvent.MOUSE_OVER,cntLabelMouseOverHandler);\n _countLabel.removeEventListener(MouseEvent.MOUSE_OUT,cntLabelMouseOutHandler);\n\n _infoImage.getHideThread().start();\n _ranking.getHideThread().start();\n RemoveChild.apply(_container);\n }\n\n private function cntLabelMouseOverHandler(e:MouseEvent):void\n {\n _cntMsgText.visible = true;\n }\n\n private function cntLabelMouseOutHandler(e:MouseEvent):void\n {\n _cntMsgText.visible = false;\n }\n\n public function setButtonFunctions(startFunc:Function,giveFunc:Function,urlFunc:Function):void\n {\n _infoImage.setBossButtonFunc(startFunc,giveFunc,urlFunc);\n }\n\n public function set buttonVisibles(v:Boolean):void\n {\n _infoImage.bossDuelButtonVisible = v;\n }\n\n public function buttonVisibleCheck():void\n {\n if (_selectPrf) {\n if (_selectPrf.isFinished) {\n _infoImage.bossDuelButtonVisible = false;\n } else {\n _infoImage.bossDuelButtonVisible = true;\n }\n } else {\n _infoImage.bossDuelButtonVisible = false;\n }\n }\n\n public function setProfoundInfo(prf:Profound):void\n {\n log.writeLog(log.LV_FATAL, this,\"setProfoundInfo\", prf.id,prf.isFinished);\n var prfRank:ProfoundRanking = ProfoundRanking.getProfoundRanking(prf.id);\n _selectPrf = prf;\n if (prf.isFinished) {\n _infoImage.bossDuelButtonVisible = false;\n } else {\n _infoImage.bossDuelButtonVisible = true;\n }\n _prfName.text = prf.profoundData.name;\n _bossName.text = prf.bossName;\n _caption.htmlText = prf.profoundData.caption;\n _infoImage.limit = false;\n setBossHp();\n setTimeLimit();\n setCloseAtTime();\n setItems();\n if (prfRank) prfRank.setUpdateFunc(rankingUpdateHandler,myRankUpdateHandler);\n _rankPage = 0;\n setRankPage(_rankPage);\n if (_selectPrf) _ranking.updateMyRank(_selectPrf.id);\n visible = true;\n }\n\n public function clearProfoundInfo():void\n {\n log.writeLog(log.LV_FATAL, this,\"clearProfound\",_selectPrf);\n if (_selectPrf) {\n var prfRank:ProfoundRanking = ProfoundRanking.getProfoundRanking(_selectPrf.id);\n _infoImage.bossDuelButtonVisible = false;\n _infoImage.limit = false;\n _prfName.text = \"\";\n _bossName.text = \"\";\n _caption.htmlText = \"\";\n setBossHp(true);\n setTimeLimit(true);\n setItems(true);\n _hpGauge.setHP(0,0);\n _hpGauge.visible = false;\n _closeAtTimeLabel.text = \"\";\n if (prfRank) prfRank.setUpdateFunc(null,null);\n setRankPage(0,true);\n _ranking.updateMyRank(0,true);\n _selectPrf = null;\n visible = false;\n }\n }\n\n public function updateBossHp():void\n {\n setBossHp();\n }\n\n public function updateProfoundState(prf:Profound):void\n {\n _bossName.text = prf.bossName;\n setBossHp();\n }\n\n private function setCloseAtTime():void\n {\n if (_selectPrf) {\n var lastTime:String = TimeFormat.toString(_selectPrf.closeAtRestTime);\n _closeAtTimeLabel.text = _TRANS_AREA_CLOSE_AT.replace(\"__CLOSE_TIME__\",lastTime);\n }\n }\n private function setBossHp(clear:Boolean=false):void\n {\n var nowHp:int = 0;\n var maxHp:int = 0;\n var setText:String = \"\";\n if (_selectPrf && !clear) {\n maxHp = _selectPrf.profoundData.coreMonsterMaxHp;\n if (maxHp > 0) nowHp = maxHp - _selectPrf.viewDamage;\n if (nowHp <= 0) nowHp = 0;\n setText = nowHp.toString() + \"/\" + maxHp.toString();\n _hpGauge.setHP(nowHp,maxHp);\n _hpGauge.visible = true;\n _hpGauge.getUpdateHPThread(nowHp).start();\n }\n _bossHp.text = setText;\n }\n private function setTimeLimit(clear:Boolean=false):void\n {\n if (_selectPrf && !clear) {\n var startTime:Number = _selectPrf.createdAt.getTime();\n var closeTime:Number = 0.0;\n if (_selectPrf.closeAt) closeTime = _selectPrf.closeAt.getTime();\n var nowDate:Date = new Date();\n var nowTime:Number = nowDate.getTime();\n var max:int = Math.round(closeTime-startTime);\n var now:int = Math.round(closeTime-nowTime);\n _infoImage.limit = _timeGauge.timeLimitAlert;\n _timeGauge.setTime(now,max);\n _timeGauge.visible = true;\n timeGaugeUpdate();\n _timeGaugeUpdate = true;\n } else {\n _infoImage.limit = false;\n _timeGauge.setTime(0,0);\n _timeGauge.visible = false;\n _timeGaugeUpdate = false;\n }\n }\n private function timeGaugeUpdate():void\n {\n if (_selectPrf&&_selectPrf.closeAt) {\n _infoImage.limit = _timeGauge.timeLimitAlert;\n var closeTime:Number = _selectPrf.closeAt.getTime();\n var nowDate:Date = new Date();\n var nowTime:Number = nowDate.getTime();\n var now:int = Math.round(closeTime-nowTime);\n _timeGauge.getUpdateTimeThread(now).start();\n }\n }\n private function setItems(clear:Boolean=false):void\n {\n if (_selectPrf && !clear) {\n var setTexts:Array = [];\n var setData:Array = _selectPrf.profoundData.allItems;\n for (var i:int = 0; i < setData.length; i++) {\n var t:String = \"\";\n switch (setData[i][\"type\"])\n {\n case Const.TG_CHARA_CARD:\n var cc:CharaCard = CharaCard.ID(setData[i][\"id\"]);\n t = \"Lv\"+ cc.level + cc.name + \"×\" +setData[i][\"num\"].toString();\n break;\n case Const.TG_SLOT_CARD:\n switch (setData[i][\"sctType\"])\n {\n case Const.SCT_WEAPON:\n t = WeaponCard.ID(setData[i][\"id\"]).name + \"×\" +setData[i][\"num\"].toString();\n break;\n case Const.SCT_EQUIP:\n t = EquipCard.ID(setData[i][\"id\"]).name + \"×\" +setData[i][\"num\"].toString();\n break;\n case Const.SCT_EVENT:\n t = EventCard.ID(setData[i][\"id\"]).name + \"×\" +setData[i][\"num\"].toString();\n break;\n default:\n }\n break;\n case Const.TG_AVATAR_ITEM:\n t = AvatarItem.ID(setData[i][\"id\"]).name + \"×\" +setData[i][\"num\"].toString();\n break;\n case Const.TG_AVATAR_PART:\n t = AvatarPart.ID(setData[i][\"id\"]).name + \"×\" +setData[i][\"num\"].toString();\n break;\n case Const.TG_GEM:\n t = setData[i][\"num\"] + \"Gem\";\n break;\n case Const.TG_OWN_CARD:\n break;\n case Const.TG_NONE:\n case Const.TG_BONUS_GAME:\n default:\n }\n setTexts.push(t);\n }\n _itemsLabel.text = setTexts.join(\"、\");\n } else {\n _itemsLabel.text = \"\";\n }\n }\n private function updateBossHPHandler(e:Event):void\n {\n log.writeLog(log.LV_DEBUG, this,\"updateBossHPHandler !!!!!\");\n setBossHp();\n }\n\n private function rankNextButtonHandler():void\n {\n // log.writeLog(log.LV_FATAL, this,\"NextButtonHandler\", _rankPage);\n _rankPage -= 1;\n if (_rankPage < 0) _rankPage = 0;\n setRankPage(_rankPage);\n }\n private function rankBackButtonHandler():void\n {\n // log.writeLog(log.LV_FATAL, this,\"BackButtonHandler\", _rankPage);\n _rankPage += 1;\n if (_rankPage >= _ranking.pageMax) _rankPage = _ranking.pageMax - 1;\n setRankPage(_rankPage);\n }\n private function rankingUpdateHandler():void\n {\n // log.writeLog(log.LV_FATAL, this,\"rankingUpdateHandler\");\n setRankPage(_rankPage);\n }\n private function myRankUpdateHandler():void\n {\n // log.writeLog(log.LV_FATAL, this,\"myRankUpdateHandler\");\n if (_selectPrf) _ranking.updateMyRank(_selectPrf.id);\n }\n private function updateRankingHandler(e:Event):void\n {\n // log.writeLog(log.LV_FATAL, this,\"updateRankingHandler\");\n setRankPage(_rankPage);\n if (_selectPrf) _ranking.updateMyRank(_selectPrf.id);\n }\n public function updateRanking():void\n {\n log.writeLog(log.LV_FATAL, this,\"updateRanking\");\n if (_selectPrf) _ranking.resetRanking(_selectPrf.id);\n setRankPage(_rankPage);\n if (_selectPrf) _ranking.updateMyRank(_selectPrf.id);\n }\n private function updateDuration(e:Event):void\n {\n setCloseAtTime();\n if (_timeGaugeUpdate) {\n timeGaugeUpdate();\n }\n }\n\n public function get selectProfound():Profound\n {\n return _selectPrf;\n }\n\n private function setRankPage(p:int,clear:Boolean=false):void\n {\n // log.writeLog(log.LV_FATAL, this,\"setRankPage\",clear);\n var max:int = clear ? 1 : _ranking.pageMax;\n _infoImage.setPage(p+1,max);\n if (_selectPrf) {\n _ranking.pageChange(_selectPrf.id,p,clear);\n _ranking.updateMyRank(_selectPrf.id,clear);\n }\n }\n\n public function updateBtlPrfCount():void\n {\n _countLabel.text = ProfoundInventory.battleProfoundCount.toString();\n }\n\n // 選択中の渦へのリンクを返す\n public function get selectPrfURL():String\n {\n return (_selectPrf) ? _selectPrf.prfURL : \"\";\n }\n\n public function set infoMonsId(id:int):void\n {\n //_infoImage.monsterId = id;\n }\n }\n}\n\n\n"} +{"text": "set Path=%PATH%;C:\\laztoapk\\downloads\\android-sdk-windows\\platform-tools\nset GRADLE_HOME=C:\\laztoapk\\downloads\\gradle-4.10\\\nset PATH=%PATH%;%GRADLE_HOME%\\bin\ngradle clean build --info\n"} +{"text": "package org.telegram.ui.Components.voip;\n\nimport android.animation.Animator;\nimport android.animation.AnimatorListenerAdapter;\nimport android.animation.AnimatorSet;\nimport android.animation.ValueAnimator;\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Outline;\nimport android.graphics.PixelFormat;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Build;\nimport android.view.Gravity;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewConfiguration;\nimport android.view.ViewOutlineProvider;\nimport android.view.ViewParent;\nimport android.view.WindowManager;\nimport android.widget.FrameLayout;\nimport android.widget.ImageView;\n\nimport androidx.annotation.NonNull;\nimport androidx.core.content.ContextCompat;\nimport androidx.core.graphics.ColorUtils;\n\nimport org.telegram.messenger.AndroidUtilities;\nimport org.telegram.messenger.ApplicationLoader;\nimport org.telegram.messenger.FileLog;\nimport org.telegram.messenger.LocaleController;\nimport org.telegram.messenger.NotificationCenter;\nimport org.telegram.messenger.R;\nimport org.telegram.messenger.voip.Instance;\nimport org.telegram.messenger.voip.VideoCameraCapturer;\nimport org.telegram.messenger.voip.VoIPBaseService;\nimport org.telegram.messenger.voip.VoIPService;\nimport org.telegram.ui.Components.CubicBezierInterpolator;\nimport org.telegram.ui.Components.LayoutHelper;\nimport org.telegram.ui.LaunchActivity;\nimport org.telegram.ui.VoIPFragment;\n\npublic class VoIPPiPView implements VoIPBaseService.StateListener, NotificationCenter.NotificationCenterDelegate {\n\n public final static int ANIMATION_ENTER_TYPE_SCALE = 0;\n public final static int ANIMATION_ENTER_TYPE_TRANSITION = 1;\n public final static int ANIMATION_ENTER_TYPE_NONE = 3;\n\n private final static float SCALE_NORMAL = 0.25f;\n private final static float SCALE_EXPANDED = 0.4f;\n\n public FrameLayout windowView;\n public static boolean switchingToPip = false;\n FloatingView floatingView;\n\n private static VoIPPiPView instance;\n private static VoIPPiPView expandedInstance;\n public boolean expanded;\n private boolean expandedAnimationInProgress;\n private WindowManager windowManager;\n public WindowManager.LayoutParams windowLayoutParams;\n\n public final int parentWidth;\n public final int parentHeight;\n\n public static int topInset;\n public static int bottomInset;\n\n ImageView closeIcon;\n ImageView enlargeIcon;\n View topShadow;\n\n ValueAnimator expandAnimator;\n\n public final VoIPTextureView currentUserTextureView;\n public final VoIPTextureView callingUserTextureView;\n\n float progressToCameraMini;\n ValueAnimator animatorToCameraMini;\n ValueAnimator.AnimatorUpdateListener animatorToCameraMiniUpdater = valueAnimator -> {\n progressToCameraMini = (float) valueAnimator.getAnimatedValue();\n floatingView.invalidate();\n };\n\n float[] point = new float[2];\n int[] location = new int[2];\n\n public int xOffset;\n public int yOffset;\n\n boolean currentUserIsVideo;\n boolean callingUserIsVideo;\n\n float startX;\n float startY;\n boolean moving;\n long startTime;\n int animationIndex = -1;\n\n Runnable collapseRunnable = new Runnable() {\n @Override\n public void run() {\n if (instance != null) {\n instance.floatingView.expand(false);\n }\n }\n };\n\n AnimatorSet moveToBoundsAnimator;\n private ValueAnimator.AnimatorUpdateListener updateXlistener = new ValueAnimator.AnimatorUpdateListener() {\n @Override\n public void onAnimationUpdate(ValueAnimator valueAnimator) {\n float x = (float) valueAnimator.getAnimatedValue();\n windowLayoutParams.x = (int) x;\n if (windowView.getParent() != null) {\n windowManager.updateViewLayout(windowView, windowLayoutParams);\n }\n }\n };\n\n private ValueAnimator.AnimatorUpdateListener updateYlistener = new ValueAnimator.AnimatorUpdateListener() {\n @Override\n public void onAnimationUpdate(ValueAnimator valueAnimator) {\n float y = (float) valueAnimator.getAnimatedValue();\n windowLayoutParams.y = (int) y;\n if (windowView.getParent() != null) {\n windowManager.updateViewLayout(windowView, windowLayoutParams);\n }\n }\n };\n\n public static void show(Activity activity, int parentWidth, int parentHeight, int animationType) {\n if (instance != null || VideoCameraCapturer.eglBase == null) {\n return;\n }\n WindowManager.LayoutParams windowLayoutParams = createWindowLayoutParams(activity, parentWidth, parentHeight, SCALE_NORMAL);\n instance = new VoIPPiPView(activity, parentWidth, parentHeight, false);\n\n WindowManager wm = (WindowManager) activity.getSystemService(Context.WINDOW_SERVICE);\n instance.windowManager = wm;\n instance.windowLayoutParams = windowLayoutParams;\n SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(\"voippipconfig\", Context.MODE_PRIVATE);\n float x = preferences.getFloat(\"relativeX\", 1f);\n float y = preferences.getFloat(\"relativeY\", 0f);\n\n instance.setRelativePosition(x, y);\n NotificationCenter.getGlobalInstance().addObserver(instance, NotificationCenter.didEndCall);\n wm.addView(instance.windowView, windowLayoutParams);\n\n instance.currentUserTextureView.renderer.init(VideoCameraCapturer.eglBase.getEglBaseContext(), null);\n instance.callingUserTextureView.renderer.init(VideoCameraCapturer.eglBase.getEglBaseContext(), null);\n\n if (animationType == ANIMATION_ENTER_TYPE_SCALE) {\n instance.windowView.setScaleX(0.5f);\n instance.windowView.setScaleY(0.5f);\n instance.windowView.setAlpha(0f);\n instance.windowView.animate().alpha(1f).scaleY(1f).scaleX(1f).start();\n\n if (VoIPService.getSharedInstance() != null) {\n VoIPService.getSharedInstance().setSinks(instance.currentUserTextureView.renderer, instance.callingUserTextureView.renderer);\n }\n\n } else if (animationType == ANIMATION_ENTER_TYPE_TRANSITION) {\n instance.windowView.setAlpha(0f);\n\n if (VoIPService.getSharedInstance() != null) {\n VoIPService.getSharedInstance().setBackgroundSinks(instance.currentUserTextureView.renderer, instance.callingUserTextureView.renderer);\n }\n }\n }\n\n private static WindowManager.LayoutParams createWindowLayoutParams(Context context, int parentWidth, int parentHeight, float scale) {\n WindowManager.LayoutParams windowLayoutParams = new WindowManager.LayoutParams();\n\n int topPadding = (int) (parentHeight * SCALE_EXPANDED * 1.05f - parentHeight * SCALE_EXPANDED) / 2;\n int leftPadding = (int) (parentWidth * SCALE_EXPANDED * 1.05f - parentWidth * SCALE_EXPANDED) / 2;\n\n windowLayoutParams.height = (int) (parentHeight * scale + 2 * topPadding);\n windowLayoutParams.width = (int) (parentWidth * scale + 2 * leftPadding);\n\n windowLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;\n windowLayoutParams.format = PixelFormat.TRANSLUCENT;\n\n if (AndroidUtilities.checkInlinePermissions(context)) {\n if (Build.VERSION.SDK_INT >= 26) {\n windowLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;\n } else {\n windowLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;\n }\n } else {\n windowLayoutParams.type = WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;\n }\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n windowLayoutParams.flags |= WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;\n }\n\n windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |\n WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED |\n WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |\n WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |\n WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;\n\n return windowLayoutParams;\n }\n\n public static void prepareForTransition() {\n if (expandedInstance != null) {\n instance.expandAnimator.cancel();\n }\n }\n\n public static void finish() {\n if (switchingToPip) {\n return;\n }\n if (expandedInstance != null) {\n expandedInstance.finishInternal();\n }\n if (instance != null) {\n instance.finishInternal();\n }\n expandedInstance = null;\n instance = null;\n }\n\n public static boolean isExpanding() {\n return instance.expanded;\n }\n\n\n private void setRelativePosition(float x, float y) {\n float width = AndroidUtilities.displaySize.x;\n float height = AndroidUtilities.displaySize.y;\n\n float leftPadding = AndroidUtilities.dp(16);\n float rightPadding = AndroidUtilities.dp(16);\n float topPadding = AndroidUtilities.dp(60);\n float bottomPadding = AndroidUtilities.dp(16);\n\n float widthNormal = parentWidth * SCALE_NORMAL;\n float heightNormal = parentHeight * SCALE_NORMAL;\n\n float floatingWidth = floatingView.getMeasuredWidth() == 0 ? widthNormal : floatingView.getMeasuredWidth();\n float floatingHeight = floatingView.getMeasuredWidth() == 0 ? heightNormal : floatingView.getMeasuredHeight();\n\n windowLayoutParams.x = (int) (x * (width - leftPadding - rightPadding - floatingWidth) - (xOffset - leftPadding));\n windowLayoutParams.y = (int) (y * (height - topPadding - bottomPadding - floatingHeight) - (yOffset - topPadding));\n\n if (windowView.getParent() != null) {\n windowManager.updateViewLayout(windowView, windowLayoutParams);\n }\n }\n\n public static VoIPPiPView getInstance() {\n if (expandedInstance != null) {\n return expandedInstance;\n }\n return instance;\n }\n\n public VoIPPiPView(@NonNull Context context, int parentWidth, int parentHeight, boolean expanded) {\n this.parentWidth = parentWidth;\n this.parentHeight = parentHeight;\n\n yOffset = (int) (parentHeight * SCALE_EXPANDED * 1.05f - parentHeight * SCALE_EXPANDED) / 2;\n xOffset = (int) (parentWidth * SCALE_EXPANDED * 1.05f - parentWidth * SCALE_EXPANDED) / 2;\n\n Drawable outerDrawable = ContextCompat.getDrawable(context, R.drawable.calls_pip_outershadow);\n windowView = new FrameLayout(context) {\n @Override\n protected void onDraw(Canvas canvas) {\n canvas.save();\n canvas.scale(floatingView.getScaleX(), floatingView.getScaleY(), floatingView.getLeft() + floatingView.getPivotX(), floatingView.getTop() + floatingView.getPivotY());\n outerDrawable.setBounds(\n floatingView.getLeft() - AndroidUtilities.dp(2),\n floatingView.getTop() - AndroidUtilities.dp(2),\n floatingView.getRight() + AndroidUtilities.dp(2),\n floatingView.getBottom() + AndroidUtilities.dp(2)\n );\n outerDrawable.draw(canvas);\n canvas.restore();\n super.onDraw(canvas);\n\n }\n };\n windowView.setWillNotDraw(false);\n windowView.setPadding(xOffset, yOffset, xOffset, yOffset);\n floatingView = new FloatingView(context);\n\n\n callingUserTextureView = new VoIPTextureView(context, false);\n currentUserTextureView = new VoIPTextureView(context, false);\n currentUserTextureView.renderer.setMirror(true);\n\n floatingView.addView(callingUserTextureView);\n floatingView.addView(currentUserTextureView);\n floatingView.setBackgroundColor(Color.GRAY);\n windowView.addView(floatingView);\n windowView.setClipChildren(false);\n windowView.setClipToPadding(false);\n\n if (expanded) {\n topShadow = new View(context);\n topShadow.setBackground(new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtils.setAlphaComponent(Color.BLACK, (int) (255 * 0.3f)), Color.TRANSPARENT}));\n floatingView.addView(topShadow, FrameLayout.LayoutParams.MATCH_PARENT, AndroidUtilities.dp(60));\n\n closeIcon = new ImageView(context);\n closeIcon.setImageResource(R.drawable.pip_close);\n closeIcon.setPadding(AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8));\n closeIcon.setContentDescription(LocaleController.getString(\"Close\", R.string.Close));\n floatingView.addView(closeIcon, LayoutHelper.createFrame(40, 40, Gravity.TOP | Gravity.RIGHT, 4, 4, 4, 0));\n\n enlargeIcon = new ImageView(context);\n enlargeIcon.setImageResource(R.drawable.pip_enlarge);\n enlargeIcon.setPadding(AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8));\n enlargeIcon.setContentDescription(LocaleController.getString(\"Open\", R.string.Open));\n floatingView.addView(enlargeIcon, LayoutHelper.createFrame(40, 40, Gravity.TOP | Gravity.LEFT, 4, 4, 4, 0));\n\n closeIcon.setOnClickListener((v) -> {\n VoIPService service = VoIPService.getSharedInstance();\n if (service != null) {\n service.hangUp();\n } else {\n finish();\n }\n });\n\n\n enlargeIcon.setOnClickListener((v) -> {\n if (context instanceof LaunchActivity && !ApplicationLoader.mainInterfacePaused) {\n VoIPFragment.show((Activity) context);\n } else if (context instanceof LaunchActivity) {\n Intent intent = new Intent(context, LaunchActivity.class);\n intent.setAction(\"voip\");\n context.startActivity(intent);\n }\n });\n }\n\n VoIPService service = VoIPService.getSharedInstance();\n if (service != null) {\n service.registerStateListener(this);\n }\n updateViewState();\n }\n\n private void finishInternal() {\n currentUserTextureView.renderer.release();\n callingUserTextureView.renderer.release();\n VoIPService service = VoIPService.getSharedInstance();\n if (service != null) {\n service.unregisterStateListener(this);\n }\n windowView.setVisibility(View.GONE);\n if (windowView.getParent() != null) {\n floatingView.getRelativePosition(point);\n float x = Math.min(1f, Math.max(0f, point[0]));\n float y = Math.min(1f, Math.max(0f, point[1]));\n SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(\"voippipconfig\", Context.MODE_PRIVATE);\n preferences.edit()\n .putFloat(\"relativeX\", x)\n .putFloat(\"relativeY\", y)\n .apply();\n\n try {\n windowManager.removeView(windowView);\n } catch (Throwable e) {\n FileLog.e(e);\n }\n }\n NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didEndCall);\n }\n\n @Override\n public void onStateChanged(int state) {\n if (state == VoIPBaseService.STATE_ENDED || state == VoIPService.STATE_BUSY || state == VoIPService.STATE_FAILED || state == VoIPService.STATE_HANGING_UP) {\n AndroidUtilities.runOnUIThread(() -> finish(), 200);\n }\n VoIPService service = VoIPService.getSharedInstance();\n if (service == null) {\n finish();\n return;\n }\n if (state == VoIPService.STATE_ESTABLISHED && !service.isVideoAvailable()) {\n finish();\n return;\n }\n updateViewState();\n }\n\n @Override\n public void onSignalBarsCountChanged(int count) {\n\n }\n\n @Override\n public void onAudioSettingsChanged() {\n\n }\n\n @Override\n public void onMediaStateUpdated(int audioState, int videoState) {\n updateViewState();\n }\n\n @Override\n public void onCameraSwitch(boolean isFrontFace) {\n updateViewState();\n }\n\n @Override\n public void onVideoAvailableChange(boolean isAvailable) {\n\n }\n\n @Override\n public void onScreenOnChange(boolean screenOn) {\n VoIPService service = VoIPService.getSharedInstance();\n if (service == null) {\n return;\n }\n if (!screenOn && currentUserIsVideo) {\n service.setVideoState(Instance.VIDEO_STATE_PAUSED);\n } else if (screenOn && service.getVideoState() == Instance.VIDEO_STATE_PAUSED) {\n service.setVideoState(Instance.VIDEO_STATE_ACTIVE);\n }\n }\n\n private void updateViewState() {\n boolean animated = floatingView.getMeasuredWidth() != 0;\n boolean callingUserWasVideo = callingUserIsVideo;\n\n VoIPService service = VoIPService.getSharedInstance();\n if (service != null) {\n callingUserIsVideo = service.getCurrentVideoState() == Instance.VIDEO_STATE_ACTIVE;\n currentUserIsVideo = service.getVideoState() == Instance.VIDEO_STATE_ACTIVE || service.getVideoState() == Instance.VIDEO_STATE_PAUSED;\n currentUserTextureView.renderer.setMirror(service.isFrontFaceCamera());\n }\n\n if (!animated) {\n progressToCameraMini = callingUserIsVideo ? 1f : 0f;\n } else {\n if (callingUserWasVideo != callingUserIsVideo) {\n if (animatorToCameraMini != null) {\n animatorToCameraMini.cancel();\n }\n animatorToCameraMini = ValueAnimator.ofFloat(progressToCameraMini, callingUserIsVideo ? 1f : 0f);\n animatorToCameraMini.addUpdateListener(animatorToCameraMiniUpdater);\n animatorToCameraMini.setDuration(300).setInterpolator(CubicBezierInterpolator.DEFAULT);\n animatorToCameraMini.start();\n }\n }\n\n }\n\n public void onTransitionEnd() {\n if (VoIPService.getSharedInstance() != null) {\n VoIPService.getSharedInstance().swapSinks();\n }\n }\n\n public void onPause() {\n if (windowLayoutParams.type == WindowManager.LayoutParams.LAST_APPLICATION_WINDOW) {\n VoIPService service = VoIPService.getSharedInstance();\n if (currentUserIsVideo) {\n service.setVideoState(Instance.VIDEO_STATE_PAUSED);\n }\n }\n }\n\n\n public void onResume() {\n VoIPService service = VoIPService.getSharedInstance();\n if (service != null && service.getVideoState() == Instance.VIDEO_STATE_PAUSED) {\n service.setVideoState(Instance.VIDEO_STATE_ACTIVE);\n }\n }\n\n @Override\n public void didReceivedNotification(int id, int account, Object... args) {\n if (id == NotificationCenter.didEndCall) {\n finish();\n }\n }\n\n\n private class FloatingView extends FrameLayout {\n\n float touchSlop;\n\n float leftPadding;\n float rightPadding;\n float topPadding;\n float bottomPadding;\n\n public FloatingView(@NonNull Context context) {\n super(context);\n\n touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n setOutlineProvider(new ViewOutlineProvider() {\n @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n @Override\n public void getOutline(View view, Outline outline) {\n outline.setRoundRect(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight(), 1f / view.getScaleX() * AndroidUtilities.dp(4));\n }\n });\n setClipToOutline(true);\n }\n }\n\n @Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n leftPadding = AndroidUtilities.dp(16);\n rightPadding = AndroidUtilities.dp(16);\n topPadding = AndroidUtilities.dp(60);\n bottomPadding = AndroidUtilities.dp(16);\n }\n\n @Override\n protected void dispatchDraw(Canvas canvas) {\n currentUserTextureView.setPivotX(callingUserTextureView.getMeasuredWidth());\n currentUserTextureView.setPivotY(callingUserTextureView.getMeasuredHeight());\n currentUserTextureView.setTranslationX(-AndroidUtilities.dp(4) * (1f / getScaleX()) * progressToCameraMini);\n currentUserTextureView.setTranslationY(-AndroidUtilities.dp(4) * (1f / getScaleY()) * progressToCameraMini);\n currentUserTextureView.setRoundCorners(AndroidUtilities.dp(8) * (1f / getScaleY()) * progressToCameraMini);\n currentUserTextureView.setScaleX(0.4f + 0.6f * (1f - progressToCameraMini));\n currentUserTextureView.setScaleY(0.4f + 0.6f * (1f - progressToCameraMini));\n super.dispatchDraw(canvas);\n }\n\n @Override\n public boolean onTouchEvent(MotionEvent event) {\n if (expandedAnimationInProgress || switchingToPip || instance == null) {\n return false;\n }\n AndroidUtilities.cancelRunOnUIThread(collapseRunnable);\n float x = event.getRawX();\n float y = event.getRawY();\n ViewParent parent = getParent();\n switch (event.getAction()) {\n case MotionEvent.ACTION_DOWN:\n startX = x;\n startY = y;\n startTime = System.currentTimeMillis();\n // animate().scaleY(1.05f).scaleX(1.05f).setDuration(150).start();\n if (moveToBoundsAnimator != null) {\n moveToBoundsAnimator.cancel();\n }\n break;\n case MotionEvent.ACTION_MOVE:\n float dx = x - startX;\n float dy = y - startY;\n if (!moving && (dx * dx + dy * dy) > touchSlop * touchSlop) {\n if (parent != null) {\n parent.requestDisallowInterceptTouchEvent(true);\n }\n moving = true;\n startX = x;\n startY = y;\n dx = 0;\n dy = 0;\n }\n if (moving) {\n windowLayoutParams.x += dx;\n windowLayoutParams.y += dy;\n startX = x;\n startY = y;\n if (windowView.getParent() != null) {\n windowManager.updateViewLayout(windowView, windowLayoutParams);\n }\n }\n break;\n case MotionEvent.ACTION_CANCEL:\n case MotionEvent.ACTION_UP:\n // animate().scaleX(1f).scaleY(1f).start();\n if (moveToBoundsAnimator != null) {\n moveToBoundsAnimator.cancel();\n }\n if (event.getAction() == MotionEvent.ACTION_UP && !moving && System.currentTimeMillis() - startTime < 150) {\n instance.floatingView.expand(!instance.expanded);\n moving = false;\n return false;\n }\n if (parent != null) {\n parent.requestDisallowInterceptTouchEvent(false);\n\n int parentWidth = AndroidUtilities.displaySize.x;\n int parentHeight = AndroidUtilities.displaySize.y + topInset;\n\n float maxTop = topPadding;\n float maxBottom = bottomPadding;\n\n float left = windowLayoutParams.x + floatingView.getLeft();\n float right = left + floatingView.getMeasuredWidth();\n float top = windowLayoutParams.y + floatingView.getTop();\n float bottom = top + floatingView.getMeasuredHeight();\n\n moveToBoundsAnimator = new AnimatorSet();\n\n if (left < leftPadding) {\n ValueAnimator animator = ValueAnimator.ofFloat(windowLayoutParams.x, leftPadding - floatingView.getLeft());\n animator.addUpdateListener(updateXlistener);\n moveToBoundsAnimator.playTogether(animator);\n } else if (right > parentWidth - rightPadding) {\n ValueAnimator animator = ValueAnimator.ofFloat(windowLayoutParams.x, parentWidth - floatingView.getRight() - rightPadding);\n animator.addUpdateListener(updateXlistener);\n moveToBoundsAnimator.playTogether(animator);\n }\n\n if (top < maxTop) {\n ValueAnimator animator = ValueAnimator.ofFloat(windowLayoutParams.y, maxTop - floatingView.getTop());\n animator.addUpdateListener(updateYlistener);\n moveToBoundsAnimator.playTogether(animator);\n } else if (bottom > parentHeight - maxBottom) {\n ValueAnimator animator = ValueAnimator.ofFloat(windowLayoutParams.y, parentHeight - floatingView.getMeasuredHeight() - maxBottom);\n animator.addUpdateListener(updateYlistener);\n moveToBoundsAnimator.playTogether(animator);\n }\n moveToBoundsAnimator.setDuration(150).setInterpolator(CubicBezierInterpolator.DEFAULT);\n moveToBoundsAnimator.start();\n }\n moving = false;\n if (instance.expanded) {\n AndroidUtilities.runOnUIThread(collapseRunnable, 3000);\n }\n break;\n }\n return true;\n }\n\n private void getRelativePosition(float[] point) {\n float width = AndroidUtilities.displaySize.x;\n float height = AndroidUtilities.displaySize.y;\n\n point[0] = (windowLayoutParams.x + floatingView.getLeft() - leftPadding) / (width - leftPadding - rightPadding - floatingView.getMeasuredWidth());\n point[1] = (windowLayoutParams.y + floatingView.getTop() - topPadding) / (height - topPadding - bottomPadding - floatingView.getMeasuredHeight());\n point[0] = Math.min(1f, Math.max(0, point[0]));\n point[1] = Math.min(1f, Math.max(0, point[1]));\n }\n\n private void expand(boolean expanded) {\n AndroidUtilities.cancelRunOnUIThread(collapseRunnable);\n if (instance == null || expandedAnimationInProgress || instance.expanded == expanded) {\n return;\n }\n instance.expanded = expanded;\n\n float widthNormal = parentWidth * SCALE_NORMAL + 2 * xOffset;\n float heightNormal = parentHeight * SCALE_NORMAL + 2 * yOffset;\n\n float widthExpanded = parentWidth * SCALE_EXPANDED + 2 * xOffset;\n float heightExpanded = parentHeight * SCALE_EXPANDED + 2 * yOffset;\n\n expandedAnimationInProgress = true;\n if (expanded) {\n WindowManager.LayoutParams layoutParams = createWindowLayoutParams(instance.windowView.getContext(), parentWidth, parentHeight, SCALE_EXPANDED);\n VoIPPiPView pipViewExpanded = new VoIPPiPView(getContext(), parentWidth, parentHeight, true);\n\n getRelativePosition(point);\n float cX = point[0];\n float cY = point[1];\n\n layoutParams.x = (int) (windowLayoutParams.x - (widthExpanded - widthNormal) * cX);\n layoutParams.y = (int) (windowLayoutParams.y - (heightExpanded - heightNormal) * cY);\n\n windowManager.addView(pipViewExpanded.windowView, layoutParams);\n pipViewExpanded.windowView.setAlpha(1f);\n pipViewExpanded.windowLayoutParams = layoutParams;\n pipViewExpanded.windowManager = windowManager;\n expandedInstance = pipViewExpanded;\n\n swapRender(instance, expandedInstance);\n\n float scale = SCALE_NORMAL / SCALE_EXPANDED * floatingView.getScaleX();\n\n pipViewExpanded.floatingView.setPivotX(cX * parentWidth * SCALE_EXPANDED);\n pipViewExpanded.floatingView.setPivotY(cY * parentHeight * SCALE_EXPANDED);\n pipViewExpanded.floatingView.setScaleX(scale);\n pipViewExpanded.floatingView.setScaleY(scale);\n expandedInstance.topShadow.setAlpha(0f);\n expandedInstance.closeIcon.setAlpha(0f);\n expandedInstance.enlargeIcon.setAlpha(0f);\n\n AndroidUtilities.runOnUIThread(() -> {\n if (expandedInstance == null) {\n return;\n }\n\n windowView.setAlpha(0f);\n try {\n windowManager.removeView(windowView);\n } catch (Throwable e) {\n FileLog.e(e);\n }\n animate().cancel();\n\n float animateToScale = 1f;\n\n showUi(true);\n ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1f);\n valueAnimator.addUpdateListener(a -> {\n float v = (float) a.getAnimatedValue();\n float sc = scale * (1f - v) + animateToScale * v;\n pipViewExpanded.floatingView.setScaleX(sc);\n pipViewExpanded.floatingView.setScaleY(sc);\n pipViewExpanded.floatingView.invalidate();\n pipViewExpanded.windowView.invalidate();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n pipViewExpanded.floatingView.invalidateOutline();\n }\n });\n valueAnimator.addListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n expandedAnimationInProgress = false;\n }\n });\n valueAnimator.setDuration(300).setInterpolator(CubicBezierInterpolator.DEFAULT);\n valueAnimator.start();\n expandAnimator = valueAnimator;\n }, 64);\n } else {\n if (expandedInstance == null) {\n return;\n }\n expandedInstance.floatingView.getRelativePosition(point);\n float cX = point[0];\n float cY = point[1];\n\n instance.windowLayoutParams.x = (int) (expandedInstance.windowLayoutParams.x + (widthExpanded - widthNormal) * cX);\n instance.windowLayoutParams.y = (int) (expandedInstance.windowLayoutParams.y + (heightExpanded - heightNormal) * cY);\n\n float scale = SCALE_NORMAL / SCALE_EXPANDED * floatingView.getScaleX();\n\n expandedInstance.floatingView.setPivotX(cX * parentWidth * SCALE_EXPANDED);\n expandedInstance.floatingView.setPivotY(cY * parentHeight * SCALE_EXPANDED);\n\n showUi(false);\n ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1f);\n valueAnimator.addUpdateListener(a -> {\n float v = (float) a.getAnimatedValue();\n float sc = (1f - v) + scale * v;\n if (expandedInstance != null) {\n expandedInstance.floatingView.setScaleX(sc);\n expandedInstance.floatingView.setScaleY(sc);\n expandedInstance.floatingView.invalidate();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n expandedInstance.floatingView.invalidateOutline();\n }\n expandedInstance.windowView.invalidate();\n }\n });\n valueAnimator.setDuration(300).setInterpolator(CubicBezierInterpolator.DEFAULT);\n valueAnimator.addListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n if (expandedInstance == null) {\n return;\n }\n swapRender(expandedInstance, instance);\n instance.windowView.setAlpha(1f);\n windowManager.addView(instance.windowView, instance.windowLayoutParams);\n AndroidUtilities.runOnUIThread(() -> {\n if (instance == null || expandedInstance == null) {\n return;\n }\n expandedInstance.windowView.setAlpha(0);\n expandedInstance.finishInternal();\n expandedAnimationInProgress = false;\n if (expanded) {\n AndroidUtilities.runOnUIThread(collapseRunnable, 3000);\n }\n }, 64);\n }\n });\n valueAnimator.start();\n expandAnimator = valueAnimator;\n }\n }\n\n private void showUi(boolean show) {\n if (expandedInstance == null) {\n return;\n }\n if (show) {\n expandedInstance.topShadow.setAlpha(0f);\n expandedInstance.closeIcon.setAlpha(0f);\n expandedInstance.enlargeIcon.setAlpha(0f);\n }\n expandedInstance.topShadow.animate().alpha(show ? 1f : 0).setDuration(300).setInterpolator(CubicBezierInterpolator.DEFAULT).start();\n expandedInstance.closeIcon.animate().alpha(show ? 1f : 0).setDuration(300).setInterpolator(CubicBezierInterpolator.DEFAULT).start();\n expandedInstance.enlargeIcon.animate().alpha(show ? 1f : 0).setDuration(300).setInterpolator(CubicBezierInterpolator.DEFAULT).start();\n }\n\n private void swapRender(VoIPPiPView from, VoIPPiPView to) {\n to.currentUserTextureView.setStub(from.currentUserTextureView);\n to.callingUserTextureView.setStub(from.callingUserTextureView);\n from.currentUserTextureView.renderer.release();\n from.callingUserTextureView.renderer.release();\n if (VideoCameraCapturer.eglBase == null) {\n return;\n }\n to.currentUserTextureView.renderer.init(VideoCameraCapturer.eglBase.getEglBaseContext(), null);\n to.callingUserTextureView.renderer.init(VideoCameraCapturer.eglBase.getEglBaseContext(), null);\n\n if (VoIPService.getSharedInstance() != null) {\n VoIPService.getSharedInstance().setSinks(to.currentUserTextureView.renderer, to.callingUserTextureView.renderer);\n }\n }\n }\n}\n"} +{"text": "fileFormatVersion: 2\nguid: 284de240e9b728e46a532ce45b7a4664\nfolderAsset: yes\ntimeCreated: 1461490137\nlicenseType: Pro\nDefaultImporter:\n userData: \n assetBundleName: \n assetBundleVariant: \n"} +{"text": "select * from person;\nselect * from person\n"} +{"text": "/**\n * Copyright (c) 2015, Jozef Stefan Institute, Quintelligence d.o.o. and contributors\n * All rights reserved.\n * \n * This source code is licensed under the FreeBSD license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nmodule.exports = exports = function (pathQmBinary) { \n var qm = require(pathQmBinary); // This loads only c++ functions of qm\n exports = qm.statistics;\n\n //!STARTJSDOC\n\n /**\n\t * Calculates the z-score for a point sampled from a Gaussian distribution. The z-score indicates\n\t * how many standard deviations an element is from the meam and can be calculated using\n\t * the following formula: `z = (x - mu) / sigma`.\n\t * @param {Number} x - The sampled point.\n\t * @param {Number} mu - Mean of the distribution.\n\t * @param {Number} sigma - Variance of the distribution.\n * @returns {number} The z-score of the sampled point.\n * @example\n * // import modules\n * var stat = require('qminer').statistics;\n * // calculate the z-score of the sampled point\n * var point = 10;\n * var mu = 5;\n * var sigma = 5;\n * var zScore = stat.getZScore(point, mu, sigma); // returns 1\n\t */\n exports.getZScore = function (x, mu, sigma) {\n \treturn (x - mu) / sigma;\n }\n \n //!ENDJSDOC\n\n return exports;\n}"} +{"text": "// Package errors provides simple error handling primitives.\n//\n// The traditional error handling idiom in Go is roughly akin to\n//\n// if err != nil {\n// return err\n// }\n//\n// which applied recursively up the call stack results in error reports\n// without context or debugging information. The errors package allows\n// programmers to add context to the failure path in their code in a way\n// that does not destroy the original value of the error.\n//\n// Adding context to an error\n//\n// The errors.Wrap function returns a new error that adds context to the\n// original error by recording a stack trace at the point Wrap is called,\n// and the supplied message. For example\n//\n// _, err := ioutil.ReadAll(r)\n// if err != nil {\n// return errors.Wrap(err, \"read failed\")\n// }\n//\n// If additional control is required the errors.WithStack and errors.WithMessage\n// functions destructure errors.Wrap into its component operations of annotating\n// an error with a stack trace and an a message, respectively.\n//\n// Retrieving the cause of an error\n//\n// Using errors.Wrap constructs a stack of errors, adding context to the\n// preceding error. Depending on the nature of the error it may be necessary\n// to reverse the operation of errors.Wrap to retrieve the original error\n// for inspection. Any error value which implements this interface\n//\n// type causer interface {\n// Cause() error\n// }\n//\n// can be inspected by errors.Cause. errors.Cause will recursively retrieve\n// the topmost error which does not implement causer, which is assumed to be\n// the original cause. For example:\n//\n// switch err := errors.Cause(err).(type) {\n// case *MyError:\n// // handle specifically\n// default:\n// // unknown error\n// }\n//\n// causer interface is not exported by this package, but is considered a part\n// of stable public API.\n//\n// Formatted printing of errors\n//\n// All error values returned from this package implement fmt.Formatter and can\n// be formatted by the fmt package. The following verbs are supported\n//\n// %s print the error. If the error has a Cause it will be\n// printed recursively\n// %v see %s\n// %+v extended format. Each Frame of the error's StackTrace will\n// be printed in detail.\n//\n// Retrieving the stack trace of an error or wrapper\n//\n// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are\n// invoked. This information can be retrieved with the following interface.\n//\n// type stackTracer interface {\n// StackTrace() errors.StackTrace\n// }\n//\n// Where errors.StackTrace is defined as\n//\n// type StackTrace []Frame\n//\n// The Frame type represents a call site in the stack trace. Frame supports\n// the fmt.Formatter interface that can be used for printing information about\n// the stack trace of this error. For example:\n//\n// if err, ok := err.(stackTracer); ok {\n// for _, f := range err.StackTrace() {\n// fmt.Printf(\"%+s:%d\", f)\n// }\n// }\n//\n// stackTracer interface is not exported by this package, but is considered a part\n// of stable public API.\n//\n// See the documentation for Frame.Format for more details.\npackage errors\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n// New returns an error with the supplied message.\n// New also records the stack trace at the point it was called.\nfunc New(message string) error {\n\treturn &fundamental{\n\t\tmsg: message,\n\t\tstack: callers(),\n\t}\n}\n\n// Errorf formats according to a format specifier and returns the string\n// as a value that satisfies error.\n// Errorf also records the stack trace at the point it was called.\nfunc Errorf(format string, args ...interface{}) error {\n\treturn &fundamental{\n\t\tmsg: fmt.Sprintf(format, args...),\n\t\tstack: callers(),\n\t}\n}\n\n// fundamental is an error that has a message and a stack, but no caller.\ntype fundamental struct {\n\tmsg string\n\t*stack\n}\n\nfunc (f *fundamental) Error() string { return f.msg }\n\nfunc (f *fundamental) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tio.WriteString(s, f.msg)\n\t\t\tf.stack.Format(s, verb)\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tcase 's':\n\t\tio.WriteString(s, f.msg)\n\tcase 'q':\n\t\tfmt.Fprintf(s, \"%q\", f.msg)\n\t}\n}\n\n// WithStack annotates err with a stack trace at the point WithStack was called.\n// If err is nil, WithStack returns nil.\nfunc WithStack(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\treturn &withStack{\n\t\terr,\n\t\tcallers(),\n\t}\n}\n\ntype withStack struct {\n\terror\n\t*stack\n}\n\nfunc (w *withStack) Cause() error { return w.error }\n\nfunc (w *withStack) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tfmt.Fprintf(s, \"%+v\", w.Cause())\n\t\t\tw.stack.Format(s, verb)\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tcase 's':\n\t\tio.WriteString(s, w.Error())\n\tcase 'q':\n\t\tfmt.Fprintf(s, \"%q\", w.Error())\n\t}\n}\n\n// Wrap returns an error annotating err with a stack trace\n// at the point Wrap is called, and the supplied message.\n// If err is nil, Wrap returns nil.\nfunc Wrap(err error, message string) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\terr = &withMessage{\n\t\tcause: err,\n\t\tmsg: message,\n\t}\n\treturn &withStack{\n\t\terr,\n\t\tcallers(),\n\t}\n}\n\n// Wrapf returns an error annotating err with a stack trace\n// at the point Wrapf is call, and the format specifier.\n// If err is nil, Wrapf returns nil.\nfunc Wrapf(err error, format string, args ...interface{}) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\terr = &withMessage{\n\t\tcause: err,\n\t\tmsg: fmt.Sprintf(format, args...),\n\t}\n\treturn &withStack{\n\t\terr,\n\t\tcallers(),\n\t}\n}\n\n// WithMessage annotates err with a new message.\n// If err is nil, WithMessage returns nil.\nfunc WithMessage(err error, message string) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\treturn &withMessage{\n\t\tcause: err,\n\t\tmsg: message,\n\t}\n}\n\ntype withMessage struct {\n\tcause error\n\tmsg string\n}\n\nfunc (w *withMessage) Error() string { return w.msg + \": \" + w.cause.Error() }\nfunc (w *withMessage) Cause() error { return w.cause }\n\nfunc (w *withMessage) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tfmt.Fprintf(s, \"%+v\\n\", w.Cause())\n\t\t\tio.WriteString(s, w.msg)\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tcase 's', 'q':\n\t\tio.WriteString(s, w.Error())\n\t}\n}\n\n// Cause returns the underlying cause of the error, if possible.\n// An error value has a cause if it implements the following\n// interface:\n//\n// type causer interface {\n// Cause() error\n// }\n//\n// If the error does not implement Cause, the original error will\n// be returned. If the error is nil, nil will be returned without further\n// investigation.\nfunc Cause(err error) error {\n\ttype causer interface {\n\t\tCause() error\n\t}\n\n\tfor err != nil {\n\t\tcause, ok := err.(causer)\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\terr = cause.Cause()\n\t}\n\treturn err\n}\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.camel.component.hipchat;\n\nimport java.net.URI;\nimport java.util.Map;\n\nimport org.apache.camel.CamelContext;\nimport org.apache.camel.Endpoint;\nimport org.apache.camel.spi.annotations.Component;\nimport org.apache.camel.support.DefaultComponent;\nimport org.apache.camel.util.URISupport;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * Represents the component that manages {@link HipchatEndpoint}. Hipchat is an Atlassian software for team chat.\n *\n * The hipchat component uses the OAuth2 Hipchat API to produce/consume messages. For more details about Hipchat API\n * \n * @see Hipchat API. You can get the Oauth2 auth token at @see\n * Hipchat Auth Token. The messages produced and consumed would\n * be from/to owner of the provided auth token.\n */\n@Component(\"hipchat\")\npublic class HipchatComponent extends DefaultComponent {\n\n private static final Logger LOG = LoggerFactory.getLogger(HipchatComponent.class);\n\n public HipchatComponent() {\n }\n\n public HipchatComponent(CamelContext context) {\n super(context);\n }\n\n @Override\n protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {\n HipchatEndpoint endpoint = getHipchatEndpoint(uri);\n setProperties(endpoint, parameters);\n if (endpoint.getConfiguration().getAuthToken() == null) {\n throw new HipchatException(\"OAuth 2 auth token must be specified\");\n }\n parseUri(remaining, endpoint);\n LOG.debug(\"Using Hipchat API URL: {}\", endpoint.getConfiguration().hipChatUrl());\n return endpoint;\n }\n\n private void parseUri(String remaining, HipchatEndpoint endpoint) throws Exception {\n String uri = URISupport.normalizeUri(remaining);\n\n URI hipChatUri = new URI(uri);\n if (hipChatUri.getHost() != null) {\n endpoint.getConfiguration().setHost(hipChatUri.getHost());\n if (hipChatUri.getPort() != -1) {\n endpoint.getConfiguration().setPort(hipChatUri.getPort());\n }\n endpoint.getConfiguration().setProtocol(hipChatUri.getScheme());\n }\n }\n\n protected HipchatEndpoint getHipchatEndpoint(String uri) {\n return new HipchatEndpoint(uri, this);\n }\n}\n"} +{"text": "\n\n\n\n\n\nwxSQLite3: Member List\n\n\n\n\n\n\n
\n
\n\n \n \n \n \n \n
\n
wxSQLite3\n  3.0.4\n
\n
\n
\n\n\n
\n \n
\n \n
\n
\n
\n
wxSQLite3FunctionContext Member List
\n
\n
\n\n

This is the complete list of members for wxSQLite3FunctionContext, including all inherited members.

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
ExecAggregateFinalize(void *ctx)wxSQLite3FunctionContextstatic
ExecAggregateStep(void *ctx, int argc, void **argv)wxSQLite3FunctionContextstatic
ExecAuthorizer(void *, int type, const char *arg1, const char *arg2, const char *arg3, const char *arg4)wxSQLite3FunctionContextstatic
ExecCommitHook(void *hook)wxSQLite3FunctionContextstatic
ExecRollbackHook(void *hook)wxSQLite3FunctionContextstatic
ExecScalarFunction(void *ctx, int argc, void **argv)wxSQLite3FunctionContextstatic
ExecUpdateHook(void *hook, int type, const char *database, const char *table, wxsqlite_int64 rowid)wxSQLite3FunctionContextstatic
ExecWriteAheadLogHook(void *hook, void *dbHandle, const char *database, int numPages)wxSQLite3FunctionContextstatic
GetAggregateCount()wxSQLite3FunctionContext
GetAggregateStruct(int len)wxSQLite3FunctionContext
GetArgCount()wxSQLite3FunctionContext
GetArgType(int argIndex)wxSQLite3FunctionContext
GetBlob(int argIndex, int &len)wxSQLite3FunctionContext
GetBlob(int argIndex, wxMemoryBuffer &buffer)wxSQLite3FunctionContext
GetDouble(int argIndex, double nullValue=0)wxSQLite3FunctionContext
GetInt(int argIndex, int nullValue=0)wxSQLite3FunctionContext
GetInt64(int argIndex, wxLongLong nullValue=0)wxSQLite3FunctionContext
GetString(int argIndex, const wxString &nullValue=wxEmptyString)wxSQLite3FunctionContext
IsNull(int argIndex)wxSQLite3FunctionContext
SetResult(int value)wxSQLite3FunctionContext
SetResult(wxLongLong value)wxSQLite3FunctionContext
SetResult(double value)wxSQLite3FunctionContext
SetResult(const wxString &value)wxSQLite3FunctionContext
SetResult(unsigned char *value, int len)wxSQLite3FunctionContext
SetResult(const wxMemoryBuffer &buffer)wxSQLite3FunctionContext
SetResultArg(int argIndex)wxSQLite3FunctionContext
SetResultError(const wxString &errmsg)wxSQLite3FunctionContext
SetResultNull()wxSQLite3FunctionContext
SetResultZeroBlob(int blobSize)wxSQLite3FunctionContext
\n\n
\nGenerated on Thu Aug 29 2013 10:05:54 for wxSQLite3 by  \n\"doxygen\"/\n 1.8.5\n
\n\n\n"} +{"text": "namespace FSharpx\n\nmodule Async =\n open Operators\n open FSharpx.Collections\n \n /// Sequentially compose two actions, passing any value produced by the second as an argument to the first.\n let inline bind f m = async.Bind(m,f)\n /// Inject a value into the async type\n let inline returnM x = returnM async x\n /// Sequentially compose two actions, passing any value produced by the first as an argument to the second.\n let inline (>>=) m f = bindM async m f\n /// Flipped >>=\n let inline (=<<) f m = bindM async m f\n /// Sequential application\n let inline (<*>) f m = applyM async async f m\n /// Sequential application\n let inline ap m f = f <*> m\n /// Flipped map\n let inline pipe m f = liftM async f m\n let inline pipe2 x y f = returnM f <*> x <*> y\n let inline pipe3 x y z f = returnM f <*> x <*> y <*> z\n /// Transforms an async value by using a specified mapping function.\n let inline map f m = pipe m f\n /// Promote a function to a monad/applicative, scanning the monadic/applicative arguments from left to right.\n let inline lift2 f x y = returnM f <*> x <*> y\n /// Infix map\n let inline () f m = pipe m f\n /// Sequence actions, discarding the value of the first argument.\n let inline ( *>) x y = pipe2 x y (fun _ z -> z)\n /// Sequence actions, discarding the value of the second argument.\n let inline ( <*) x y = pipe2 x y (fun z _ -> z)\n\n /// Sequentially compose two async actions, discarding any value produced by the first\n let inline (>>.) m f = bindM async m (fun _ -> f)\n /// Left-to-right Kleisli composition\n let inline (>=>) f g = fun x -> f x >>= g\n /// Right-to-left Kleisli composition\n let inline (<=<) x = flip (>=>) x\n\n let foldM f s = \n Seq.fold (fun acc t -> acc >>= (flip f) t) (returnM s)\n\n let inline sequence s =\n let inline cons a b = lift2 List.cons a b\n List.foldBack cons s (returnM [])\n\n let inline mapM f x = sequence (List.map f x)"} +{"text": "Tests of the built-in exceptions' detail messages.\n"} +{"text": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"base/test/task_runner_test_template.h\"\n\nnamespace base {\n\nnamespace test {\n\nTaskTracker::TaskTracker() : task_runs_(0), task_runs_cv_(&lock_) {}\n\nTaskTracker::~TaskTracker() {}\n\nClosure TaskTracker::WrapTask(const Closure& task, int i) {\n return Bind(&TaskTracker::RunTask, this, task, i);\n}\n\nvoid TaskTracker::RunTask(const Closure& task, int i) {\n AutoLock lock(lock_);\n if (!task.is_null()) {\n task.Run();\n }\n ++task_run_counts_[i];\n ++task_runs_;\n task_runs_cv_.Signal();\n}\n\nstd::map TaskTracker::GetTaskRunCounts() const {\n AutoLock lock(lock_);\n return task_run_counts_;\n}\n\nvoid TaskTracker::WaitForCompletedTasks(int count) {\n AutoLock lock(lock_);\n while (task_runs_ < count)\n task_runs_cv_.Wait();\n}\n\nvoid ExpectRunsTasksOnCurrentThread(bool expected_value,\n TaskRunner* task_runner) {\n EXPECT_EQ(expected_value, task_runner->RunsTasksOnCurrentThread());\n}\n\n} // namespace test\n\n} // namespace base\n"} +{"text": "int anim abc_fade_in 0x7f040000\nint anim abc_fade_out 0x7f040001\nint anim abc_slide_in_bottom 0x7f040002\nint anim abc_slide_in_top 0x7f040003\nint anim abc_slide_out_bottom 0x7f040004\nint anim abc_slide_out_top 0x7f040005\nint attr actionBarDivider 0x7f01005a\nint attr actionBarItemBackground 0x7f01005b\nint attr actionBarPopupTheme 0x7f010054\nint attr actionBarSize 0x7f010059\nint attr actionBarSplitStyle 0x7f010056\nint attr actionBarStyle 0x7f010055\nint attr actionBarTabBarStyle 0x7f010050\nint attr actionBarTabStyle 0x7f01004f\nint attr actionBarTabTextStyle 0x7f010051\nint attr actionBarTheme 0x7f010057\nint attr actionBarWidgetTheme 0x7f010058\nint attr actionButtonStyle 0x7f010072\nint attr actionDropDownStyle 0x7f01006d\nint attr actionLayout 0x7f01002c\nint attr actionMenuTextAppearance 0x7f01005c\nint attr actionMenuTextColor 0x7f01005d\nint attr actionModeBackground 0x7f010060\nint attr actionModeCloseButtonStyle 0x7f01005f\nint attr actionModeCloseDrawable 0x7f010062\nint attr actionModeCopyDrawable 0x7f010064\nint attr actionModeCutDrawable 0x7f010063\nint attr actionModeFindDrawable 0x7f010068\nint attr actionModePasteDrawable 0x7f010065\nint attr actionModePopupWindowStyle 0x7f01006a\nint attr actionModeSelectAllDrawable 0x7f010066\nint attr actionModeShareDrawable 0x7f010067\nint attr actionModeSplitBackground 0x7f010061\nint attr actionModeStyle 0x7f01005e\nint attr actionModeWebSearchDrawable 0x7f010069\nint attr actionOverflowButtonStyle 0x7f010052\nint attr actionOverflowMenuStyle 0x7f010053\nint attr actionProviderClass 0x7f01002e\nint attr actionViewClass 0x7f01002d\nint attr activityChooserViewStyle 0x7f010079\nint attr background 0x7f01000c\nint attr backgroundSplit 0x7f01000e\nint attr backgroundStacked 0x7f01000d\nint attr barSize 0x7f010026\nint attr buttonBarButtonStyle 0x7f010074\nint attr buttonBarStyle 0x7f010073\nint attr closeIcon 0x7f010035\nint attr closeItemLayout 0x7f01001c\nint attr collapseContentDescription 0x7f0100a4\nint attr collapseIcon 0x7f0100a3\nint attr color 0x7f010020\nint attr colorAccent 0x7f010094\nint attr colorButtonNormal 0x7f010098\nint attr colorControlActivated 0x7f010096\nint attr colorControlHighlight 0x7f010097\nint attr colorControlNormal 0x7f010095\nint attr colorPrimary 0x7f010092\nint attr colorPrimaryDark 0x7f010093\nint attr colorSwitchThumbNormal 0x7f010099\nint attr commitIcon 0x7f010039\nint attr contentInsetEnd 0x7f010017\nint attr contentInsetLeft 0x7f010018\nint attr contentInsetRight 0x7f010019\nint attr contentInsetStart 0x7f010016\nint attr customNavigationLayout 0x7f01000f\nint attr disableChildrenWhenDisabled 0x7f010040\nint attr displayOptions 0x7f010005\nint attr divider 0x7f01000b\nint attr dividerHorizontal 0x7f010078\nint attr dividerPadding 0x7f01002a\nint attr dividerVertical 0x7f010077\nint attr drawableSize 0x7f010022\nint attr drawerArrowStyle 0x7f010000\nint attr dropDownListViewStyle 0x7f01008a\nint attr dropdownListPreferredItemHeight 0x7f01006e\nint attr editTextBackground 0x7f01007f\nint attr editTextColor 0x7f01007e\nint attr elevation 0x7f01001a\nint attr expandActivityOverflowButtonDrawable 0x7f01001e\nint attr gapBetweenBars 0x7f010023\nint attr goIcon 0x7f010036\nint attr height 0x7f010001\nint attr hideOnContentScroll 0x7f010015\nint attr homeAsUpIndicator 0x7f010071\nint attr homeLayout 0x7f010010\nint attr icon 0x7f010009\nint attr iconifiedByDefault 0x7f010033\nint attr indeterminateProgressStyle 0x7f010012\nint attr initialActivityCount 0x7f01001d\nint attr isLightTheme 0x7f010002\nint attr itemPadding 0x7f010014\nint attr layout 0x7f010032\nint attr listChoiceBackgroundIndicator 0x7f010091\nint attr listPopupWindowStyle 0x7f01008b\nint attr listPreferredItemHeight 0x7f010085\nint attr listPreferredItemHeightLarge 0x7f010087\nint attr listPreferredItemHeightSmall 0x7f010086\nint attr listPreferredItemPaddingLeft 0x7f010088\nint attr listPreferredItemPaddingRight 0x7f010089\nint attr logo 0x7f01000a\nint attr maxButtonHeight 0x7f0100a1\nint attr measureWithLargestChild 0x7f010028\nint attr middleBarArrowSize 0x7f010025\nint attr navigationContentDescription 0x7f0100a6\nint attr navigationIcon 0x7f0100a5\nint attr navigationMode 0x7f010004\nint attr overlapAnchor 0x7f010030\nint attr paddingEnd 0x7f0100a8\nint attr paddingStart 0x7f0100a7\nint attr panelBackground 0x7f01008e\nint attr panelMenuListTheme 0x7f010090\nint attr panelMenuListWidth 0x7f01008f\nint attr popupMenuStyle 0x7f01007c\nint attr popupPromptView 0x7f01003f\nint attr popupTheme 0x7f01001b\nint attr popupWindowStyle 0x7f01007d\nint attr preserveIconSpacing 0x7f01002f\nint attr progressBarPadding 0x7f010013\nint attr progressBarStyle 0x7f010011\nint attr prompt 0x7f01003d\nint attr queryBackground 0x7f01003b\nint attr queryHint 0x7f010034\nint attr searchIcon 0x7f010037\nint attr searchViewStyle 0x7f010084\nint attr selectableItemBackground 0x7f010075\nint attr selectableItemBackgroundBorderless 0x7f010076\nint attr showAsAction 0x7f01002b\nint attr showDividers 0x7f010029\nint attr showText 0x7f010047\nint attr spinBars 0x7f010021\nint attr spinnerDropDownItemStyle 0x7f010070\nint attr spinnerMode 0x7f01003e\nint attr spinnerStyle 0x7f01006f\nint attr splitTrack 0x7f010046\nint attr state_above_anchor 0x7f010031\nint attr submitBackground 0x7f01003c\nint attr subtitle 0x7f010006\nint attr subtitleTextAppearance 0x7f01009b\nint attr subtitleTextStyle 0x7f010008\nint attr suggestionRowLayout 0x7f01003a\nint attr switchMinWidth 0x7f010044\nint attr switchPadding 0x7f010045\nint attr switchStyle 0x7f010080\nint attr switchTextAppearance 0x7f010043\nint attr textAllCaps 0x7f01001f\nint attr textAppearanceLargePopupMenu 0x7f01006b\nint attr textAppearanceListItem 0x7f01008c\nint attr textAppearanceListItemSmall 0x7f01008d\nint attr textAppearanceSearchResultSubtitle 0x7f010082\nint attr textAppearanceSearchResultTitle 0x7f010081\nint attr textAppearanceSmallPopupMenu 0x7f01006c\nint attr textColorSearchUrl 0x7f010083\nint attr theme 0x7f0100a2\nint attr thickness 0x7f010027\nint attr thumbTextPadding 0x7f010042\nint attr title 0x7f010003\nint attr titleMarginBottom 0x7f0100a0\nint attr titleMarginEnd 0x7f01009e\nint attr titleMarginStart 0x7f01009d\nint attr titleMarginTop 0x7f01009f\nint attr titleMargins 0x7f01009c\nint attr titleTextAppearance 0x7f01009a\nint attr titleTextStyle 0x7f010007\nint attr toolbarNavigationButtonStyle 0x7f01007b\nint attr toolbarStyle 0x7f01007a\nint attr topBottomBarArrowSize 0x7f010024\nint attr track 0x7f010041\nint attr voiceIcon 0x7f010038\nint attr windowActionBar 0x7f010048\nint attr windowActionBarOverlay 0x7f010049\nint attr windowActionModeOverlay 0x7f01004a\nint attr windowFixedHeightMajor 0x7f01004e\nint attr windowFixedHeightMinor 0x7f01004c\nint attr windowFixedWidthMajor 0x7f01004b\nint attr windowFixedWidthMinor 0x7f01004d\nint bool abc_action_bar_embed_tabs 0x7f050000\nint bool abc_action_bar_embed_tabs_pre_jb 0x7f050001\nint bool abc_action_bar_expanded_action_views_exclusive 0x7f050002\nint bool abc_config_actionMenuItemAllCaps 0x7f050003\nint bool abc_config_allowActionMenuItemTextWithIcon 0x7f050004\nint bool abc_config_showMenuShortcutsWhenKeyboardPresent 0x7f050005\nint color abc_background_cache_hint_selector_material_dark 0x7f060031\nint color abc_background_cache_hint_selector_material_light 0x7f060032\nint color abc_input_method_navigation_guard 0x7f060000\nint color abc_primary_text_disable_only_material_dark 0x7f060033\nint color abc_primary_text_disable_only_material_light 0x7f060034\nint color abc_primary_text_material_dark 0x7f060035\nint color abc_primary_text_material_light 0x7f060036\nint color abc_search_url_text 0x7f060037\nint color abc_search_url_text_normal 0x7f060001\nint color abc_search_url_text_pressed 0x7f060002\nint color abc_search_url_text_selected 0x7f060003\nint color abc_secondary_text_material_dark 0x7f060038\nint color abc_secondary_text_material_light 0x7f060039\nint color accent_material_dark 0x7f060004\nint color accent_material_light 0x7f060005\nint color background_floating_material_dark 0x7f060006\nint color background_floating_material_light 0x7f060007\nint color background_material_dark 0x7f060008\nint color background_material_light 0x7f060009\nint color bright_foreground_disabled_material_dark 0x7f06000a\nint color bright_foreground_disabled_material_light 0x7f06000b\nint color bright_foreground_inverse_material_dark 0x7f06000c\nint color bright_foreground_inverse_material_light 0x7f06000d\nint color bright_foreground_material_dark 0x7f06000e\nint color bright_foreground_material_light 0x7f06000f\nint color button_material_dark 0x7f060010\nint color button_material_light 0x7f060011\nint color dim_foreground_disabled_material_dark 0x7f060012\nint color dim_foreground_disabled_material_light 0x7f060013\nint color dim_foreground_material_dark 0x7f060014\nint color dim_foreground_material_light 0x7f060015\nint color highlighted_text_material_dark 0x7f060016\nint color highlighted_text_material_light 0x7f060017\nint color hint_foreground_material_dark 0x7f060018\nint color hint_foreground_material_light 0x7f060019\nint color link_text_material_dark 0x7f06001a\nint color link_text_material_light 0x7f06001b\nint color material_blue_grey_800 0x7f06001c\nint color material_blue_grey_900 0x7f06001d\nint color material_blue_grey_950 0x7f06001e\nint color material_deep_teal_200 0x7f06001f\nint color material_deep_teal_500 0x7f060020\nint color primary_dark_material_dark 0x7f060021\nint color primary_dark_material_light 0x7f060022\nint color primary_material_dark 0x7f060023\nint color primary_material_light 0x7f060024\nint color primary_text_default_material_dark 0x7f060025\nint color primary_text_default_material_light 0x7f060026\nint color primary_text_disabled_material_dark 0x7f060027\nint color primary_text_disabled_material_light 0x7f060028\nint color ripple_material_dark 0x7f060029\nint color ripple_material_light 0x7f06002a\nint color secondary_text_default_material_dark 0x7f06002b\nint color secondary_text_default_material_light 0x7f06002c\nint color secondary_text_disabled_material_dark 0x7f06002d\nint color secondary_text_disabled_material_light 0x7f06002e\nint color switch_thumb_normal_material_dark 0x7f06002f\nint color switch_thumb_normal_material_light 0x7f060030\nint dimen abc_action_bar_default_height_material 0x7f070000\nint dimen abc_action_bar_default_padding_material 0x7f070001\nint dimen abc_action_bar_icon_vertical_padding_material 0x7f070002\nint dimen abc_action_bar_progress_bar_size 0x7f070003\nint dimen abc_action_bar_stacked_max_height 0x7f070004\nint dimen abc_action_bar_stacked_tab_max_width 0x7f070005\nint dimen abc_action_bar_subtitle_bottom_margin_material 0x7f070006\nint dimen abc_action_bar_subtitle_top_margin_material 0x7f070007\nint dimen abc_action_button_min_height_material 0x7f070008\nint dimen abc_action_button_min_width_material 0x7f070009\nint dimen abc_action_button_min_width_overflow_material 0x7f07000a\nint dimen abc_config_prefDialogWidth 0x7f07000b\nint dimen abc_control_inset_material 0x7f07000c\nint dimen abc_control_padding_material 0x7f07000d\nint dimen abc_dropdownitem_icon_width 0x7f07000e\nint dimen abc_dropdownitem_text_padding_left 0x7f07000f\nint dimen abc_dropdownitem_text_padding_right 0x7f070010\nint dimen abc_panel_menu_list_width 0x7f070011\nint dimen abc_search_view_preferred_width 0x7f070012\nint dimen abc_search_view_text_min_width 0x7f070013\nint dimen abc_text_size_body_1_material 0x7f070014\nint dimen abc_text_size_body_2_material 0x7f070015\nint dimen abc_text_size_button_material 0x7f070016\nint dimen abc_text_size_caption_material 0x7f070017\nint dimen abc_text_size_display_1_material 0x7f070018\nint dimen abc_text_size_display_2_material 0x7f070019\nint dimen abc_text_size_display_3_material 0x7f07001a\nint dimen abc_text_size_display_4_material 0x7f07001b\nint dimen abc_text_size_headline_material 0x7f07001c\nint dimen abc_text_size_large_material 0x7f07001d\nint dimen abc_text_size_medium_material 0x7f07001e\nint dimen abc_text_size_menu_material 0x7f07001f\nint dimen abc_text_size_small_material 0x7f070020\nint dimen abc_text_size_subhead_material 0x7f070021\nint dimen abc_text_size_subtitle_material_toolbar 0x7f070022\nint dimen abc_text_size_title_material 0x7f070023\nint dimen abc_text_size_title_material_toolbar 0x7f070024\nint dimen dialog_fixed_height_major 0x7f070025\nint dimen dialog_fixed_height_minor 0x7f070026\nint dimen dialog_fixed_width_major 0x7f070027\nint dimen dialog_fixed_width_minor 0x7f070028\nint dimen disabled_alpha_material_dark 0x7f070029\nint dimen disabled_alpha_material_light 0x7f07002a\nint drawable abc_ab_share_pack_holo_dark 0x7f020000\nint drawable abc_ab_share_pack_holo_light 0x7f020001\nint drawable abc_btn_check_material 0x7f020002\nint drawable abc_btn_check_to_on_mtrl_000 0x7f020003\nint drawable abc_btn_check_to_on_mtrl_015 0x7f020004\nint drawable abc_btn_radio_material 0x7f020005\nint drawable abc_btn_radio_to_on_mtrl_000 0x7f020006\nint drawable abc_btn_radio_to_on_mtrl_015 0x7f020007\nint drawable abc_btn_switch_to_on_mtrl_00001 0x7f020008\nint drawable abc_btn_switch_to_on_mtrl_00012 0x7f020009\nint drawable abc_cab_background_internal_bg 0x7f02000a\nint drawable abc_cab_background_top_material 0x7f02000b\nint drawable abc_cab_background_top_mtrl_alpha 0x7f02000c\nint drawable abc_edit_text_material 0x7f02000d\nint drawable abc_ic_ab_back_mtrl_am_alpha 0x7f02000e\nint drawable abc_ic_clear_mtrl_alpha 0x7f02000f\nint drawable abc_ic_commit_search_api_mtrl_alpha 0x7f020010\nint drawable abc_ic_go_search_api_mtrl_alpha 0x7f020011\nint drawable abc_ic_menu_copy_mtrl_am_alpha 0x7f020012\nint drawable abc_ic_menu_cut_mtrl_alpha 0x7f020013\nint drawable abc_ic_menu_moreoverflow_mtrl_alpha 0x7f020014\nint drawable abc_ic_menu_paste_mtrl_am_alpha 0x7f020015\nint drawable abc_ic_menu_selectall_mtrl_alpha 0x7f020016\nint drawable abc_ic_menu_share_mtrl_alpha 0x7f020017\nint drawable abc_ic_search_api_mtrl_alpha 0x7f020018\nint drawable abc_ic_voice_search_api_mtrl_alpha 0x7f020019\nint drawable abc_item_background_holo_dark 0x7f02001a\nint drawable abc_item_background_holo_light 0x7f02001b\nint drawable abc_list_divider_mtrl_alpha 0x7f02001c\nint drawable abc_list_focused_holo 0x7f02001d\nint drawable abc_list_longpressed_holo 0x7f02001e\nint drawable abc_list_pressed_holo_dark 0x7f02001f\nint drawable abc_list_pressed_holo_light 0x7f020020\nint drawable abc_list_selector_background_transition_holo_dark 0x7f020021\nint drawable abc_list_selector_background_transition_holo_light 0x7f020022\nint drawable abc_list_selector_disabled_holo_dark 0x7f020023\nint drawable abc_list_selector_disabled_holo_light 0x7f020024\nint drawable abc_list_selector_holo_dark 0x7f020025\nint drawable abc_list_selector_holo_light 0x7f020026\nint drawable abc_menu_hardkey_panel_mtrl_mult 0x7f020027\nint drawable abc_popup_background_mtrl_mult 0x7f020028\nint drawable abc_spinner_mtrl_am_alpha 0x7f020029\nint drawable abc_switch_thumb_material 0x7f02002a\nint drawable abc_switch_track_mtrl_alpha 0x7f02002b\nint drawable abc_tab_indicator_material 0x7f02002c\nint drawable abc_tab_indicator_mtrl_alpha 0x7f02002d\nint drawable abc_textfield_activated_mtrl_alpha 0x7f02002e\nint drawable abc_textfield_default_mtrl_alpha 0x7f02002f\nint drawable abc_textfield_search_activated_mtrl_alpha 0x7f020030\nint drawable abc_textfield_search_default_mtrl_alpha 0x7f020031\nint drawable abc_textfield_search_material 0x7f020032\nint id action_bar 0x7f080031\nint id action_bar_activity_content 0x7f080000\nint id action_bar_container 0x7f080030\nint id action_bar_root 0x7f08002c\nint id action_bar_spinner 0x7f080001\nint id action_bar_subtitle 0x7f08001f\nint id action_bar_title 0x7f08001e\nint id action_context_bar 0x7f080032\nint id action_menu_divider 0x7f080002\nint id action_menu_presenter 0x7f080003\nint id action_mode_bar 0x7f08002e\nint id action_mode_bar_stub 0x7f08002d\nint id action_mode_close_button 0x7f080020\nint id activity_chooser_view_content 0x7f080021\nint id always 0x7f080016\nint id beginning 0x7f080013\nint id checkbox 0x7f080029\nint id collapseActionView 0x7f080017\nint id decor_content_parent 0x7f08002f\nint id default_activity_button 0x7f080024\nint id dialog 0x7f08001b\nint id disableHome 0x7f08000c\nint id dropdown 0x7f08001c\nint id edit_query 0x7f080033\nint id end 0x7f080014\nint id expand_activities_button 0x7f080022\nint id expanded_menu 0x7f080028\nint id home 0x7f080004\nint id homeAsUp 0x7f08000d\nint id icon 0x7f080026\nint id ifRoom 0x7f080018\nint id image 0x7f080023\nint id listMode 0x7f080009\nint id list_item 0x7f080025\nint id middle 0x7f080015\nint id never 0x7f080019\nint id none 0x7f08000e\nint id normal 0x7f08000a\nint id progress_circular 0x7f080005\nint id progress_horizontal 0x7f080006\nint id radio 0x7f08002b\nint id search_badge 0x7f080035\nint id search_bar 0x7f080034\nint id search_button 0x7f080036\nint id search_close_btn 0x7f08003b\nint id search_edit_frame 0x7f080037\nint id search_go_btn 0x7f08003d\nint id search_mag_icon 0x7f080038\nint id search_plate 0x7f080039\nint id search_src_text 0x7f08003a\nint id search_voice_btn 0x7f08003e\nint id shortcut 0x7f08002a\nint id showCustom 0x7f08000f\nint id showHome 0x7f080010\nint id showTitle 0x7f080011\nint id split_action_bar 0x7f080007\nint id submit_area 0x7f08003c\nint id tabMode 0x7f08000b\nint id title 0x7f080027\nint id up 0x7f080008\nint id useLogo 0x7f080012\nint id withText 0x7f08001a\nint id wrap_content 0x7f08001d\nint integer abc_max_action_buttons 0x7f090000\nint layout abc_action_bar_title_item 0x7f030000\nint layout abc_action_bar_up_container 0x7f030001\nint layout abc_action_bar_view_list_nav_layout 0x7f030002\nint layout abc_action_menu_item_layout 0x7f030003\nint layout abc_action_menu_layout 0x7f030004\nint layout abc_action_mode_bar 0x7f030005\nint layout abc_action_mode_close_item_material 0x7f030006\nint layout abc_activity_chooser_view 0x7f030007\nint layout abc_activity_chooser_view_include 0x7f030008\nint layout abc_activity_chooser_view_list_item 0x7f030009\nint layout abc_expanded_menu_layout 0x7f03000a\nint layout abc_list_menu_item_checkbox 0x7f03000b\nint layout abc_list_menu_item_icon 0x7f03000c\nint layout abc_list_menu_item_layout 0x7f03000d\nint layout abc_list_menu_item_radio 0x7f03000e\nint layout abc_popup_menu_item_layout 0x7f03000f\nint layout abc_screen_content_include 0x7f030010\nint layout abc_screen_simple 0x7f030011\nint layout abc_screen_simple_overlay_action_mode 0x7f030012\nint layout abc_screen_toolbar 0x7f030013\nint layout abc_search_dropdown_item_icons_2line 0x7f030014\nint layout abc_search_view 0x7f030015\nint layout abc_simple_dropdown_hint 0x7f030016\nint layout support_simple_spinner_dropdown_item 0x7f030017\nint string abc_action_bar_home_description 0x7f0a0000\nint string abc_action_bar_home_description_format 0x7f0a0001\nint string abc_action_bar_home_subtitle_description_format 0x7f0a0002\nint string abc_action_bar_up_description 0x7f0a0003\nint string abc_action_menu_overflow_description 0x7f0a0004\nint string abc_action_mode_done 0x7f0a0005\nint string abc_activity_chooser_view_see_all 0x7f0a0006\nint string abc_activitychooserview_choose_application 0x7f0a0007\nint string abc_searchview_description_clear 0x7f0a0008\nint string abc_searchview_description_query 0x7f0a0009\nint string abc_searchview_description_search 0x7f0a000a\nint string abc_searchview_description_submit 0x7f0a000b\nint string abc_searchview_description_voice 0x7f0a000c\nint string abc_shareactionprovider_share_with 0x7f0a000d\nint string abc_shareactionprovider_share_with_application 0x7f0a000e\nint string abc_toolbar_collapse_description 0x7f0a000f\nint style Base_TextAppearance_AppCompat 0x7f0b0000\nint style Base_TextAppearance_AppCompat_Body1 0x7f0b0001\nint style Base_TextAppearance_AppCompat_Body2 0x7f0b0002\nint style Base_TextAppearance_AppCompat_Button 0x7f0b0003\nint style Base_TextAppearance_AppCompat_Caption 0x7f0b0004\nint style Base_TextAppearance_AppCompat_Display1 0x7f0b0005\nint style Base_TextAppearance_AppCompat_Display2 0x7f0b0006\nint style Base_TextAppearance_AppCompat_Display3 0x7f0b0007\nint style Base_TextAppearance_AppCompat_Display4 0x7f0b0008\nint style Base_TextAppearance_AppCompat_Headline 0x7f0b0009\nint style Base_TextAppearance_AppCompat_Inverse 0x7f0b000a\nint style Base_TextAppearance_AppCompat_Large 0x7f0b000b\nint style Base_TextAppearance_AppCompat_Large_Inverse 0x7f0b000c\nint style Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large 0x7f0b000d\nint style Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small 0x7f0b000e\nint style Base_TextAppearance_AppCompat_Medium 0x7f0b000f\nint style Base_TextAppearance_AppCompat_Medium_Inverse 0x7f0b0010\nint style Base_TextAppearance_AppCompat_Menu 0x7f0b0011\nint style Base_TextAppearance_AppCompat_SearchResult 0x7f0b0012\nint style Base_TextAppearance_AppCompat_SearchResult_Subtitle 0x7f0b0013\nint style Base_TextAppearance_AppCompat_SearchResult_Title 0x7f0b0014\nint style Base_TextAppearance_AppCompat_Small 0x7f0b0015\nint style Base_TextAppearance_AppCompat_Small_Inverse 0x7f0b0016\nint style Base_TextAppearance_AppCompat_Subhead 0x7f0b0017\nint style Base_TextAppearance_AppCompat_Subhead_Inverse 0x7f0b0018\nint style Base_TextAppearance_AppCompat_Title 0x7f0b0019\nint style Base_TextAppearance_AppCompat_Title_Inverse 0x7f0b001a\nint style Base_TextAppearance_AppCompat_Widget_ActionBar_Menu 0x7f0b001b\nint style Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle 0x7f0b001c\nint style Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse 0x7f0b001d\nint style Base_TextAppearance_AppCompat_Widget_ActionBar_Title 0x7f0b001e\nint style Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse 0x7f0b001f\nint style Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle 0x7f0b0020\nint style Base_TextAppearance_AppCompat_Widget_ActionMode_Title 0x7f0b0021\nint style Base_TextAppearance_AppCompat_Widget_DropDownItem 0x7f0b0022\nint style Base_TextAppearance_AppCompat_Widget_PopupMenu_Large 0x7f0b0023\nint style Base_TextAppearance_AppCompat_Widget_PopupMenu_Small 0x7f0b0024\nint style Base_TextAppearance_AppCompat_Widget_Switch 0x7f0b0025\nint style Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item 0x7f0b0026\nint style Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle 0x7f0b0027\nint style Base_TextAppearance_Widget_AppCompat_Toolbar_Title 0x7f0b0028\nint style Base_Theme_AppCompat 0x7f0b0029\nint style Base_Theme_AppCompat_CompactMenu 0x7f0b002a\nint style Base_Theme_AppCompat_Dialog 0x7f0b002b\nint style Base_Theme_AppCompat_Dialog_FixedSize 0x7f0b002c\nint style Base_Theme_AppCompat_DialogWhenLarge 0x7f0b002d\nint style Base_Theme_AppCompat_Light 0x7f0b002e\nint style Base_Theme_AppCompat_Light_DarkActionBar 0x7f0b002f\nint style Base_Theme_AppCompat_Light_Dialog 0x7f0b0030\nint style Base_Theme_AppCompat_Light_Dialog_FixedSize 0x7f0b0031\nint style Base_Theme_AppCompat_Light_DialogWhenLarge 0x7f0b0032\nint style Base_ThemeOverlay_AppCompat 0x7f0b0033\nint style Base_ThemeOverlay_AppCompat_ActionBar 0x7f0b0034\nint style Base_ThemeOverlay_AppCompat_Dark 0x7f0b0035\nint style Base_ThemeOverlay_AppCompat_Dark_ActionBar 0x7f0b0036\nint style Base_ThemeOverlay_AppCompat_Light 0x7f0b0037\nint style Base_V11_Theme_AppCompat 0x7f0b00df\nint style Base_V11_Theme_AppCompat_Dialog 0x7f0b00e0\nint style Base_V11_Theme_AppCompat_Light 0x7f0b00e1\nint style Base_V11_Theme_AppCompat_Light_Dialog 0x7f0b00e2\nint style Base_V14_Theme_AppCompat 0x7f0b00e3\nint style Base_V14_Theme_AppCompat_Dialog 0x7f0b00e4\nint style Base_V14_Theme_AppCompat_Light 0x7f0b00e5\nint style Base_V14_Theme_AppCompat_Light_Dialog 0x7f0b00e6\nint style Base_V21_Theme_AppCompat 0x7f0b00e7\nint style Base_V21_Theme_AppCompat_Dialog 0x7f0b00e8\nint style Base_V21_Theme_AppCompat_Light 0x7f0b00e9\nint style Base_V21_Theme_AppCompat_Light_Dialog 0x7f0b00ea\nint style Base_V7_Theme_AppCompat 0x7f0b0038\nint style Base_V7_Theme_AppCompat_Dialog 0x7f0b0039\nint style Base_V7_Theme_AppCompat_Light 0x7f0b003a\nint style Base_Widget_AppCompat_ActionBar 0x7f0b003b\nint style Base_Widget_AppCompat_ActionBar_Solid 0x7f0b003c\nint style Base_Widget_AppCompat_ActionBar_TabBar 0x7f0b003d\nint style Base_Widget_AppCompat_ActionBar_TabText 0x7f0b003e\nint style Base_Widget_AppCompat_ActionBar_TabView 0x7f0b003f\nint style Base_Widget_AppCompat_ActionButton 0x7f0b0040\nint style Base_Widget_AppCompat_ActionButton_CloseMode 0x7f0b0041\nint style Base_Widget_AppCompat_ActionButton_Overflow 0x7f0b0042\nint style Base_Widget_AppCompat_ActionMode 0x7f0b0043\nint style Base_Widget_AppCompat_ActivityChooserView 0x7f0b0044\nint style Base_Widget_AppCompat_AutoCompleteTextView 0x7f0b0045\nint style Base_Widget_AppCompat_CompoundButton_Switch 0x7f0b0046\nint style Base_Widget_AppCompat_DrawerArrowToggle 0x7f0b0047\nint style Base_Widget_AppCompat_DropDownItem_Spinner 0x7f0b0048\nint style Base_Widget_AppCompat_EditText 0x7f0b0049\nint style Base_Widget_AppCompat_Light_ActionBar 0x7f0b004a\nint style Base_Widget_AppCompat_Light_ActionBar_Solid 0x7f0b004b\nint style Base_Widget_AppCompat_Light_ActionBar_TabBar 0x7f0b004c\nint style Base_Widget_AppCompat_Light_ActionBar_TabText 0x7f0b004d\nint style Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse 0x7f0b004e\nint style Base_Widget_AppCompat_Light_ActionBar_TabView 0x7f0b004f\nint style Base_Widget_AppCompat_Light_ActivityChooserView 0x7f0b0050\nint style Base_Widget_AppCompat_Light_AutoCompleteTextView 0x7f0b0051\nint style Base_Widget_AppCompat_Light_PopupMenu 0x7f0b0052\nint style Base_Widget_AppCompat_Light_PopupMenu_Overflow 0x7f0b0053\nint style Base_Widget_AppCompat_ListPopupWindow 0x7f0b0054\nint style Base_Widget_AppCompat_ListView_DropDown 0x7f0b0055\nint style Base_Widget_AppCompat_ListView_Menu 0x7f0b0056\nint style Base_Widget_AppCompat_PopupMenu 0x7f0b0057\nint style Base_Widget_AppCompat_PopupMenu_Overflow 0x7f0b0058\nint style Base_Widget_AppCompat_PopupWindow 0x7f0b0059\nint style Base_Widget_AppCompat_ProgressBar 0x7f0b005a\nint style Base_Widget_AppCompat_ProgressBar_Horizontal 0x7f0b005b\nint style Base_Widget_AppCompat_SearchView 0x7f0b005c\nint style Base_Widget_AppCompat_Spinner 0x7f0b005d\nint style Base_Widget_AppCompat_Spinner_DropDown_ActionBar 0x7f0b005e\nint style Base_Widget_AppCompat_Toolbar 0x7f0b005f\nint style Base_Widget_AppCompat_Toolbar_Button_Navigation 0x7f0b0060\nint style Platform_AppCompat 0x7f0b0061\nint style Platform_AppCompat_Dialog 0x7f0b0062\nint style Platform_AppCompat_Light 0x7f0b0063\nint style Platform_AppCompat_Light_Dialog 0x7f0b0064\nint style RtlOverlay_Widget_AppCompat_ActionBar_TitleItem 0x7f0b0065\nint style RtlOverlay_Widget_AppCompat_ActionButton_CloseMode 0x7f0b0066\nint style RtlOverlay_Widget_AppCompat_ActionButton_Overflow 0x7f0b0067\nint style RtlOverlay_Widget_AppCompat_PopupMenuItem 0x7f0b0068\nint style RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup 0x7f0b0069\nint style RtlOverlay_Widget_AppCompat_PopupMenuItem_Text 0x7f0b006a\nint style RtlOverlay_Widget_AppCompat_Search_DropDown 0x7f0b006b\nint style RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 0x7f0b006c\nint style RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 0x7f0b006d\nint style RtlOverlay_Widget_AppCompat_Search_DropDown_Query 0x7f0b006e\nint style RtlOverlay_Widget_AppCompat_Search_DropDown_Text 0x7f0b006f\nint style RtlOverlay_Widget_AppCompat_SearchView_MagIcon 0x7f0b0070\nint style TextAppearance_AppCompat 0x7f0b0071\nint style TextAppearance_AppCompat_Body1 0x7f0b0072\nint style TextAppearance_AppCompat_Body2 0x7f0b0073\nint style TextAppearance_AppCompat_Button 0x7f0b0074\nint style TextAppearance_AppCompat_Caption 0x7f0b0075\nint style TextAppearance_AppCompat_Display1 0x7f0b0076\nint style TextAppearance_AppCompat_Display2 0x7f0b0077\nint style TextAppearance_AppCompat_Display3 0x7f0b0078\nint style TextAppearance_AppCompat_Display4 0x7f0b0079\nint style TextAppearance_AppCompat_Headline 0x7f0b007a\nint style TextAppearance_AppCompat_Inverse 0x7f0b007b\nint style TextAppearance_AppCompat_Large 0x7f0b007c\nint style TextAppearance_AppCompat_Large_Inverse 0x7f0b007d\nint style TextAppearance_AppCompat_Light_SearchResult_Subtitle 0x7f0b007e\nint style TextAppearance_AppCompat_Light_SearchResult_Title 0x7f0b007f\nint style TextAppearance_AppCompat_Light_Widget_PopupMenu_Large 0x7f0b0080\nint style TextAppearance_AppCompat_Light_Widget_PopupMenu_Small 0x7f0b0081\nint style TextAppearance_AppCompat_Medium 0x7f0b0082\nint style TextAppearance_AppCompat_Medium_Inverse 0x7f0b0083\nint style TextAppearance_AppCompat_Menu 0x7f0b0084\nint style TextAppearance_AppCompat_SearchResult_Subtitle 0x7f0b0085\nint style TextAppearance_AppCompat_SearchResult_Title 0x7f0b0086\nint style TextAppearance_AppCompat_Small 0x7f0b0087\nint style TextAppearance_AppCompat_Small_Inverse 0x7f0b0088\nint style TextAppearance_AppCompat_Subhead 0x7f0b0089\nint style TextAppearance_AppCompat_Subhead_Inverse 0x7f0b008a\nint style TextAppearance_AppCompat_Title 0x7f0b008b\nint style TextAppearance_AppCompat_Title_Inverse 0x7f0b008c\nint style TextAppearance_AppCompat_Widget_ActionBar_Menu 0x7f0b008d\nint style TextAppearance_AppCompat_Widget_ActionBar_Subtitle 0x7f0b008e\nint style TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse 0x7f0b008f\nint style TextAppearance_AppCompat_Widget_ActionBar_Title 0x7f0b0090\nint style TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse 0x7f0b0091\nint style TextAppearance_AppCompat_Widget_ActionMode_Subtitle 0x7f0b0092\nint style TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse 0x7f0b0093\nint style TextAppearance_AppCompat_Widget_ActionMode_Title 0x7f0b0094\nint style TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse 0x7f0b0095\nint style TextAppearance_AppCompat_Widget_DropDownItem 0x7f0b0096\nint style TextAppearance_AppCompat_Widget_PopupMenu_Large 0x7f0b0097\nint style TextAppearance_AppCompat_Widget_PopupMenu_Small 0x7f0b0098\nint style TextAppearance_AppCompat_Widget_Switch 0x7f0b0099\nint style TextAppearance_Widget_AppCompat_ExpandedMenu_Item 0x7f0b009a\nint style TextAppearance_Widget_AppCompat_Toolbar_Subtitle 0x7f0b009b\nint style TextAppearance_Widget_AppCompat_Toolbar_Title 0x7f0b009c\nint style Theme_AppCompat 0x7f0b009d\nint style Theme_AppCompat_CompactMenu 0x7f0b009e\nint style Theme_AppCompat_Dialog 0x7f0b009f\nint style Theme_AppCompat_DialogWhenLarge 0x7f0b00a0\nint style Theme_AppCompat_Light 0x7f0b00a1\nint style Theme_AppCompat_Light_DarkActionBar 0x7f0b00a2\nint style Theme_AppCompat_Light_Dialog 0x7f0b00a3\nint style Theme_AppCompat_Light_DialogWhenLarge 0x7f0b00a4\nint style Theme_AppCompat_Light_NoActionBar 0x7f0b00a5\nint style Theme_AppCompat_NoActionBar 0x7f0b00a6\nint style ThemeOverlay_AppCompat 0x7f0b00a7\nint style ThemeOverlay_AppCompat_ActionBar 0x7f0b00a8\nint style ThemeOverlay_AppCompat_Dark 0x7f0b00a9\nint style ThemeOverlay_AppCompat_Dark_ActionBar 0x7f0b00aa\nint style ThemeOverlay_AppCompat_Light 0x7f0b00ab\nint style Widget_AppCompat_ActionBar 0x7f0b00ac\nint style Widget_AppCompat_ActionBar_Solid 0x7f0b00ad\nint style Widget_AppCompat_ActionBar_TabBar 0x7f0b00ae\nint style Widget_AppCompat_ActionBar_TabText 0x7f0b00af\nint style Widget_AppCompat_ActionBar_TabView 0x7f0b00b0\nint style Widget_AppCompat_ActionButton 0x7f0b00b1\nint style Widget_AppCompat_ActionButton_CloseMode 0x7f0b00b2\nint style Widget_AppCompat_ActionButton_Overflow 0x7f0b00b3\nint style Widget_AppCompat_ActionMode 0x7f0b00b4\nint style Widget_AppCompat_ActivityChooserView 0x7f0b00b5\nint style Widget_AppCompat_AutoCompleteTextView 0x7f0b00b6\nint style Widget_AppCompat_CompoundButton_Switch 0x7f0b00b7\nint style Widget_AppCompat_DrawerArrowToggle 0x7f0b00b8\nint style Widget_AppCompat_DropDownItem_Spinner 0x7f0b00b9\nint style Widget_AppCompat_EditText 0x7f0b00ba\nint style Widget_AppCompat_Light_ActionBar 0x7f0b00bb\nint style Widget_AppCompat_Light_ActionBar_Solid 0x7f0b00bc\nint style Widget_AppCompat_Light_ActionBar_Solid_Inverse 0x7f0b00bd\nint style Widget_AppCompat_Light_ActionBar_TabBar 0x7f0b00be\nint style Widget_AppCompat_Light_ActionBar_TabBar_Inverse 0x7f0b00bf\nint style Widget_AppCompat_Light_ActionBar_TabText 0x7f0b00c0\nint style Widget_AppCompat_Light_ActionBar_TabText_Inverse 0x7f0b00c1\nint style Widget_AppCompat_Light_ActionBar_TabView 0x7f0b00c2\nint style Widget_AppCompat_Light_ActionBar_TabView_Inverse 0x7f0b00c3\nint style Widget_AppCompat_Light_ActionButton 0x7f0b00c4\nint style Widget_AppCompat_Light_ActionButton_CloseMode 0x7f0b00c5\nint style Widget_AppCompat_Light_ActionButton_Overflow 0x7f0b00c6\nint style Widget_AppCompat_Light_ActionMode_Inverse 0x7f0b00c7\nint style Widget_AppCompat_Light_ActivityChooserView 0x7f0b00c8\nint style Widget_AppCompat_Light_AutoCompleteTextView 0x7f0b00c9\nint style Widget_AppCompat_Light_DropDownItem_Spinner 0x7f0b00ca\nint style Widget_AppCompat_Light_ListPopupWindow 0x7f0b00cb\nint style Widget_AppCompat_Light_ListView_DropDown 0x7f0b00cc\nint style Widget_AppCompat_Light_PopupMenu 0x7f0b00cd\nint style Widget_AppCompat_Light_PopupMenu_Overflow 0x7f0b00ce\nint style Widget_AppCompat_Light_SearchView 0x7f0b00cf\nint style Widget_AppCompat_Light_Spinner_DropDown_ActionBar 0x7f0b00d0\nint style Widget_AppCompat_ListPopupWindow 0x7f0b00d1\nint style Widget_AppCompat_ListView_DropDown 0x7f0b00d2\nint style Widget_AppCompat_ListView_Menu 0x7f0b00d3\nint style Widget_AppCompat_PopupMenu 0x7f0b00d4\nint style Widget_AppCompat_PopupMenu_Overflow 0x7f0b00d5\nint style Widget_AppCompat_PopupWindow 0x7f0b00d6\nint style Widget_AppCompat_ProgressBar 0x7f0b00d7\nint style Widget_AppCompat_ProgressBar_Horizontal 0x7f0b00d8\nint style Widget_AppCompat_SearchView 0x7f0b00d9\nint style Widget_AppCompat_Spinner 0x7f0b00da\nint style Widget_AppCompat_Spinner_DropDown 0x7f0b00db\nint style Widget_AppCompat_Spinner_DropDown_ActionBar 0x7f0b00dc\nint style Widget_AppCompat_Toolbar 0x7f0b00dd\nint style Widget_AppCompat_Toolbar_Button_Navigation 0x7f0b00de\nint[] styleable ActionBar { 0x7f010001, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f010071 }\nint styleable ActionBar_background 10\nint styleable ActionBar_backgroundSplit 12\nint styleable ActionBar_backgroundStacked 11\nint styleable ActionBar_contentInsetEnd 21\nint styleable ActionBar_contentInsetLeft 22\nint styleable ActionBar_contentInsetRight 23\nint styleable ActionBar_contentInsetStart 20\nint styleable ActionBar_customNavigationLayout 13\nint styleable ActionBar_displayOptions 3\nint styleable ActionBar_divider 9\nint styleable ActionBar_elevation 24\nint styleable ActionBar_height 0\nint styleable ActionBar_hideOnContentScroll 19\nint styleable ActionBar_homeAsUpIndicator 26\nint styleable ActionBar_homeLayout 14\nint styleable ActionBar_icon 7\nint styleable ActionBar_indeterminateProgressStyle 16\nint styleable ActionBar_itemPadding 18\nint styleable ActionBar_logo 8\nint styleable ActionBar_navigationMode 2\nint styleable ActionBar_popupTheme 25\nint styleable ActionBar_progressBarPadding 17\nint styleable ActionBar_progressBarStyle 15\nint styleable ActionBar_subtitle 4\nint styleable ActionBar_subtitleTextStyle 6\nint styleable ActionBar_title 1\nint styleable ActionBar_titleTextStyle 5\nint[] styleable ActionBarLayout { 0x010100b3 }\nint styleable ActionBarLayout_android_layout_gravity 0\nint[] styleable ActionMenuItemView { 0x0101013f }\nint styleable ActionMenuItemView_android_minWidth 0\nint[] styleable ActionMenuView { }\nint[] styleable ActionMode { 0x7f010001, 0x7f010007, 0x7f010008, 0x7f01000c, 0x7f01000e, 0x7f01001c }\nint styleable ActionMode_background 3\nint styleable ActionMode_backgroundSplit 4\nint styleable ActionMode_closeItemLayout 5\nint styleable ActionMode_height 0\nint styleable ActionMode_subtitleTextStyle 2\nint styleable ActionMode_titleTextStyle 1\nint[] styleable ActivityChooserView { 0x7f01001d, 0x7f01001e }\nint styleable ActivityChooserView_expandActivityOverflowButtonDrawable 1\nint styleable ActivityChooserView_initialActivityCount 0\nint[] styleable CompatTextView { 0x7f01001f }\nint styleable CompatTextView_textAllCaps 0\nint[] styleable DrawerArrowToggle { 0x7f010020, 0x7f010021, 0x7f010022, 0x7f010023, 0x7f010024, 0x7f010025, 0x7f010026, 0x7f010027 }\nint styleable DrawerArrowToggle_barSize 6\nint styleable DrawerArrowToggle_color 0\nint styleable DrawerArrowToggle_drawableSize 2\nint styleable DrawerArrowToggle_gapBetweenBars 3\nint styleable DrawerArrowToggle_middleBarArrowSize 5\nint styleable DrawerArrowToggle_spinBars 1\nint styleable DrawerArrowToggle_thickness 7\nint styleable DrawerArrowToggle_topBottomBarArrowSize 4\nint[] styleable LinearLayoutCompat { 0x010100af, 0x010100c4, 0x01010126, 0x01010127, 0x01010128, 0x7f01000b, 0x7f010028, 0x7f010029, 0x7f01002a }\nint styleable LinearLayoutCompat_android_baselineAligned 2\nint styleable LinearLayoutCompat_android_baselineAlignedChildIndex 3\nint styleable LinearLayoutCompat_android_gravity 0\nint styleable LinearLayoutCompat_android_orientation 1\nint styleable LinearLayoutCompat_android_weightSum 4\nint styleable LinearLayoutCompat_divider 5\nint styleable LinearLayoutCompat_dividerPadding 8\nint styleable LinearLayoutCompat_measureWithLargestChild 6\nint styleable LinearLayoutCompat_showDividers 7\nint[] styleable LinearLayoutCompat_Layout { 0x010100b3, 0x010100f4, 0x010100f5, 0x01010181 }\nint styleable LinearLayoutCompat_Layout_android_layout_gravity 0\nint styleable LinearLayoutCompat_Layout_android_layout_height 2\nint styleable LinearLayoutCompat_Layout_android_layout_weight 3\nint styleable LinearLayoutCompat_Layout_android_layout_width 1\nint[] styleable ListPopupWindow { 0x010102ac, 0x010102ad }\nint styleable ListPopupWindow_android_dropDownHorizontalOffset 0\nint styleable ListPopupWindow_android_dropDownVerticalOffset 1\nint[] styleable MenuGroup { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 }\nint styleable MenuGroup_android_checkableBehavior 5\nint styleable MenuGroup_android_enabled 0\nint styleable MenuGroup_android_id 1\nint styleable MenuGroup_android_menuCategory 3\nint styleable MenuGroup_android_orderInCategory 4\nint styleable MenuGroup_android_visible 2\nint[] styleable MenuItem { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e }\nint styleable MenuItem_actionLayout 14\nint styleable MenuItem_actionProviderClass 16\nint styleable MenuItem_actionViewClass 15\nint styleable MenuItem_android_alphabeticShortcut 9\nint styleable MenuItem_android_checkable 11\nint styleable MenuItem_android_checked 3\nint styleable MenuItem_android_enabled 1\nint styleable MenuItem_android_icon 0\nint styleable MenuItem_android_id 2\nint styleable MenuItem_android_menuCategory 5\nint styleable MenuItem_android_numericShortcut 10\nint styleable MenuItem_android_onClick 12\nint styleable MenuItem_android_orderInCategory 6\nint styleable MenuItem_android_title 7\nint styleable MenuItem_android_titleCondensed 8\nint styleable MenuItem_android_visible 4\nint styleable MenuItem_showAsAction 13\nint[] styleable MenuView { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x7f01002f }\nint styleable MenuView_android_headerBackground 4\nint styleable MenuView_android_horizontalDivider 2\nint styleable MenuView_android_itemBackground 5\nint styleable MenuView_android_itemIconDisabledAlpha 6\nint styleable MenuView_android_itemTextAppearance 1\nint styleable MenuView_android_verticalDivider 3\nint styleable MenuView_android_windowAnimationStyle 0\nint styleable MenuView_preserveIconSpacing 7\nint[] styleable PopupWindow { 0x01010176, 0x7f010030 }\nint styleable PopupWindow_android_popupBackground 0\nint styleable PopupWindow_overlapAnchor 1\nint[] styleable PopupWindowBackgroundState { 0x7f010031 }\nint styleable PopupWindowBackgroundState_state_above_anchor 0\nint[] styleable SearchView { 0x010100da, 0x0101011f, 0x01010220, 0x01010264, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039, 0x7f01003a, 0x7f01003b, 0x7f01003c }\nint styleable SearchView_android_focusable 0\nint styleable SearchView_android_imeOptions 3\nint styleable SearchView_android_inputType 2\nint styleable SearchView_android_maxWidth 1\nint styleable SearchView_closeIcon 7\nint styleable SearchView_commitIcon 11\nint styleable SearchView_goIcon 8\nint styleable SearchView_iconifiedByDefault 5\nint styleable SearchView_layout 4\nint styleable SearchView_queryBackground 13\nint styleable SearchView_queryHint 6\nint styleable SearchView_searchIcon 9\nint styleable SearchView_submitBackground 14\nint styleable SearchView_suggestionRowLayout 12\nint styleable SearchView_voiceIcon 10\nint[] styleable Spinner { 0x010100af, 0x010100d4, 0x01010175, 0x01010176, 0x01010262, 0x010102ac, 0x010102ad, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040 }\nint styleable Spinner_android_background 1\nint styleable Spinner_android_dropDownHorizontalOffset 5\nint styleable Spinner_android_dropDownSelector 2\nint styleable Spinner_android_dropDownVerticalOffset 6\nint styleable Spinner_android_dropDownWidth 4\nint styleable Spinner_android_gravity 0\nint styleable Spinner_android_popupBackground 3\nint styleable Spinner_disableChildrenWhenDisabled 10\nint styleable Spinner_popupPromptView 9\nint styleable Spinner_prompt 7\nint styleable Spinner_spinnerMode 8\nint[] styleable SwitchCompat { 0x01010124, 0x01010125, 0x01010142, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046, 0x7f010047 }\nint styleable SwitchCompat_android_textOff 1\nint styleable SwitchCompat_android_textOn 0\nint styleable SwitchCompat_android_thumb 2\nint styleable SwitchCompat_showText 9\nint styleable SwitchCompat_splitTrack 8\nint styleable SwitchCompat_switchMinWidth 6\nint styleable SwitchCompat_switchPadding 7\nint styleable SwitchCompat_switchTextAppearance 5\nint styleable SwitchCompat_thumbTextPadding 4\nint styleable SwitchCompat_track 3\nint[] styleable Theme { 0x01010057, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e, 0x7f01004f, 0x7f010050, 0x7f010051, 0x7f010052, 0x7f010053, 0x7f010054, 0x7f010055, 0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b, 0x7f01005c, 0x7f01005d, 0x7f01005e, 0x7f01005f, 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f, 0x7f010070, 0x7f010071, 0x7f010072, 0x7f010073, 0x7f010074, 0x7f010075, 0x7f010076, 0x7f010077, 0x7f010078, 0x7f010079, 0x7f01007a, 0x7f01007b, 0x7f01007c, 0x7f01007d, 0x7f01007e, 0x7f01007f, 0x7f010080, 0x7f010081, 0x7f010082, 0x7f010083, 0x7f010084, 0x7f010085, 0x7f010086, 0x7f010087, 0x7f010088, 0x7f010089, 0x7f01008a, 0x7f01008b, 0x7f01008c, 0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090, 0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094, 0x7f010095, 0x7f010096, 0x7f010097, 0x7f010098, 0x7f010099 }\nint styleable Theme_actionBarDivider 19\nint styleable Theme_actionBarItemBackground 20\nint styleable Theme_actionBarPopupTheme 13\nint styleable Theme_actionBarSize 18\nint styleable Theme_actionBarSplitStyle 15\nint styleable Theme_actionBarStyle 14\nint styleable Theme_actionBarTabBarStyle 9\nint styleable Theme_actionBarTabStyle 8\nint styleable Theme_actionBarTabTextStyle 10\nint styleable Theme_actionBarTheme 16\nint styleable Theme_actionBarWidgetTheme 17\nint styleable Theme_actionButtonStyle 43\nint styleable Theme_actionDropDownStyle 38\nint styleable Theme_actionMenuTextAppearance 21\nint styleable Theme_actionMenuTextColor 22\nint styleable Theme_actionModeBackground 25\nint styleable Theme_actionModeCloseButtonStyle 24\nint styleable Theme_actionModeCloseDrawable 27\nint styleable Theme_actionModeCopyDrawable 29\nint styleable Theme_actionModeCutDrawable 28\nint styleable Theme_actionModeFindDrawable 33\nint styleable Theme_actionModePasteDrawable 30\nint styleable Theme_actionModePopupWindowStyle 35\nint styleable Theme_actionModeSelectAllDrawable 31\nint styleable Theme_actionModeShareDrawable 32\nint styleable Theme_actionModeSplitBackground 26\nint styleable Theme_actionModeStyle 23\nint styleable Theme_actionModeWebSearchDrawable 34\nint styleable Theme_actionOverflowButtonStyle 11\nint styleable Theme_actionOverflowMenuStyle 12\nint styleable Theme_activityChooserViewStyle 50\nint styleable Theme_android_windowIsFloating 0\nint styleable Theme_buttonBarButtonStyle 45\nint styleable Theme_buttonBarStyle 44\nint styleable Theme_colorAccent 77\nint styleable Theme_colorButtonNormal 81\nint styleable Theme_colorControlActivated 79\nint styleable Theme_colorControlHighlight 80\nint styleable Theme_colorControlNormal 78\nint styleable Theme_colorPrimary 75\nint styleable Theme_colorPrimaryDark 76\nint styleable Theme_colorSwitchThumbNormal 82\nint styleable Theme_dividerHorizontal 49\nint styleable Theme_dividerVertical 48\nint styleable Theme_dropDownListViewStyle 67\nint styleable Theme_dropdownListPreferredItemHeight 39\nint styleable Theme_editTextBackground 56\nint styleable Theme_editTextColor 55\nint styleable Theme_homeAsUpIndicator 42\nint styleable Theme_listChoiceBackgroundIndicator 74\nint styleable Theme_listPopupWindowStyle 68\nint styleable Theme_listPreferredItemHeight 62\nint styleable Theme_listPreferredItemHeightLarge 64\nint styleable Theme_listPreferredItemHeightSmall 63\nint styleable Theme_listPreferredItemPaddingLeft 65\nint styleable Theme_listPreferredItemPaddingRight 66\nint styleable Theme_panelBackground 71\nint styleable Theme_panelMenuListTheme 73\nint styleable Theme_panelMenuListWidth 72\nint styleable Theme_popupMenuStyle 53\nint styleable Theme_popupWindowStyle 54\nint styleable Theme_searchViewStyle 61\nint styleable Theme_selectableItemBackground 46\nint styleable Theme_selectableItemBackgroundBorderless 47\nint styleable Theme_spinnerDropDownItemStyle 41\nint styleable Theme_spinnerStyle 40\nint styleable Theme_switchStyle 57\nint styleable Theme_textAppearanceLargePopupMenu 36\nint styleable Theme_textAppearanceListItem 69\nint styleable Theme_textAppearanceListItemSmall 70\nint styleable Theme_textAppearanceSearchResultSubtitle 59\nint styleable Theme_textAppearanceSearchResultTitle 58\nint styleable Theme_textAppearanceSmallPopupMenu 37\nint styleable Theme_textColorSearchUrl 60\nint styleable Theme_toolbarNavigationButtonStyle 52\nint styleable Theme_toolbarStyle 51\nint styleable Theme_windowActionBar 1\nint styleable Theme_windowActionBarOverlay 2\nint styleable Theme_windowActionModeOverlay 3\nint styleable Theme_windowFixedHeightMajor 7\nint styleable Theme_windowFixedHeightMinor 5\nint styleable Theme_windowFixedWidthMajor 4\nint styleable Theme_windowFixedWidthMinor 6\nint[] styleable Toolbar { 0x010100af, 0x01010140, 0x7f010003, 0x7f010006, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001b, 0x7f01009a, 0x7f01009b, 0x7f01009c, 0x7f01009d, 0x7f01009e, 0x7f01009f, 0x7f0100a0, 0x7f0100a1, 0x7f0100a2, 0x7f0100a3, 0x7f0100a4, 0x7f0100a5, 0x7f0100a6 }\nint styleable Toolbar_android_gravity 0\nint styleable Toolbar_android_minHeight 1\nint styleable Toolbar_collapseContentDescription 19\nint styleable Toolbar_collapseIcon 18\nint styleable Toolbar_contentInsetEnd 5\nint styleable Toolbar_contentInsetLeft 6\nint styleable Toolbar_contentInsetRight 7\nint styleable Toolbar_contentInsetStart 4\nint styleable Toolbar_maxButtonHeight 16\nint styleable Toolbar_navigationContentDescription 21\nint styleable Toolbar_navigationIcon 20\nint styleable Toolbar_popupTheme 8\nint styleable Toolbar_subtitle 3\nint styleable Toolbar_subtitleTextAppearance 10\nint styleable Toolbar_theme 17\nint styleable Toolbar_title 2\nint styleable Toolbar_titleMarginBottom 15\nint styleable Toolbar_titleMarginEnd 13\nint styleable Toolbar_titleMarginStart 12\nint styleable Toolbar_titleMarginTop 14\nint styleable Toolbar_titleMargins 11\nint styleable Toolbar_titleTextAppearance 9\nint[] styleable View { 0x010100da, 0x7f0100a7, 0x7f0100a8 }\nint styleable View_android_focusable 0\nint styleable View_paddingEnd 2\nint styleable View_paddingStart 1\nint[] styleable ViewStubCompat { 0x010100d0, 0x010100f2, 0x010100f3 }\nint styleable ViewStubCompat_android_id 0\nint styleable ViewStubCompat_android_inflatedId 2\nint styleable ViewStubCompat_android_layout 1\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * $Id: BinFileOutputStream.hpp 553915 2007-07-06 14:57:08Z amassari $\n */\n\n#if !defined(XERCESC_INCLUDE_GUARD_BINFILEOUTPUTSTREAM_HPP)\n#define XERCESC_INCLUDE_GUARD_BINFILEOUTPUTSTREAM_HPP\n\n#include \n#include \n\nXERCES_CPP_NAMESPACE_BEGIN\n\nclass XMLUTIL_EXPORT BinFileOutputStream : public BinOutputStream\n{\npublic :\n // -----------------------------------------------------------------------\n // Constructors and Destructor\n // -----------------------------------------------------------------------\n\n ~BinFileOutputStream();\n\n BinFileOutputStream\n (\n const XMLCh* const fileName\n , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager\n );\n\n BinFileOutputStream\n (\n const char* const fileName\n , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager\n );\n\n // -----------------------------------------------------------------------\n // Getter methods\n // -----------------------------------------------------------------------\n bool getIsOpen() const;\n XMLFilePos getSize() const;\n void reset();\n\n\n // -----------------------------------------------------------------------\n // Implementation of the input stream interface\n // -----------------------------------------------------------------------\n virtual XMLFilePos curPos() const;\n\n virtual void writeBytes\n (\n const XMLByte* const toGo\n , const XMLSize_t maxToWrite\n );\n\n\nprivate :\n // -----------------------------------------------------------------------\n // Unimplemented constructors and operators\n // -----------------------------------------------------------------------\n BinFileOutputStream(const BinFileOutputStream&);\n BinFileOutputStream& operator=(const BinFileOutputStream&); \n\n // -----------------------------------------------------------------------\n // Private data members\n //\n // fSource\n // The source file that we represent. The FileHandle type is defined\n // per platform.\n // -----------------------------------------------------------------------\n FileHandle fSource;\n MemoryManager* const fMemoryManager;\n};\n\n\n// ---------------------------------------------------------------------------\n// BinFileOutputStream: Getter methods\n// ---------------------------------------------------------------------------\ninline bool BinFileOutputStream::getIsOpen() const\n{\n return (fSource != (FileHandle) XERCES_Invalid_File_Handle);\n}\n\nXERCES_CPP_NAMESPACE_END\n\n#endif\n"} +{"text": "// Copyright 2020 The Defold Foundation\n// Licensed under the Defold License version 1.0 (the \"License\"); you may not use\n// this file except in compliance with the License.\n// \n// You may obtain a copy of the License, together with FAQs at\n// https://www.defold.com/license\n// \n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef DM_HTTP_CLIENT_PRIVATE_H\n#define DM_HTTP_CLIENT_PRIVATE_H\n\nnamespace dmHttpClientPrivate\n{\n enum ParseResult\n {\n PARSE_RESULT_NEED_MORE_DATA = 1,\n PARSE_RESULT_OK = 0,\n PARSE_RESULT_SYNTAX_ERROR = -1,\n };\n\n ParseResult ParseHeader(char* header_str,\n void* user_data,\n bool end_of_receive,\n void (*version)(void* user_data, int major, int minor, int status, const char* status_str),\n void (*header)(void* user_data, const char* key, const char* value),\n void (*body)(void* user_data, int offset));\n\n} // namespace dmHttpClientPrivate\n\n#endif // DM_HTTP_CLIENT_PRIVATE_H\n"} +{"text": "/**\n * This code was generated by\n * \\ / _ _ _| _ _\n * | (_)\\/(_)(_|\\/| |(/_ v1.0.0\n * / /\n */\n\npackage com.twilio.rest.api.v2010.account;\n\nimport com.google.common.collect.Range;\nimport com.twilio.base.Page;\nimport com.twilio.base.Reader;\nimport com.twilio.base.ResourceSet;\nimport com.twilio.converter.DateConverter;\nimport com.twilio.exception.ApiConnectionException;\nimport com.twilio.exception.ApiException;\nimport com.twilio.exception.RestException;\nimport com.twilio.http.HttpMethod;\nimport com.twilio.http.Request;\nimport com.twilio.http.Response;\nimport com.twilio.http.TwilioRestClient;\nimport com.twilio.rest.Domains;\n\nimport java.time.LocalDate;\nimport java.time.format.DateTimeFormatter;\n\npublic class ConferenceReader extends Reader {\n private String pathAccountSid;\n private LocalDate absoluteDateCreated;\n private Range rangeDateCreated;\n private LocalDate absoluteDateUpdated;\n private Range rangeDateUpdated;\n private String friendlyName;\n private Conference.Status status;\n\n /**\n * Construct a new ConferenceReader.\n */\n public ConferenceReader() {\n }\n\n /**\n * Construct a new ConferenceReader.\n *\n * @param pathAccountSid The SID of the Account that created the resource(s) to\n * read\n */\n public ConferenceReader(final String pathAccountSid) {\n this.pathAccountSid = pathAccountSid;\n }\n\n /**\n * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to\n * read. To read conferences that started on or before midnight on a date, use\n * `<=YYYY-MM-DD`, and to specify conferences that started on or after\n * midnight on a date, use `>=YYYY-MM-DD`..\n *\n * @param absoluteDateCreated The `YYYY-MM-DD` value of the resources to read\n * @return this\n */\n public ConferenceReader setDateCreated(final LocalDate absoluteDateCreated) {\n this.rangeDateCreated = null;\n this.absoluteDateCreated = absoluteDateCreated;\n return this;\n }\n\n /**\n * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to\n * read. To read conferences that started on or before midnight on a date, use\n * `<=YYYY-MM-DD`, and to specify conferences that started on or after\n * midnight on a date, use `>=YYYY-MM-DD`..\n *\n * @param rangeDateCreated The `YYYY-MM-DD` value of the resources to read\n * @return this\n */\n public ConferenceReader setDateCreated(final Range rangeDateCreated) {\n this.absoluteDateCreated = null;\n this.rangeDateCreated = rangeDateCreated;\n return this;\n }\n\n /**\n * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to\n * read. To read conferences that were last updated on or before midnight on a\n * date, use `<=YYYY-MM-DD`, and to specify conferences that were last\n * updated on or after midnight on a given date, use `>=YYYY-MM-DD`..\n *\n * @param absoluteDateUpdated The `YYYY-MM-DD` value of the resources to read\n * @return this\n */\n public ConferenceReader setDateUpdated(final LocalDate absoluteDateUpdated) {\n this.rangeDateUpdated = null;\n this.absoluteDateUpdated = absoluteDateUpdated;\n return this;\n }\n\n /**\n * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to\n * read. To read conferences that were last updated on or before midnight on a\n * date, use `<=YYYY-MM-DD`, and to specify conferences that were last\n * updated on or after midnight on a given date, use `>=YYYY-MM-DD`..\n *\n * @param rangeDateUpdated The `YYYY-MM-DD` value of the resources to read\n * @return this\n */\n public ConferenceReader setDateUpdated(final Range rangeDateUpdated) {\n this.absoluteDateUpdated = null;\n this.rangeDateUpdated = rangeDateUpdated;\n return this;\n }\n\n /**\n * The string that identifies the Conference resources to read..\n *\n * @param friendlyName The string that identifies the Conference resources to\n * read\n * @return this\n */\n public ConferenceReader setFriendlyName(final String friendlyName) {\n this.friendlyName = friendlyName;\n return this;\n }\n\n /**\n * The status of the resources to read. Can be: `init`, `in-progress`, or\n * `completed`..\n *\n * @param status The status of the resources to read\n * @return this\n */\n public ConferenceReader setStatus(final Conference.Status status) {\n this.status = status;\n return this;\n }\n\n /**\n * Make the request to the Twilio API to perform the read.\n *\n * @param client TwilioRestClient with which to make the request\n * @return Conference ResourceSet\n */\n @Override\n public ResourceSet read(final TwilioRestClient client) {\n return new ResourceSet<>(this, client, firstPage(client));\n }\n\n /**\n * Make the request to the Twilio API to perform the read.\n *\n * @param client TwilioRestClient with which to make the request\n * @return Conference ResourceSet\n */\n @Override\n @SuppressWarnings(\"checkstyle:linelength\")\n public Page firstPage(final TwilioRestClient client) {\n this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid;\n Request request = new Request(\n HttpMethod.GET,\n Domains.API.toString(),\n \"/2010-04-01/Accounts/\" + this.pathAccountSid + \"/Conferences.json\"\n );\n\n addQueryParams(request);\n return pageForRequest(client, request);\n }\n\n /**\n * Retrieve the target page from the Twilio API.\n *\n * @param targetUrl API-generated URL for the requested results page\n * @param client TwilioRestClient with which to make the request\n * @return Conference ResourceSet\n */\n @Override\n @SuppressWarnings(\"checkstyle:linelength\")\n public Page getPage(final String targetUrl, final TwilioRestClient client) {\n this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid;\n Request request = new Request(\n HttpMethod.GET,\n targetUrl\n );\n\n return pageForRequest(client, request);\n }\n\n /**\n * Retrieve the next page from the Twilio API.\n *\n * @param page current page\n * @param client TwilioRestClient with which to make the request\n * @return Next Page\n */\n @Override\n public Page nextPage(final Page page,\n final TwilioRestClient client) {\n Request request = new Request(\n HttpMethod.GET,\n page.getNextPageUrl(Domains.API.toString())\n );\n return pageForRequest(client, request);\n }\n\n /**\n * Retrieve the previous page from the Twilio API.\n *\n * @param page current page\n * @param client TwilioRestClient with which to make the request\n * @return Previous Page\n */\n @Override\n public Page previousPage(final Page page,\n final TwilioRestClient client) {\n Request request = new Request(\n HttpMethod.GET,\n page.getPreviousPageUrl(Domains.API.toString())\n );\n return pageForRequest(client, request);\n }\n\n /**\n * Generate a Page of Conference Resources for a given request.\n *\n * @param client TwilioRestClient with which to make the request\n * @param request Request to generate a page for\n * @return Page for the Request\n */\n private Page pageForRequest(final TwilioRestClient client, final Request request) {\n Response response = client.request(request);\n\n if (response == null) {\n throw new ApiConnectionException(\"Conference read failed: Unable to connect to server\");\n } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {\n RestException restException = RestException.fromJson(response.getStream(), client.getObjectMapper());\n if (restException == null) {\n throw new ApiException(\"Server Error, no content\");\n }\n throw new ApiException(restException);\n }\n\n return Page.fromJson(\n \"conferences\",\n response.getContent(),\n Conference.class,\n client.getObjectMapper()\n );\n }\n\n /**\n * Add the requested query string arguments to the Request.\n *\n * @param request Request to add query string arguments to\n */\n private void addQueryParams(final Request request) {\n if (absoluteDateCreated != null) {\n request.addQueryParam(\"DateCreated\", absoluteDateCreated.format(DateTimeFormatter.ofPattern(Request.QUERY_STRING_DATE_FORMAT)));\n } else if (rangeDateCreated != null) {\n request.addQueryDateRange(\"DateCreated\", rangeDateCreated);\n }\n\n if (absoluteDateUpdated != null) {\n request.addQueryParam(\"DateUpdated\", absoluteDateUpdated.format(DateTimeFormatter.ofPattern(Request.QUERY_STRING_DATE_FORMAT)));\n } else if (rangeDateUpdated != null) {\n request.addQueryDateRange(\"DateUpdated\", rangeDateUpdated);\n }\n\n if (friendlyName != null) {\n request.addQueryParam(\"FriendlyName\", friendlyName);\n }\n\n if (status != null) {\n request.addQueryParam(\"Status\", status.toString());\n }\n\n if (getPageSize() != null) {\n request.addQueryParam(\"PageSize\", Integer.toString(getPageSize()));\n }\n }\n}"} +{"text": "/**\n * Licensed to Cloudera, Inc. under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. Cloudera, Inc. licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.cloudera.flume.handlers.debug;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\nimport java.io.IOException;\n\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport com.cloudera.flume.conf.Context;\nimport com.cloudera.flume.conf.FlumeBuilder;\nimport com.cloudera.flume.conf.FlumeSpecException;\nimport com.cloudera.flume.conf.LogicalNodeContext;\nimport com.cloudera.flume.conf.ReportTestingContext;\nimport com.cloudera.flume.conf.SinkFactory.SinkDecoBuilder;\nimport com.cloudera.flume.core.Attributes;\nimport com.cloudera.flume.core.EventImpl;\nimport com.cloudera.flume.core.EventSink;\nimport com.cloudera.flume.core.EventSinkDecorator;\nimport com.cloudera.flume.core.EventSource;\nimport com.cloudera.flume.core.EventUtil;\nimport com.cloudera.flume.handlers.debug.BloomCheckDecorator.BloomCheckState;\nimport com.cloudera.flume.reporter.ReportEvent;\nimport com.cloudera.flume.reporter.ReportManager;\nimport com.cloudera.flume.reporter.aggregator.CounterSink;\nimport com.cloudera.util.bloom.BloomSet;\n\n/**\n * These test the bloom set injector and bloom set checker decorators.\n * \n * These are generally done on the order of 100M messages -- which is the size\n * of the current scaling test framework. This is cpu intensive and probably\n * should not be used in production, until its performance characteristics are\n * better understood.\n * \n */\npublic class TestBloomSetDecos {\n\n @Test\n public void testBloomSetCompare() {\n BloomSet b1 = new BloomSet(10000, 5);\n BloomSet b2 = new BloomSet(10000, 5);\n\n for (int i = 0; i < 10; i++) {\n b1.addInt(i);\n if (i % 2 == 0)\n b2.addInt(i);\n }\n\n assertEquals(b1, b1);\n assertEquals(b2, b2);\n assertTrue(b1.contains(b2));\n assertFalse(b2.contains(b1));\n }\n\n /**\n * The parameters of the bloom filters are different so this should always\n * reject.\n */\n @Test(expected = IllegalArgumentException.class)\n public void testBloomBadSizes() {\n BloomSet b1 = new BloomSet(10000, 5);\n BloomSet b2 = new BloomSet(10000, 6);\n\n for (int i = 0; i < 10; i++) {\n b1.addInt(i);\n b2.addInt(i);\n }\n\n assertFalse(b1.contains(b2));\n assertFalse(b2.contains(b1));\n }\n\n /**\n * Test it with larger number of events and larger number of slots. This\n * function may be fragile -- while this should always pass it doesn't reveal\n * what the false positive rate is.\n */\n @Test\n @Ignore(\"Takes too long to run\")\n public void testBloomSetCompare100M() {\n // generally we want about 9-10 bits per entry.\n BloomSet b1 = new BloomSet(1000000000, 2); // 1B bits ~= 125MB\n BloomSet b2 = new BloomSet(1000000000, 2);\n\n // int drop = 543215432; // drop this one..\n // int drop = 543215431; // drop this one..\n int drop = 54323423;\n for (int i = 0; i < 100000000; i++) { // 100M \"entries\"\n b1.addInt(i);\n\n if (i != drop)\n // oops, we dropped one.\n b2.addInt(i);\n }\n\n assertTrue(b1.contains(b2));\n assertFalse(b2.contains(b1));\n }\n\n /** Test it with larger number of events and larger number of slots. */\n @Test\n @Ignore(\"Takes too long to run\")\n public void testBloomSetCompare100Mx10M() {\n // generally we want about 9-10 bits per entry.\n BloomSet b1 = new BloomSet(1000000000, 2); // 1B bits ~= 125MB\n BloomSet b2 = new BloomSet(1000000000, 2);\n\n for (int i = 0; i < 100000000; i++) { // 100M \"entries\"\n if (i != 234000)\n b1.addInt(i); // drop one that is included in the other set.\n\n if (i <= 10000000)\n b2.addInt(i);\n\n // only add the first 10M to the second hash\n }\n\n assertFalse(b1.contains(b2)); // b1 doesn't have all b2 has!\n assertFalse(b2.contains(b1));\n }\n\n @Test\n public void testBloomGenBuilders() {\n SinkDecoBuilder b = BloomGeneratorDeco.builder();\n Context ctx = new Context();\n b.build(ctx, \"2234\", \"123\");\n b.build(ctx, \"1234\");\n b.build(ctx);\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void testBloomGenBuilderFail() {\n SinkDecoBuilder b = BloomGeneratorDeco.builder();\n b.build(new Context(), \"2234\", \"123\", \"r3414\");\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void testBloomGenBuilderFail2() {\n SinkDecoBuilder b = BloomGeneratorDeco.builder();\n b.build(new Context(), \"r3414\");\n }\n\n @Test\n public void testBloomCheckBuilders() {\n SinkDecoBuilder b = BloomGeneratorDeco.builder();\n Context ctx = new Context();\n b.build(ctx, \"2234\", \"123\");\n b.build(ctx, \"1234\");\n b.build(ctx);\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void testBloomCheckBuilderFail() {\n SinkDecoBuilder b = BloomGeneratorDeco.builder();\n b.build(new Context(), \"2234\", \"123\", \"r3414\");\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void testBloomCheckBuilderFail2() {\n SinkDecoBuilder b = BloomGeneratorDeco.builder();\n b.build(new Context(), \"r3414\");\n }\n\n @Test\n public void testBuildWithRptSink() throws FlumeSpecException {\n String spec = \"{bloomCheck(1,2, \\\"text(\\\\\\\"test\\\\\\\")\\\") => null } \";\n FlumeBuilder.buildSink(new Context(), spec);\n }\n\n /**\n * Instantiate decos, run them and check their reports.\n * \n * @throws InterruptedException\n */\n @SuppressWarnings(\"unchecked\")\n @Test\n public void testBloomDecos() throws FlumeSpecException, IOException,\n InterruptedException {\n String spec = \"{ bloomGen(10000,2) => { bloomCheck(10000,2) => counter(\\\"test\\\")} } \";\n EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), spec);\n EventSource src = FlumeBuilder.buildSource(LogicalNodeContext\n .testingContext(), \"asciisynth(10000)\");\n snk.open();\n src.open();\n EventUtil.dumpAll(src, snk);\n src.close();\n snk.close();\n\n CounterSink ctr = (CounterSink) ReportManager.get().getReportable(\"test\");\n assertEquals(ctr.getCount(), 10000);\n\n // Hack until we get a better mechanism:\n BloomCheckDecorator bcd = (BloomCheckDecorator) (((EventSinkDecorator) snk)\n .getSink());\n ReportEvent r = bcd.getMetrics();\n assertEquals(BloomCheckState.SUCCESS.toString(), new String(r\n .get(BloomCheckDecorator.A_STATE)));\n assertEquals(1, Attributes.readInt(r, BloomCheckDecorator.A_SUCCESS)\n .intValue());\n assertEquals(0, Attributes.readInt(r, BloomCheckDecorator.A_FAILS)\n .intValue());\n }\n\n /**\n * Tests to make sure the report sink receives data.\n * \n * @throws InterruptedException\n */\n @Test\n public void testBloomReportSink() throws FlumeSpecException, IOException,\n InterruptedException {\n String spec = \"{bloomGen(100,2) => {bloomCheck(100,2,\\\"counter(\\\\\\\"test\\\\\\\") \\\") => counter(\\\"total\\\") } } }\";\n EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), spec);\n snk.open();\n snk.append(new EventImpl(new byte[0]));\n snk.append(new EventImpl(new byte[0]));\n\n CounterSink ctr = (CounterSink) ReportManager.get().getReportable(\"test\");\n assertEquals(0, ctr.getCount());\n CounterSink total = (CounterSink) ReportManager.get()\n .getReportable(\"total\");\n assertEquals(2, total.getCount());\n\n snk.close(); // will trigger a bloom report.\n assertEquals(1, ctr.getCount());\n }\n\n}\n"} +{"text": "// Copyright (c) rubicon IT GmbH, www.rubicon.eu\r\n//\r\n// See the NOTICE file distributed with this work for additional information\r\n// regarding copyright ownership. rubicon licenses this file to you under \r\n// the Apache License, Version 2.0 (the \"License\"); you may not use this \r\n// file except in compliance with the License. You may obtain a copy of the \r\n// License at\r\n//\r\n// http://www.apache.org/licenses/LICENSE-2.0\r\n//\r\n// Unless required by applicable law or agreed to in writing, software \r\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT \r\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the \r\n// License for the specific language governing permissions and limitations\r\n// under the License.\r\n// \r\nusing System.Linq.Expressions;\r\n\r\nnamespace Remotion.Linq.Parsing.ExpressionTreeVisitors.Transformation\r\n{\r\n\t/// \r\n\t/// Transforms a given . If the can handle the ,\r\n\t/// it should return a new, transformed instance. Otherwise, it should return the input \r\n\t/// instance.\r\n\t/// \r\n\t/// The expression to be transformed.\r\n\t/// The result of the transformation, or if no transformation was applied.\r\n\tpublic delegate Expression ExpressionTransformation(Expression expression);\r\n}"} +{"text": "//===--- TestVisitor.h ------------------------------------------*- C++ -*-===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n///\n/// \\file\n/// \\brief Defines utility templates for RecursiveASTVisitor related tests.\n///\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_CLANG_UNITTESTS_TOOLING_TESTVISITOR_H\n#define LLVM_CLANG_UNITTESTS_TOOLING_TESTVISITOR_H\n\n#include \"clang/AST/ASTConsumer.h\"\n#include \"clang/AST/ASTContext.h\"\n#include \"clang/AST/RecursiveASTVisitor.h\"\n#include \"clang/Frontend/CompilerInstance.h\"\n#include \"clang/Frontend/FrontendAction.h\"\n#include \"clang/Tooling/Tooling.h\"\n#include \"gtest/gtest.h\"\n#include \n\nnamespace clang {\n\n/// \\brief Base class for simple RecursiveASTVisitor based tests.\n///\n/// This is a drop-in replacement for RecursiveASTVisitor itself, with the\n/// additional capability of running it over a snippet of code.\n///\n/// Visits template instantiations and implicit code by default.\ntemplate \nclass TestVisitor : public RecursiveASTVisitor {\npublic:\n TestVisitor() { }\n\n virtual ~TestVisitor() { }\n\n enum Language {\n Lang_C,\n Lang_CXX98,\n Lang_CXX11,\n Lang_CXX14,\n Lang_CXX17,\n Lang_CXX2a,\n Lang_OBJC,\n Lang_OBJCXX11,\n Lang_CXX = Lang_CXX98\n };\n\n /// \\brief Runs the current AST visitor over the given code.\n bool runOver(StringRef Code, Language L = Lang_CXX) {\n std::vector Args;\n switch (L) {\n case Lang_C:\n Args.push_back(\"-x\");\n Args.push_back(\"c\");\n break;\n case Lang_CXX98: Args.push_back(\"-std=c++98\"); break;\n case Lang_CXX11: Args.push_back(\"-std=c++11\"); break;\n case Lang_CXX14: Args.push_back(\"-std=c++14\"); break;\n case Lang_CXX17: Args.push_back(\"-std=c++17\"); break;\n case Lang_CXX2a: Args.push_back(\"-std=c++2a\"); break;\n case Lang_OBJC:\n Args.push_back(\"-ObjC\");\n Args.push_back(\"-fobjc-runtime=macosx-10.12.0\");\n break;\n case Lang_OBJCXX11:\n Args.push_back(\"-ObjC++\");\n Args.push_back(\"-std=c++11\");\n Args.push_back(\"-fblocks\");\n break;\n }\n return tooling::runToolOnCodeWithArgs(CreateTestAction(), Code, Args);\n }\n\n bool shouldVisitTemplateInstantiations() const {\n return true;\n }\n\n bool shouldVisitImplicitCode() const {\n return true;\n }\n\nprotected:\n virtual ASTFrontendAction* CreateTestAction() {\n return new TestAction(this);\n }\n\n class FindConsumer : public ASTConsumer {\n public:\n FindConsumer(TestVisitor *Visitor) : Visitor(Visitor) {}\n\n void HandleTranslationUnit(clang::ASTContext &Context) override {\n Visitor->Context = &Context;\n Visitor->TraverseDecl(Context.getTranslationUnitDecl());\n }\n\n private:\n TestVisitor *Visitor;\n };\n\n class TestAction : public ASTFrontendAction {\n public:\n TestAction(TestVisitor *Visitor) : Visitor(Visitor) {}\n\n std::unique_ptr\n CreateASTConsumer(CompilerInstance &, llvm::StringRef dummy) override {\n /// TestConsumer will be deleted by the framework calling us.\n return llvm::make_unique(Visitor);\n }\n\n protected:\n TestVisitor *Visitor;\n };\n\n ASTContext *Context;\n};\n\n/// \\brief A RecursiveASTVisitor to check that certain matches are (or are\n/// not) observed during visitation.\n///\n/// This is a RecursiveASTVisitor for testing the RecursiveASTVisitor itself,\n/// and allows simple creation of test visitors running matches on only a small\n/// subset of the Visit* methods.\ntemplate class Visitor = TestVisitor>\nclass ExpectedLocationVisitor : public Visitor {\npublic:\n /// \\brief Expect 'Match' *not* to occur at the given 'Line' and 'Column'.\n ///\n /// Any number of matches can be disallowed.\n void DisallowMatch(Twine Match, unsigned Line, unsigned Column) {\n DisallowedMatches.push_back(MatchCandidate(Match, Line, Column));\n }\n\n /// \\brief Expect 'Match' to occur at the given 'Line' and 'Column'.\n ///\n /// Any number of expected matches can be set by calling this repeatedly.\n /// Each is expected to be matched 'Times' number of times. (This is useful in\n /// cases in which different AST nodes can match at the same source code\n /// location.)\n void ExpectMatch(Twine Match, unsigned Line, unsigned Column,\n unsigned Times = 1) {\n ExpectedMatches.push_back(ExpectedMatch(Match, Line, Column, Times));\n }\n\n /// \\brief Checks that all expected matches have been found.\n ~ExpectedLocationVisitor() override {\n for (typename std::vector::const_iterator\n It = ExpectedMatches.begin(), End = ExpectedMatches.end();\n It != End; ++It) {\n It->ExpectFound();\n }\n }\n\nprotected:\n /// \\brief Checks an actual match against expected and disallowed matches.\n ///\n /// Implementations are required to call this with appropriate values\n /// for 'Name' during visitation.\n void Match(StringRef Name, SourceLocation Location) {\n const FullSourceLoc FullLocation = this->Context->getFullLoc(Location);\n\n for (typename std::vector::const_iterator\n It = DisallowedMatches.begin(), End = DisallowedMatches.end();\n It != End; ++It) {\n EXPECT_FALSE(It->Matches(Name, FullLocation))\n << \"Matched disallowed \" << *It;\n }\n\n for (typename std::vector::iterator\n It = ExpectedMatches.begin(), End = ExpectedMatches.end();\n It != End; ++It) {\n It->UpdateFor(Name, FullLocation, this->Context->getSourceManager());\n }\n }\n\n private:\n struct MatchCandidate {\n std::string ExpectedName;\n unsigned LineNumber;\n unsigned ColumnNumber;\n\n MatchCandidate(Twine Name, unsigned LineNumber, unsigned ColumnNumber)\n : ExpectedName(Name.str()), LineNumber(LineNumber),\n ColumnNumber(ColumnNumber) {\n }\n\n bool Matches(StringRef Name, FullSourceLoc const &Location) const {\n return MatchesName(Name) && MatchesLocation(Location);\n }\n\n bool PartiallyMatches(StringRef Name, FullSourceLoc const &Location) const {\n return MatchesName(Name) || MatchesLocation(Location);\n }\n\n bool MatchesName(StringRef Name) const {\n return Name == ExpectedName;\n }\n\n bool MatchesLocation(FullSourceLoc const &Location) const {\n return Location.isValid() &&\n Location.getSpellingLineNumber() == LineNumber &&\n Location.getSpellingColumnNumber() == ColumnNumber;\n }\n\n friend std::ostream &operator<<(std::ostream &Stream,\n MatchCandidate const &Match) {\n return Stream << Match.ExpectedName\n << \" at \" << Match.LineNumber << \":\" << Match.ColumnNumber;\n }\n };\n\n struct ExpectedMatch {\n ExpectedMatch(Twine Name, unsigned LineNumber, unsigned ColumnNumber,\n unsigned Times)\n : Candidate(Name, LineNumber, ColumnNumber), TimesExpected(Times),\n TimesSeen(0) {}\n\n void UpdateFor(StringRef Name, FullSourceLoc Location, SourceManager &SM) {\n if (Candidate.Matches(Name, Location)) {\n EXPECT_LT(TimesSeen, TimesExpected);\n ++TimesSeen;\n } else if (TimesSeen < TimesExpected &&\n Candidate.PartiallyMatches(Name, Location)) {\n llvm::raw_string_ostream Stream(PartialMatches);\n Stream << \", partial match: \\\"\" << Name << \"\\\" at \";\n Location.print(Stream, SM);\n }\n }\n\n void ExpectFound() const {\n EXPECT_EQ(TimesExpected, TimesSeen)\n << \"Expected \\\"\" << Candidate.ExpectedName\n << \"\\\" at \" << Candidate.LineNumber\n << \":\" << Candidate.ColumnNumber << PartialMatches;\n }\n\n MatchCandidate Candidate;\n std::string PartialMatches;\n unsigned TimesExpected;\n unsigned TimesSeen;\n };\n\n std::vector DisallowedMatches;\n std::vector ExpectedMatches;\n};\n}\n\n#endif\n"} +{"text": "@echo off & setlocal ENABLEEXTENSIONS\nset BACKUP_PATH=D:\\workspaceWeSync\\weSync\\DB_Backup\\Target\nset DATABASES=TEST_2017_M\nset HOST=localhost\nset USERNAME=root\nset PASSWORD=123456S\nset MYSQL=D:\\MySQL\nset path_bin_mysql=%MYSQL%\\bin\\\nset YEAR=%date:~0,4%\nset MONTH=%date:~5,2%\nset DAY=%date:~8,2%\nset HOUR=%time:~0,2%\nset MINUTE=%time:~3,2%\nset SECOND=%time:~6,2%\nset DIR=%BACKUP_PATH%\nset ADDON=\"%YEAR%%MONTH%%DAY%_%HOUR%%MINUTE%%SECOND%\"\nif not exist %DIR% (\nmkdir %DIR%\n)\nif not exist %DIR% (\necho Backup path: %DIR% not exists, create dir failed.\ngoto exit\n)\ncd /d %DIR%\necho Start dump databases...\nfor %%D in (%DATABASES%) do (\necho Dumping database %%D ...\n%path_bin_mysql%mysqldump -h%HOST% -u%USERNAME% -p%PASSWORD% --skip-lock-tables %%D > %%D_%ADDON%.sql\n)\necho Done\n:exit"} +{"text": ""} +{"text": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t22EDB81F1AD680AD008515E4 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22EDB81D1AD680AD008515E4 /* Launch Screen.xib */; };\n\t\tF45C69FD195D964F00615E3A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45C69FC195D964F00615E3A /* AppDelegate.swift */; };\n\t\tF45C69FF195D964F00615E3A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45C69FE195D964F00615E3A /* ViewController.swift */; };\n\t\tF45C6A02195D965000615E3A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F45C6A00195D965000615E3A /* Main.storyboard */; };\n\t\tF45C6A04195D965000615E3A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F45C6A03195D965000615E3A /* Images.xcassets */; };\n\t\tF45C6A10195D965000615E3A /* FontasticTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45C6A0F195D965000615E3A /* FontasticTests.swift */; };\n\t\tF4C41C44196ADC9900D6BD66 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = F4C41C42196ADC9900D6BD66 /* LICENSE.txt */; };\n\t\tF4C41C45196ADC9900D6BD66 /* PermanentMarker.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F4C41C43196ADC9900D6BD66 /* PermanentMarker.ttf */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\tF45C6A0A195D965000615E3A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = F45C69EF195D964F00615E3A /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = F45C69F6195D964F00615E3A;\n\t\t\tremoteInfo = Fontastic;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t22EDB81E1AD680AD008515E4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = \"Base.lproj/Launch Screen.xib\"; sourceTree = \"\"; };\n\t\tF45C69F7195D964F00615E3A /* Fontastic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Fontastic.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tF45C69FB195D964F00615E3A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"\"; };\n\t\tF45C69FC195D964F00615E3A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"\"; };\n\t\tF45C69FE195D964F00615E3A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = \"\"; };\n\t\tF45C6A01195D965000615E3A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"\"; };\n\t\tF45C6A03195D965000615E3A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = \"\"; };\n\t\tF45C6A09195D965000615E3A /* FontasticTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FontasticTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tF45C6A0E195D965000615E3A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"\"; };\n\t\tF45C6A0F195D965000615E3A /* FontasticTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontasticTests.swift; sourceTree = \"\"; };\n\t\tF4C41C42196ADC9900D6BD66 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = \"\"; };\n\t\tF4C41C43196ADC9900D6BD66 /* PermanentMarker.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = PermanentMarker.ttf; sourceTree = \"\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tF45C69F4195D964F00615E3A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tF45C6A06195D965000615E3A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tF45C69EE195D964F00615E3A = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C69F9195D964F00615E3A /* Fontastic */,\n\t\t\t\tF45C6A0C195D965000615E3A /* FontasticTests */,\n\t\t\t\tF45C69F8195D964F00615E3A /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C69F8195D964F00615E3A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C69F7195D964F00615E3A /* Fontastic.app */,\n\t\t\t\tF45C6A09195D965000615E3A /* FontasticTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C69F9195D964F00615E3A /* Fontastic */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C6A19195D9AB400615E3A /* 3rdParty */,\n\t\t\t\tF45C69FC195D964F00615E3A /* AppDelegate.swift */,\n\t\t\t\tF45C69FE195D964F00615E3A /* ViewController.swift */,\n\t\t\t\tF45C6A00195D965000615E3A /* Main.storyboard */,\n\t\t\t\tF45C6A03195D965000615E3A /* Images.xcassets */,\n\t\t\t\tF45C69FA195D964F00615E3A /* Supporting Files */,\n\t\t\t\t22EDB81D1AD680AD008515E4 /* Launch Screen.xib */,\n\t\t\t);\n\t\t\tpath = Fontastic;\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C69FA195D964F00615E3A /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C69FB195D964F00615E3A /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C6A0C195D965000615E3A /* FontasticTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C6A0F195D965000615E3A /* FontasticTests.swift */,\n\t\t\t\tF45C6A0D195D965000615E3A /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = FontasticTests;\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C6A0D195D965000615E3A /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C6A0E195D965000615E3A /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C6A19195D9AB400615E3A /* 3rdParty */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF4C41C42196ADC9900D6BD66 /* LICENSE.txt */,\n\t\t\t\tF4C41C43196ADC9900D6BD66 /* PermanentMarker.ttf */,\n\t\t\t);\n\t\t\tpath = 3rdParty;\n\t\t\tsourceTree = \"\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tF45C69F6195D964F00615E3A /* Fontastic */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = F45C6A13195D965000615E3A /* Build configuration list for PBXNativeTarget \"Fontastic\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tF45C69F3195D964F00615E3A /* Sources */,\n\t\t\t\tF45C69F4195D964F00615E3A /* Frameworks */,\n\t\t\t\tF45C69F5195D964F00615E3A /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Fontastic;\n\t\t\tproductName = Fontastic;\n\t\t\tproductReference = F45C69F7195D964F00615E3A /* Fontastic.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tF45C6A08195D965000615E3A /* FontasticTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = F45C6A16195D965000615E3A /* Build configuration list for PBXNativeTarget \"FontasticTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tF45C6A05195D965000615E3A /* Sources */,\n\t\t\t\tF45C6A06195D965000615E3A /* Frameworks */,\n\t\t\t\tF45C6A07195D965000615E3A /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tF45C6A0B195D965000615E3A /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = FontasticTests;\n\t\t\tproductName = FontasticTests;\n\t\t\tproductReference = F45C6A09195D965000615E3A /* FontasticTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tF45C69EF195D964F00615E3A /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0600;\n\t\t\t\tORGANIZATIONNAME = ShinobiControls;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\tF45C69F6195D964F00615E3A = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.0;\n\t\t\t\t\t};\n\t\t\t\t\tF45C6A08195D965000615E3A = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.0;\n\t\t\t\t\t\tTestTargetID = F45C69F6195D964F00615E3A;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = F45C69F2195D964F00615E3A /* Build configuration list for PBXProject \"Fontastic\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = F45C69EE195D964F00615E3A;\n\t\t\tproductRefGroup = F45C69F8195D964F00615E3A /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tF45C69F6195D964F00615E3A /* Fontastic */,\n\t\t\t\tF45C6A08195D965000615E3A /* FontasticTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\tF45C69F5195D964F00615E3A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tF4C41C44196ADC9900D6BD66 /* LICENSE.txt in Resources */,\n\t\t\t\tF45C6A02195D965000615E3A /* Main.storyboard in Resources */,\n\t\t\t\tF45C6A04195D965000615E3A /* Images.xcassets in Resources */,\n\t\t\t\tF4C41C45196ADC9900D6BD66 /* PermanentMarker.ttf in Resources */,\n\t\t\t\t22EDB81F1AD680AD008515E4 /* Launch Screen.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tF45C6A07195D965000615E3A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tF45C69F3195D964F00615E3A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tF45C69FF195D964F00615E3A /* ViewController.swift in Sources */,\n\t\t\t\tF45C69FD195D964F00615E3A /* AppDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tF45C6A05195D965000615E3A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tF45C6A10195D965000615E3A /* FontasticTests.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\tF45C6A0B195D965000615E3A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = F45C69F6195D964F00615E3A /* Fontastic */;\n\t\t\ttargetProxy = F45C6A0A195D965000615E3A /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t22EDB81D1AD680AD008515E4 /* Launch Screen.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t22EDB81E1AD680AD008515E4 /* Base */,\n\t\t\t);\n\t\t\tname = \"Launch Screen.xib\";\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\tF45C6A00195D965000615E3A /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tF45C6A01195D965000615E3A /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\tF45C6A11195D965000615E3A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMETAL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tF45C6A12195D965000615E3A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMETAL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tF45C6A14195D965000615E3A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = Fontastic/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tF45C6A15195D965000615E3A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = Fontastic/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tF45C6A17195D965000615E3A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(BUILT_PRODUCTS_DIR)/Fontastic.app/Fontastic\";\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = FontasticTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tMETAL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUNDLE_LOADER)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tF45C6A18195D965000615E3A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(BUILT_PRODUCTS_DIR)/Fontastic.app/Fontastic\";\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = FontasticTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tMETAL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUNDLE_LOADER)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tF45C69F2195D964F00615E3A /* Build configuration list for PBXProject \"Fontastic\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tF45C6A11195D965000615E3A /* Debug */,\n\t\t\t\tF45C6A12195D965000615E3A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tF45C6A13195D965000615E3A /* Build configuration list for PBXNativeTarget \"Fontastic\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tF45C6A14195D965000615E3A /* Debug */,\n\t\t\t\tF45C6A15195D965000615E3A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tF45C6A16195D965000615E3A /* Build configuration list for PBXNativeTarget \"FontasticTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tF45C6A17195D965000615E3A /* Debug */,\n\t\t\t\tF45C6A18195D965000615E3A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = F45C69EF195D964F00615E3A /* Project object */;\n}\n"} +{"text": "---\nname: Question\nabout: Ask a question (please read first FAQ and docs)\nlabels: question\n\n---\n\n## Question\n\n\n\n---\n\n- WeeChat version: \n- OS, distribution and version: \n"} +{"text": "// chart\nimport Bar from '../components/Charts/Bar'\nimport ChartCard from '../components/Charts/ChartCard'\nimport Liquid from '../components/Charts/Liquid'\nimport MiniArea from '../components/Charts/MiniArea'\nimport MiniSmoothArea from '../components/Charts/MiniSmoothArea'\nimport MiniBar from '../components/Charts/MiniBar'\nimport MiniProgress from '../components/Charts/MiniProgress'\nimport Radar from '../components/Charts/Radar'\nimport RankList from '../components/Charts/RankList'\nimport TransferBar from '../components/Charts/TransferBar'\nimport TagCloud from '../components/Charts/TagCloud'\n\n// pro components\nimport AvatarList from '../components/AvatarList'\nimport CountDown from '../components/CountDown'\nimport Ellipsis from '../components/Ellipsis'\nimport FooterToolbar from '../components/FooterToolbar'\nimport NumberInfo from '../components/NumberInfo'\nimport DescriptionList from '../components/DescriptionList'\nimport Tree from '../components/Tree/Tree'\nimport Trend from '../components/Trend'\nimport STable from '../components/Table'\nimport MultiTab from '../components/MultiTab'\nimport Result from '../components/Result'\nimport IconSelector from '../components/IconSelector'\nimport TagSelect from '../components/TagSelect'\nimport ExceptionPage from '../components/Exception'\nimport StandardFormRow from '../components/StandardFormRow'\nimport ArticleListContent from '../components/ArticleListContent'\n\nexport {\n AvatarList,\n Bar,\n ChartCard,\n Liquid,\n MiniArea,\n MiniSmoothArea,\n MiniBar,\n MiniProgress,\n Radar,\n TagCloud,\n RankList,\n TransferBar,\n Trend,\n CountDown,\n Ellipsis,\n FooterToolbar,\n NumberInfo,\n DescriptionList,\n // 兼容写法,请勿继续使用\n DescriptionList as DetailList,\n Tree,\n STable,\n MultiTab,\n Result,\n ExceptionPage,\n IconSelector,\n TagSelect,\n StandardFormRow,\n ArticleListContent\n}\n"} +{"text": "var examples = require('./examples');\n\nexamples.def('line', function () {\n Morris.Line({\n element: 'chart',\n data: [\n { x: 0, y: 10, z: 30 }, { x: 1, y: 20, z: 20 },\n { x: 2, y: 30, z: 10 }, { x: 3, y: 30, z: 10 },\n { x: 4, y: 20, z: 20 }, { x: 5, y: 10, z: 30 }\n ],\n xkey: 'x',\n ykeys: ['y', 'z'],\n labels: ['y', 'z'],\n parseTime: false\n });\n window.snapshot();\n});\n\nexamples.def('area', function () {\n Morris.Area({\n element: 'chart',\n data: [\n { x: 0, y: 1, z: 1 }, { x: 1, y: 2, z: 1 },\n { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 },\n { x: 4, y: 2, z: 1 }, { x: 5, y: 1, z: 1 }\n ],\n xkey: 'x',\n ykeys: ['y', 'z'],\n labels: ['y', 'z'],\n parseTime: false\n });\n window.snapshot();\n});\n\nexamples.def('bar', function () {\n Morris.Bar({\n element: 'chart',\n data: [\n { x: 0, y: 1, z: 3 }, { x: 1, y: 2, z: 2 },\n { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 },\n { x: 4, y: 2, z: 2 }, { x: 5, y: 1, z: 3 }\n ],\n xkey: 'x',\n ykeys: ['y', 'z'],\n labels: ['y', 'z']\n });\n window.snapshot();\n});\n\nexamples.def('stacked_bar', function () {\n Morris.Bar({\n element: 'chart',\n data: [\n { x: 0, y: 1, z: 1 }, { x: 1, y: 2, z: 1 },\n { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 },\n { x: 4, y: 2, z: 1 }, { x: 5, y: 1, z: 1 }\n ],\n xkey: 'x',\n ykeys: ['y', 'z'],\n labels: ['y', 'z'],\n stacked: true\n });\n window.snapshot();\n});\n\nexamples.run();\n"} +{"text": "defmodule TestHelper do\n def request(module, conn) do\n Task.async(fn ->\n try do\n module.call(conn, [])\n rescue\n error -> error\n end\n end)\n |> Task.await()\n end\n\n def trigger_report(module) do\n Process.sleep(300)\n GenServer.call(module, :report)\n end\n\n def gather_harvest(harvester) do\n Process.sleep(300)\n harvester.gather_harvest\n end\n\n def restart_harvest_cycle(harvest_cycle) do\n Process.sleep(300)\n GenServer.call(harvest_cycle, :restart)\n end\n\n def pause_harvest_cycle(harvest_cycle) do\n GenServer.call(harvest_cycle, :pause)\n end\n\n def find_metric(metrics, name, call_count \\\\ 1)\n\n def find_metric(metrics, {name, scope}, call_count) do\n Enum.find(metrics, fn\n [%{name: ^name, scope: ^scope}, [^call_count, _, _, _, _, _]] -> true\n _ -> false\n end)\n end\n\n def find_metric(metrics, name, call_count) do\n Enum.find(metrics, fn\n [%{name: ^name, scope: \"\"}, [^call_count, _, _, _, _, _]] -> true\n _ -> false\n end)\n end\n\n def http_request(path, port) do\n {:ok, {{_, _status_code, _}, _headers, body}} =\n :httpc.request('http://localhost:#{port}/#{path}')\n\n {:ok, %{body: to_string(body)}}\n end\n\n alias NewRelic.Harvest.Collector\n\n def simulate_agent_enabled(_context) do\n Process.whereis(Collector.TaskSupervisor) ||\n NewRelic.EnabledSupervisor.start_link(:ok)\n\n :ok\n end\n\n def simulate_agent_run(_context) do\n prev_key = Collector.AgentRun.trusted_account_key()\n Collector.AgentRun.store(:trusted_account_key, \"190\")\n System.put_env(\"NEW_RELIC_HARVEST_ENABLED\", \"true\")\n System.put_env(\"NEW_RELIC_LICENSE_KEY\", \"foo\")\n send(NewRelic.DistributedTrace.BackoffSampler, :reset)\n\n ExUnit.Callbacks.on_exit(fn ->\n Collector.AgentRun.store(:trusted_account_key, prev_key)\n System.delete_env(\"NEW_RELIC_HARVEST_ENABLED\")\n System.delete_env(\"NEW_RELIC_LICENSE_KEY\")\n end)\n\n :ok\n end\nend\n"} +{"text": "\n\n\n\n\n \n \n \n polymer-gestures testing ground\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n \n \n\n"} +{"text": "/**\n D header file for DragonFlyBSD's extensions to POSIX's netinet/in.h.\n\n Copyright: Copyright 2017 -\n License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).\n Authors: $(HTTP jmdavisprog.com, Jonathan M Davis) and Diederik de Groot\n */\nmodule core.sys.dragonflybsd.netinet.in_;\n\nversion (DragonFlyBSD):\n\nimport core.sys.dragonflybsd.sys.cdefs;\n\npublic import core.sys.posix.netinet.in_;\n\nextern(C) nothrow @nogc @system:\n\nenum IPPROTO_HOPOPTS = 0;\n\nenum IPPROTO_IPV4 = 4;\nenum IPPROTO_IPIP = IPPROTO_IPV4;\nenum IPPROTO_ST = 7;\nenum IPPROTO_EGP = 8;\nenum IPPROTO_PIGP = 9;\nenum IPPROTO_RCCMON = 10;\nenum IPPROTO_NVPII = 11;\n\nenum IPPROTO_ARGUS = 13;\nenum IPPROTO_EMCON = 14;\nenum IPPROTO_XNET = 15;\nenum IPPROTO_CHAOS = 16;\nenum IPPROTO_MUX = 18;\nenum IPPROTO_MEAS = 19;\nenum IPPROTO_HMP = 20;\nenum IPPROTO_PRM = 21;\n\nenum IPPROTO_TRUNK1 = 23;\nenum IPPROTO_TRUNK2 = 24;\nenum IPPROTO_LEAF1 = 25;\nenum IPPROTO_LEAF2 = 26;\nenum IPPROTO_RDP = 27;\nenum IPPROTO_IRTP = 28;\nenum IPPROTO_TP = 29;\nenum IPPROTO_BLT = 30;\nenum IPPROTO_NSP = 31;\nenum IPPROTO_INP = 32;\nenum IPPROTO_SEP = 33;\nenum IPPROTO_3PC = 34;\nenum IPPROTO_IDPR = 35;\nenum IPPROTO_XTP = 36;\nenum IPPROTO_DDP = 37;\nenum IPPROTO_CMTP = 38;\nenum IPPROTO_TPXX = 39;\nenum IPPROTO_IL = 40;\nenum IPPROTO_SDRP = 42;\nenum IPPROTO_ROUTING = 43;\nenum IPPROTO_FRAGMENT = 44;\nenum IPPROTO_IDRP = 45;\nenum IPPROTO_RSVP = 46;\nenum IPPROTO_GRE = 47;\nenum IPPROTO_MHRP = 48;\nenum IPPROTO_BHA = 49;\nenum IPPROTO_ESP = 50;\nenum IPPROTO_AH = 51;\nenum IPPROTO_INLSP = 52;\nenum IPPROTO_SWIPE = 53;\nenum IPPROTO_NHRP = 54;\nenum IPPROTO_MOBILE = 55;\nenum IPPROTO_TLSP = 56;\nenum IPPROTO_SKIP = 57;\nenum IPPROTO_ICMPV6 = 58;\nenum IPPROTO_NONE = 59;\nenum IPPROTO_DSTOPTS = 60;\nenum IPPROTO_AHIP = 61;\nenum IPPROTO_CFTP = 62;\nenum IPPROTO_HELLO = 63;\nenum IPPROTO_SATEXPAK = 64;\nenum IPPROTO_KRYPTOLAN = 65;\nenum IPPROTO_RVD = 66;\nenum IPPROTO_IPPC = 67;\nenum IPPROTO_ADFS = 68;\nenum IPPROTO_SATMON = 69;\nenum IPPROTO_VISA = 70;\nenum IPPROTO_IPCV = 71;\nenum IPPROTO_CPNX = 72;\nenum IPPROTO_CPHB = 73;\nenum IPPROTO_WSN = 74;\nenum IPPROTO_PVP = 75;\nenum IPPROTO_BRSATMON = 76;\n\nenum IPPROTO_WBMON = 78;\nenum IPPROTO_WBEXPAK = 79;\nenum IPPROTO_EON = 80;\nenum IPPROTO_VMTP = 81;\nenum IPPROTO_SVMTP = 82;\nenum IPPROTO_VINES = 83;\nenum IPPROTO_TTP = 84;\nenum IPPROTO_IGP = 85;\nenum IPPROTO_DGP = 86;\nenum IPPROTO_TCF = 87;\nenum IPPROTO_IGRP = 88;\nenum IPPROTO_OSPFIGP = 89;\nenum IPPROTO_SRPC = 90;\nenum IPPROTO_LARP = 91;\nenum IPPROTO_MTP = 92;\nenum IPPROTO_AX25 = 93;\nenum IPPROTO_IPEIP = 94;\nenum IPPROTO_MICP = 95;\nenum IPPROTO_SCCSP = 96;\nenum IPPROTO_ETHERIP = 97;\nenum IPPROTO_ENCAP = 98;\nenum IPPROTO_APES = 99;\nenum IPPROTO_GMTP = 100;\nenum IPPROTO_IPCOMP = 108;\nenum IPPROTO_SCTP = 132;\nenum IPPROTO_MH = 135;\nenum IPPROTO_UDPLITE = 136;\nenum IPPROTO_HIP = 139;\nenum IPPROTO_SHIM6 = 140;\n\nenum IPPROTO_PIM = 103;\nenum IPPROTO_CARP = 112;\nenum IPPROTO_PGM = 113;\nenum IPPROTO_MPLS = 137;\nenum IPPROTO_PFSYNC = 240;\nenum IPPROTO_RESERVED_253 = 253;\nenum IPPROTO_RESERVED_254 = 254;\n\nenum IPPROTO_DONE = 257;\n\nenum IPPORT_RESERVED = 1024;\n\nenum IPPORT_EPHEMERALFIRST = 10000;\nenum IPPORT_EPHEMERALLAST = 65535;\n\nenum IPPORT_HIFIRSTAUTO = 49152;\nenum IPPORT_HILASTAUTO = 65535;\n\nenum IPPORT_RESERVEDSTART = 600;\n\nenum IPPORT_MAX = 65535;\n\nextern(D) bool IN_CLASSA(in_addr_t i) pure @safe { return (i & 0x80000000) == 0; }\nenum IN_CLASSA_NET = 0xff000000;\nenum IN_CLASSA_NSHIFT = 24;\nenum IN_CLASSA_HOST = 0x00ffffff;\nenum IN_CLASSA_MAX = 128;\n\nextern(D) bool IN_CLASSB(in_addr_t i) pure @safe { return (i & 0xc0000000) == 0x80000000; }\nenum IN_CLASSB_NET = 0xffff0000;\nenum IN_CLASSB_NSHIFT = 16;\nenum IN_CLASSB_HOST = 0x0000ffff;\nenum IN_CLASSB_MAX = 65536;\n\nextern(D) bool IN_CLASSC(in_addr_t i) pure @safe { return (i & 0xe0000000) == 0xc0000000; }\nenum IN_CLASSC_NET = 0xffffff00;\nenum IN_CLASSC_NSHIFT = 8;\nenum IN_CLASSC_HOST = 0x000000ff;\n\nextern(D) bool IN_CLASSD(in_addr_t i) pure @safe { return (i & 0xf0000000) == 0xe0000000; }\nenum IN_CLASSD_NET = 0xf0000000;\nenum IN_CLASSD_NSHIFT = 28;\nenum IN_CLASSD_HOST = 0x0fffffff;\nextern(D) bool IN_MULTICAST(in_addr_t i) { return IN_CLASSD(i); }\n\n// The fact that these are identical looks suspicious (they're not quite\n// identical on Linux). However, this _is_ how they're defined in DragonFlyBSD\n// and on OS X. So, while it _might_ be a bug, if it is, it's an upstream\n// one, and we're compatible with it.\nextern(D) bool IN_EXPERIMENTAL(in_addr_t i) pure @safe { return (i & 0xf0000000) == 0xf0000000; }\nextern(D) bool IN_BADCLASS(in_addr_t i) pure @safe { return (i & 0xf0000000) == 0xf0000000; }\n\nextern(D) bool IN_LINKLOCAL(in_addr_t i) pure @safe { return (i & 0xffff0000) == 0xa9fe0000; }\nextern(D) bool IN_LOOPBACK(in_addr_t i) pure @safe { return (i & 0xff000000) == 0x7f000000; }\nextern(D) bool IN_ZERONET(in_addr_t i) pure @safe { return (i & 0xff000000) == 0; }\n\nextern(D) bool IN_PRIVATE(in_addr_t i) pure @safe\n{\n return (i & 0xff000000) == 0x0a000000 ||\n (i & 0xfff00000) == 0xac100000 ||\n (i & 0xffff0000) == 0xc0a80000;\n}\n\nextern(D) bool IN_LOCAL_GROUP(in_addr_t i) pure @safe { return (i & 0xffffff00) == 0xe0000000; }\n\nextern(D) bool IN_ANY_LOCAL(in_addr_t i) pure @safe { return IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i); }\n\nenum INADDR_UNSPEC_GROUP = 0xe0000000;\nenum INADDR_ALLHOSTS_GROUP = 0xe0000001;\nenum INADDR_ALLRTRS_GROUP = 0xe0000002;\nenum INADDR_ALLRPTS_GROUP = 0xe0000016;\nenum INADDR_CARP_GROUP = 0xe0000012;\nenum INADDR_PFSYNC_GROUP = 0xe00000f0;\nenum INADDR_ALLMDNS_GROUP = 0xe00000fb;\nenum INADDR_MAX_LOCAL_GROUP = 0xe00000ff;\n\nenum IN_LOOPBACKNET = 127;\n\nenum IN_RFC3021_MASK = 0xfffffffe;\n\nenum IP_OPTIONS = 1;\nenum IP_HDRINCL = 2;\nenum IP_TOS = 3;\nenum IP_TTL = 4;\nenum IP_RECVOPTS = 5;\nenum IP_RECVRETOPTS = 6;\nenum IP_RECVDSTADDR = 7;\nenum IP_SENDSRCADDR = IP_RECVDSTADDR;\nenum IP_RETOPTS = 8;\nenum IP_MULTICAST_IF = 9;\n\nenum IP_MULTICAST_TTL = 10;\nenum IP_MULTICAST_LOOP = 11;\nenum IP_ADD_MEMBERSHIP = 12;\nenum IP_DROP_MEMBERSHIP = 13;\nenum IP_MULTICAST_VIF = 14;\nenum IP_RSVP_ON = 15;\nenum IP_RSVP_OFF = 16;\nenum IP_RSVP_VIF_ON = 17;\nenum IP_RSVP_VIF_OFF = 18;\nenum IP_PORTRANGE = 19;\nenum IP_RECVIF = 20;\n\nenum IP_IPSEC_POLICY = 21;\n\nenum IP_ONESBCAST = 23;\nenum IP_BINDANY = 24;\nenum IP_BINDMULTI = 25;\nenum IP_RSS_LISTEN_BUCKET = 26;\nenum IP_ORIGDSTADDR = 27;\nenum IP_RECVORIGDSTADDR = IP_ORIGDSTADDR;\n\nenum IP_FW3 = 48;\nenum IP_DUMMYNET3 = 49;\n\nenum IP_ADD_SOURCE_MEMBERSHIP = 70;\nenum IP_DROP_SOURCE_MEMBERSHIP = 71;\nenum IP_BLOCK_SOURCE = 72;\nenum IP_UNBLOCK_SOURCE = 73;\n\nenum MCAST_JOIN_GROUP = 80;\nenum MCAST_LEAVE_GROUP = 81;\nenum MCAST_JOIN_SOURCE_GROUP = 82;\nenum MCAST_LEAVE_SOURCE_GROUP = 83;\nenum MCAST_BLOCK_SOURCE = 84;\nenum MCAST_UNBLOCK_SOURCE = 85;\n\nenum IP_FLOWID = 90;\nenum IP_FLOWTYPE = 91;\nenum IP_RSSBUCKETID = 92;\nenum IP_RECVFLOWID = 93;\nenum IP_RECVRSSBUCKETID = 94;\n\nenum IP_DEFAULT_MULTICAST_TTL = 1;\nenum IP_DEFAULT_MULTICAST_LOOP = 1;\n\nenum IP_MIN_MEMBERSHIPS = 31;\nenum IP_MAX_MEMBERSHIPS = 4095;\n\nenum IP_MAX_GROUP_SRC_FILTER = 512;\nenum IP_MAX_SOCK_SRC_FILTER = 128;\n\nstruct ip_mreq\n{\n in_addr imr_multiaddr;\n in_addr imr_interface;\n};\n\nstruct ip_mreqn\n{\n in_addr imr_multiaddr;\n in_addr imr_address;\n int imr_ifindex;\n};\n\nstruct ip_mreq_source\n{\n in_addr imr_multiaddr;\n in_addr imr_sourceaddr;\n in_addr imr_interface;\n};\n\nstruct group_req\n{\n uint gr_interface;\n sockaddr_storage gr_group;\n};\n\nstruct group_source_req\n{\n uint gsr_interface;\n sockaddr_storage gsr_group;\n sockaddr_storage gsr_source;\n};\n\nint setipv4sourcefilter(int, in_addr, in_addr, uint, uint, in_addr*);\nint getipv4sourcefilter(int, in_addr, in_addr, uint*, uint*, in_addr*);\nint setsourcefilter(int, uint, sockaddr*, socklen_t, uint, uint, sockaddr_storage*);\nint getsourcefilter(int, uint, sockaddr*, socklen_t, uint*, uint*, sockaddr_storage*);\n\nenum MCAST_UNDEFINED = 0;\nenum MCAST_INCLUDE = 1;\nenum MCAST_EXCLUDE = 2;\n\nenum IP_PORTRANGE_DEFAULT = 0;\nenum IP_PORTRANGE_HIGH = 1;\nenum IP_PORTRANGE_LOW = 2;\n\nenum IPCTL_FORWARDING = 1;\nenum IPCTL_SENDREDIRECTS = 2;\nenum IPCTL_DEFTTL = 3;\nenum IPCTL_DEFMTU = 4;\nenum IPCTL_SOURCEROUTE = 8;\nenum IPCTL_DIRECTEDBROADCAST = 9;\nenum IPCTL_INTRQMAXLEN = 10;\nenum IPCTL_INTRQDROPS = 11;\nenum IPCTL_STATS = 12;\nenum IPCTL_ACCEPTSOURCEROUTE = 13;\nenum IPCTL_FASTFORWARDING = 14;\nenum IPCTL_GIF_TTL = 16;\nenum IPCTL_INTRDQMAXLEN = 17;\nenum IPCTL_INTRDQDROPS = 18;\n\n// =============================================================================\n// What follows is from netinet6/in6.h, but since netinet6/in6.h specifically\n// says that it should only be #included by #including netinet/in.h, it makes\n// more sense to put them in here so that the way they're imported corresponds\n// with the correct way of #including them in C/C++.\n// =============================================================================\n\n// The #if was around the #include of in6.h at the end of in.h.\nenum IPV6PORT_RESERVED = 1024;\nenum IPV6PORT_ANONMIN = 49152;\nenum IPV6PORT_ANONMAX = 65535;\nenum IPV6PORT_RESERVEDMIN = 600;\nenum IPV6PORT_RESERVEDMAX = IPV6PORT_RESERVED - 1;\n\nenum IN6ADDR_ANY_INIT = in6_addr.init;\nenum IN6ADDR_LOOPBACK_INIT = in6_addr([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);\nenum IN6ADDR_NODELOCAL_ALLNODES_INIT = in6_addr([0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);\nenum IN6ADDR_INTFACELOCAL_ALLNODES_INIT = in6_addr([0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);\nenum IN6ADDR_LINKLOCAL_ALLNODES_INIT = in6_addr([0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);\nenum IN6ADDR_LINKLOCAL_ALLROUTERS_INIT = in6_addr([0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02]);\nenum IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT = in6_addr([0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16]);\n\n__gshared const in6_addr in6addr_nodelocal_allnodes;\n__gshared const in6_addr in6addr_linklocal_allnodes;\n__gshared const in6_addr in6addr_linklocal_allrouters;\n__gshared const in6_addr in6addr_linklocal_allv2routers;\n\nextern(D) bool IN6_ARE_ADDR_EQUAL(in6_addr* a, in6_addr* b) pure @safe { return *a == *b; }\n\nenum __IPV6_ADDR_SCOPE_NODELOCAL = 0x01;\nenum __IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01;\nenum __IPV6_ADDR_SCOPE_LINKLOCAL = 0x02;\nenum __IPV6_ADDR_SCOPE_SITELOCAL = 0x05;\nenum __IPV6_ADDR_SCOPE_GLOBAL = 0x0e;\n\n// TODO - requires declarations from elsewhere that we don't currently have bindings for.\n/+\n struct route_in6\n {\n rtentry* ro_rt;\n llentry* ro_lle;\n char* ro_prepend;\n ushort ro_plen;\n ushort ro_flags;\n ushort ro_mtu;\n ushort spare;\n sockaddr_in6 ro_dst;\n };\n+/\n\nenum IPV6_SOCKOPT_RESERVED1 = 3;\nenum IPV6_PORTRANGE = 14;\nenum ICMP6_FILTER = 18;\n\nenum IPV6_CHECKSUM = 26;\n\nenum IPV6_IPSEC_POLICY = 28;\n\nenum IPV6_FW_ADD = 30;\nenum IPV6_FW_DEL = 31;\nenum IPV6_FW_FLUSH = 32;\nenum IPV6_FW_ZERO = 33;\nenum IPV6_FW_GET = 34;\n\nenum IPV6_RTHDRDSTOPTS = 35;\n\nenum IPV6_RECVPKTINFO = 36;\nenum IPV6_RECVHOPLIMIT = 37;\nenum IPV6_RECVRTHDR = 38;\nenum IPV6_RECVHOPOPTS = 39;\nenum IPV6_RECVDSTOPTS = 40;\n\nenum IPV6_USE_MIN_MTU = 42;\nenum IPV6_RECVPATHMTU = 43;\n\nenum IPV6_PATHMTU = 44;\n\nenum IPV6_PKTINFO = 46;\nenum IPV6_HOPLIMIT = 47;\nenum IPV6_NEXTHOP = 48;\nenum IPV6_HOPOPTS = 49;\nenum IPV6_DSTOPTS = 50;\nenum IPV6_RTHDR = 51;\n\nenum IPV6_RECVTCLASS = 57;\n\nenum IPV6_AUTOFLOWLABEL = 59;\n\nenum IPV6_TCLASS = 61;\nenum IPV6_DONTFRAG = 62;\n\nenum IPV6_PREFER_TEMPADDR = 63;\n\nenum IPV6_BINDANY = 64;\n\nenum IPV6_BINDMULTI = 65;\nenum IPV6_RSS_LISTEN_BUCKET = 66;\nenum IPV6_FLOWID = 67;\nenum IPV6_FLOWTYPE = 68;\nenum IPV6_RSSBUCKETID = 69;\nenum IPV6_RECVFLOWID = 70;\nenum IPV6_RECVRSSBUCKETID = 71;\n\nenum IPV6_ORIGDSTADDR = 72;\nenum IPV6_RECVORIGDSTADDR = IPV6_ORIGDSTADDR;\n\nenum IPV6_RTHDR_LOOSE = 0;\nenum IPV6_RTHDR_STRICT = 1;\nenum IPV6_RTHDR_TYPE_0 = 0;\n\nenum IPV6_DEFAULT_MULTICAST_HOPS = 1;\nenum IPV6_DEFAULT_MULTICAST_LOOP = 1;\n\nenum IPV6_MIN_MEMBERSHIPS = 31;\nenum IPV6_MAX_MEMBERSHIPS = 4095;\n\nenum IPV6_MAX_GROUP_SRC_FILTER = 512;\nenum IPV6_MAX_SOCK_SRC_FILTER = 128;\n\nstruct in6_pktinfo\n{\n in6_addr ipi6_addr;\n uint ipi6_ifindex;\n};\n\nstruct ip6_mtuinfo\n{\n sockaddr_in6 ip6m_addr;\n uint ip6m_mtu;\n};\n\nenum IPV6_PORTRANGE_DEFAULT = 0;\nenum IPV6_PORTRANGE_HIGH = 1;\nenum IPV6_PORTRANGE_LOW = 2;\n\nenum IPV6PROTO_MAXID = IPPROTO_PIM + 1;\n\nenum IPV6CTL_FORWARDING = 1;\nenum IPV6CTL_SENDREDIRECTS = 2;\nenum IPV6CTL_DEFHLIM = 3;\nenum IPV6CTL_DEFMTU = 4;\nenum IPV6CTL_FORWSRCRT = 5;\nenum IPV6CTL_STATS = 6;\nenum IPV6CTL_MRTSTATS = 7;\nenum IPV6CTL_MRTPROTO = 8;\nenum IPV6CTL_MAXFRAGPACKETS = 9;\nenum IPV6CTL_SOURCECHECK = 10;\nenum IPV6CTL_SOURCECHECK_LOGINT = 11;\nenum IPV6CTL_ACCEPT_RTADV = 12;\n\nenum IPV6CTL_LOG_INTERVAL = 14;\nenum IPV6CTL_HDRNESTLIMIT = 15;\nenum IPV6CTL_DAD_COUNT = 16;\nenum IPV6CTL_AUTO_FLOWLABEL = 17;\nenum IPV6CTL_DEFMCASTHLIM = 18;\nenum IPV6CTL_GIF_HLIM = 19;\nenum IPV6CTL_KAME_VERSION = 20;\nenum IPV6CTL_USE_DEPRECATED = 21;\nenum IPV6CTL_RR_PRUNE = 22;\nenum IPV6CTL_V6ONLY = 24;\n\nenum IPV6CTL_USETEMPADDR = 32;\nenum IPV6CTL_TEMPPLTIME = 33;\nenum IPV6CTL_TEMPVLTIME = 34;\nenum IPV6CTL_AUTO_LINKLOCAL = 35;\nenum IPV6CTL_RIP6STATS = 36;\nenum IPV6CTL_PREFER_TEMPADDR = 37;\nenum IPV6CTL_ADDRCTLPOLICY = 38;\nenum IPV6CTL_USE_DEFAULTZONE = 39;\n\nenum IPV6CTL_MAXFRAGS = 41;\nenum IPV6CTL_MCAST_PMTU = 44;\n\nenum IPV6CTL_STEALTH = 45;\n\nenum ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47;\nenum IPV6CTL_NO_RADR = 48;\nenum IPV6CTL_NORBIT_RAIF = 49;\n\nenum IPV6CTL_RFC6204W3 = 50;\n\nenum IPV6CTL_INTRQMAXLEN = 51;\nenum IPV6CTL_INTRDQMAXLEN = 52;\n\nenum IPV6CTL_MAXID = 53;\n\n// TODO - require declarations from elsewhere that we don't currently have bindings for.\n/+\nenum M_FASTFWD_OURS = M_PROTO1;\nenum M_IP6_NEXTHOP = M_PROTO2;\nenum M_IP_NEXTHOP = M_PROTO2;\nenum M_SKIP_FIREWALL = M_PROTO3;\nenum M_AUTHIPHDR = M_PROTO4;\nenum M_DECRYPTED = M_PROTO5;\nenum M_LOOP = M_PROTO6;\nenum M_AUTHIPDGM = M_PROTO7;\nenum M_RTALERT_MLD = M_PROTO8;\n+/\n\nsize_t inet6_rthdr_space(int, int) @trusted;\ncmsghdr* inet6_rthdr_init(void*, int);\nint inet6_rthdr_add(cmsghdr*, const in6_addr*, uint);\nint inet6_rthdr_lasthop(cmsghdr*, uint);\nint inet6_rthdr_segments(const cmsghdr*);\nin6_addr* inet6_rthdr_getaddr(cmsghdr*, int);\nint inet6_rthdr_getflags(const cmsghdr*, int);\n\nint inet6_opt_init(void*, socklen_t);\nint inet6_opt_append(void*, socklen_t, int, ubyte, socklen_t, ubyte, void**);\nint inet6_opt_finish(void*, socklen_t, int);\nint inet6_opt_set_val(void*, int, void*, socklen_t);\n\nint inet6_opt_next(void*, socklen_t, int, ubyte*, socklen_t*, void**);\nint inet6_opt_find(void*, socklen_t, int, ubyte, socklen_t*, void**);\nint inet6_opt_get_val(void*, int, void*, socklen_t);\nsocklen_t inet6_rth_space(int, int) @trusted;\nvoid* inet6_rth_init(void*, socklen_t, int, int);\nint inet6_rth_add(void*, const in6_addr*);\nint inet6_rth_reverse(const void*, void*);\nint inet6_rth_segments(const void*);\nin6_addr* inet6_rth_getaddr(const void*, int);\n"} +{"text": "\n \n\n"} +{"text": "/*\n * Copyright (C) 2004, 2005 Nikolas Zimmermann \n * Copyright (C) 2004, 2005, 2006 Rob Buis \n * Copyright (C) 2009 Google, Inc.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Library General Public\n * License as published by the Free Software Foundation; either\n * version 2 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Library General Public License for more details.\n *\n * You should have received a copy of the GNU Library General Public License\n * along with this library; see the file COPYING.LIB. If not, write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA 02110-1301, USA.\n */\n\n#include \"config.h\"\n#include \"RenderSVGTransformableContainer.h\"\n\n#include \"SVGGElement.h\"\n#include \"SVGNames.h\"\n#include \"SVGUseElement.h\"\n\nnamespace WebCore {\n \nRenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGGraphicsElement& element, RenderStyle&& style)\n : RenderSVGContainer(element, WTFMove(style))\n , m_needsTransformUpdate(true)\n , m_didTransformToRootUpdate(false)\n{\n}\n\nbool RenderSVGTransformableContainer::calculateLocalTransform()\n{\n SVGGraphicsElement& element = graphicsElement();\n\n // If we're either the renderer for a element, or for any element inside the shadow\n // tree, that was created during the use/symbol/svg expansion in SVGUseElement. These containers\n // need to respect the translations induced by their corresponding use elements x/y attributes.\n SVGUseElement* useElement = nullptr;\n if (is(element))\n useElement = &downcast(element);\n else if (element.isInShadowTree() && is(element)) {\n SVGElement* correspondingElement = element.correspondingElement();\n if (is(correspondingElement))\n useElement = downcast(correspondingElement);\n }\n\n if (useElement) {\n SVGLengthContext lengthContext(useElement);\n FloatSize translation(useElement->x().value(lengthContext), useElement->y().value(lengthContext));\n if (translation != m_lastTranslation)\n m_needsTransformUpdate = true;\n m_lastTranslation = translation;\n }\n\n m_didTransformToRootUpdate = m_needsTransformUpdate || SVGRenderSupport::transformToRootChanged(parent());\n if (!m_needsTransformUpdate)\n return false;\n\n m_localTransform = element.animatedLocalTransform();\n m_localTransform.translate(m_lastTranslation.width(), m_lastTranslation.height());\n m_needsTransformUpdate = false;\n return true;\n}\n\n}\n"} +{"text": "package com.netflix.discovery.converters;\n\nimport javax.ws.rs.core.MediaType;\nimport java.io.BufferedInputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\n\nimport com.netflix.appinfo.InstanceInfo;\nimport com.netflix.discovery.converters.jackson.AbstractEurekaJacksonCodec;\nimport com.netflix.discovery.converters.jackson.EurekaJsonJacksonCodec;\nimport com.netflix.discovery.converters.jackson.EurekaXmlJacksonCodec;\nimport com.netflix.discovery.shared.Application;\nimport com.netflix.discovery.shared.Applications;\nimport com.netflix.discovery.util.InstanceInfoGenerator;\n\n/**\n * @author Tomasz Bak\n */\npublic class CodecLoadTester {\n\n private final List instanceInfoList = new ArrayList();\n private final List applicationList = new ArrayList();\n private final Applications applications;\n\n private final EntityBodyConverter xstreamCodec = new EntityBodyConverter();\n private final EurekaJacksonCodec legacyJacksonCodec = new EurekaJacksonCodec();\n\n private final EurekaJsonJacksonCodec jsonCodecNG = new EurekaJsonJacksonCodec();\n private final EurekaJsonJacksonCodec jsonCodecNgCompact = new EurekaJsonJacksonCodec(KeyFormatter.defaultKeyFormatter(), true);\n\n private final EurekaXmlJacksonCodec xmlCodecNG = new EurekaXmlJacksonCodec();\n private final EurekaXmlJacksonCodec xmlCodecNgCompact = new EurekaXmlJacksonCodec(KeyFormatter.defaultKeyFormatter(), true);\n\n static class FirstHolder {\n Applications value;\n }\n\n static class SecondHolder {\n Applications value;\n }\n\n private FirstHolder firstHolder = new FirstHolder();\n private SecondHolder secondHolder = new SecondHolder();\n\n public CodecLoadTester(int instanceCount, int appCount) {\n Iterator instanceIt = InstanceInfoGenerator.newBuilder(instanceCount, appCount)\n .withMetaData(true).build().serviceIterator();\n applications = new Applications();\n int appIdx = 0;\n while (instanceIt.hasNext()) {\n InstanceInfo next = instanceIt.next();\n\n instanceInfoList.add(next);\n\n if (applicationList.size() <= appIdx) {\n applicationList.add(new Application(next.getAppName()));\n }\n applicationList.get(appIdx).addInstance(next);\n appIdx = (appIdx + 1) % appCount;\n }\n\n for (Application app : applicationList) {\n applications.addApplication(app);\n }\n applications.setAppsHashCode(applications.getReconcileHashCode());\n firstHolder.value = applications;\n }\n\n public CodecLoadTester(String[] args) throws Exception {\n if (args.length != 1) {\n System.err.println(\"ERROR: too many command line arguments; file name expected only\");\n throw new IllegalArgumentException();\n }\n String fileName = args[0];\n Applications applications;\n try {\n System.out.println(\"Attempting to load \" + fileName + \" in XML format...\");\n applications = loadWithCodec(fileName, MediaType.APPLICATION_XML_TYPE);\n } catch (Exception e) {\n System.out.println(\"Attempting to load \" + fileName + \" in JSON format...\");\n applications = loadWithCodec(fileName, MediaType.APPLICATION_JSON_TYPE);\n }\n this.applications = applications;\n\n long totalInstances = 0;\n for (Application a : applications.getRegisteredApplications()) {\n totalInstances += a.getInstances().size();\n }\n System.out.printf(\"Loaded %d applications with %d instances\\n\", applications.getRegisteredApplications().size(), totalInstances);\n firstHolder.value = applications;\n }\n\n private Applications loadWithCodec(String fileName, MediaType mediaType) throws IOException {\n FileInputStream fis = new FileInputStream(fileName);\n BufferedInputStream bis = new BufferedInputStream(fis);\n return (Applications) xstreamCodec.read(bis, Applications.class, mediaType);\n }\n\n public void runApplicationsLoadTest(int loops, Func0 action) {\n long size = 0;\n for (int i = 0; i < loops; i++) {\n size += action.call(applications);\n }\n System.out.println(\"Average applications object size=\" + formatSize(size / loops));\n }\n\n public void runApplicationLoadTest(int loops, Func0 action) {\n for (int i = 0; i < loops; i++) {\n action.call(applicationList.get(i % applicationList.size()));\n }\n }\n\n public void runInstanceInfoLoadTest(int loops, Func0 action) {\n for (int i = 0; i < loops; i++) {\n action.call(instanceInfoList.get(i % instanceInfoList.size()));\n }\n }\n\n public void runInstanceInfoIntervalTest(int batch, int intervalMs, long durationSec, Func0 action) {\n long startTime = System.currentTimeMillis();\n long endTime = startTime + durationSec * 1000;\n long now;\n do {\n now = System.currentTimeMillis();\n runInstanceInfoLoadTest(batch, action);\n long waiting = intervalMs - (System.currentTimeMillis() - now);\n System.out.println(\"Waiting \" + waiting + \"ms\");\n if (waiting > 0) {\n try {\n Thread.sleep(waiting);\n } catch (InterruptedException e) {\n // IGNORE\n }\n }\n } while (now < endTime);\n }\n\n public void runApplicationIntervalTest(int batch, int intervalMs, long durationSec, Func0 action) {\n long startTime = System.currentTimeMillis();\n long endTime = startTime + durationSec * 1000;\n long now;\n do {\n now = System.currentTimeMillis();\n runApplicationLoadTest(batch, action);\n long waiting = intervalMs - (System.currentTimeMillis() - now);\n System.out.println(\"Waiting \" + waiting + \"ms\");\n if (waiting > 0) {\n try {\n Thread.sleep(waiting);\n } catch (InterruptedException e) {\n // IGNORE\n }\n }\n } while (now < endTime);\n }\n\n private static String formatSize(long size) {\n if (size < 1000) {\n return String.format(\"%d [bytes]\", size);\n }\n if (size < 1024 * 1024) {\n return String.format(\"%.2f [KB]\", size / 1024f);\n }\n return String.format(\"%.2f [MB]\", size / (1024f * 1024f));\n }\n\n interface Func0 {\n int call(T data);\n }\n\n Func0 legacyJacksonAction = new Func0() {\n @Override\n public int call(Object object) {\n ByteArrayOutputStream captureStream = new ByteArrayOutputStream();\n try {\n legacyJacksonCodec.writeTo(object, captureStream);\n byte[] bytes = captureStream.toByteArray();\n InputStream source = new ByteArrayInputStream(bytes);\n legacyJacksonCodec.readValue(object.getClass(), source);\n\n return bytes.length;\n } catch (IOException e) {\n throw new RuntimeException(\"unexpected\", e);\n }\n }\n };\n\n Func0 xstreamJsonAction = new Func0() {\n @Override\n public int call(Object object) {\n ByteArrayOutputStream captureStream = new ByteArrayOutputStream();\n try {\n xstreamCodec.write(object, captureStream, MediaType.APPLICATION_JSON_TYPE);\n byte[] bytes = captureStream.toByteArray();\n InputStream source = new ByteArrayInputStream(bytes);\n xstreamCodec.read(source, InstanceInfo.class, MediaType.APPLICATION_JSON_TYPE);\n\n return bytes.length;\n } catch (IOException e) {\n throw new RuntimeException(\"unexpected\", e);\n }\n }\n };\n\n Func0 xstreamXmlAction = new Func0() {\n @Override\n public int call(Object object) {\n ByteArrayOutputStream captureStream = new ByteArrayOutputStream();\n try {\n xstreamCodec.write(object, captureStream, MediaType.APPLICATION_XML_TYPE);\n byte[] bytes = captureStream.toByteArray();\n InputStream source = new ByteArrayInputStream(bytes);\n xstreamCodec.read(source, InstanceInfo.class, MediaType.APPLICATION_XML_TYPE);\n\n return bytes.length;\n } catch (IOException e) {\n throw new RuntimeException(\"unexpected\", e);\n }\n }\n };\n\n Func0 createJacksonNgAction(final MediaType mediaType, final boolean compact) {\n return new Func0() {\n @Override\n public int call(Object object) {\n AbstractEurekaJacksonCodec codec;\n if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE)) {\n codec = compact ? jsonCodecNgCompact : jsonCodecNG;\n } else {\n codec = compact ? xmlCodecNgCompact : xmlCodecNG;\n }\n ByteArrayOutputStream captureStream = new ByteArrayOutputStream();\n try {\n codec.writeTo(object, captureStream);\n byte[] bytes = captureStream.toByteArray();\n InputStream source = new ByteArrayInputStream(bytes);\n Applications readValue = codec.getObjectMapper(object.getClass()).readValue(source, Applications.class);\n secondHolder.value = readValue;\n\n return bytes.length;\n } catch (IOException e) {\n throw new RuntimeException(\"unexpected\", e);\n }\n }\n };\n }\n\n public void runFullSpeed() {\n int loop = 5;\n System.gc();\n long start = System.currentTimeMillis();\n\n// runInstanceInfoLoadTest(loop, legacyJacksonAction);\n// runInstanceInfoLoadTest(loop, xstreamAction);\n\n// runApplicationLoadTest(loop, legacyJacksonAction);\n// runApplicationLoadTest(loop, xstreamAction);\n\n // ----------------------------------------------------------------\n // Applications\n// runApplicationsLoadTest(loop, xstreamJsonAction);\n// runApplicationsLoadTest(loop, xstreamXmlAction);\n\n// runApplicationsLoadTest(loop, legacyJacksonAction);\n\n runApplicationsLoadTest(loop, createJacksonNgAction(MediaType.APPLICATION_JSON_TYPE, false));\n\n long executionTime = System.currentTimeMillis() - start;\n System.out.printf(\"Execution time: %d[ms]\\n\", executionTime);\n }\n\n public void runIntervals() {\n int batch = 1500;\n int intervalMs = 1000;\n long durationSec = 600;\n\n// runInstanceInfoIntervalTest(batch, intervalMs, durationSec, legacyJacksonAction);\n runInstanceInfoIntervalTest(batch, intervalMs, durationSec, xstreamJsonAction);\n\n// runApplicationIntervalTest(batch, intervalMs, durationSec, legacyJacksonAction);\n// runApplicationIntervalTest(batch, intervalMs, durationSec, xstreamAction);\n }\n\n\n public static void main(String[] args) throws Exception {\n CodecLoadTester loadTester;\n if (args.length == 0) {\n loadTester = new CodecLoadTester(2000, 40);\n } else {\n loadTester = new CodecLoadTester(args);\n }\n loadTester.runFullSpeed();\n Thread.sleep(100000);\n }\n}\n"} +{"text": "//\n// main.m\n// Bananas\n//\n\n#import \n\nint main(int argc, const char *argv[])\n{\n return NSApplicationMain(argc, argv);\n}\n"} +{"text": "\n### 100 Top Programming Languages Questions\n\n\n\n\n#### 1- What is Functional Language?\nIt is a approach that treats every computation as a mathematical function. The output of the function relies on what input was given for the function, and do not depend on series of steps that precede the function.\n\nFunctional programming relies heavily on __recursion__. The difference between recursion in functional programming and iteration in procedural programming is recursion repeat functions and not a series of steps\n\nExamples : __Erlang, Haskell, Lisp, Scala__\n\n\n#### 2- What is Declarative Language?\nDeclarative programming is when you write your code in such a way that it describes what you want to do, and not how you want to do it. It is left up to the compiler to figure out the how. Examples of declarative programming languages are __SQL,Prolog, and HTML__\n\n\n\n#### 3- What is Rule-based Languages? ? \n\n\n\n#### 4)What is the difference between compilers and interpreters?\n\n__Interpreter__: \n- reads the code statements line by line\n- Faster to analyze source code \n- Slower in execution\n- Debugging is easier with interpreted languages, as they go line by line and they stop once they hit an error.\n\nExs: __Python,Ruby, PHP, JavaScript__\n\n__Compiler__:\n- reads the whole source code at once. The entire program is being translated into machine code.\n- Faster in execution\n- Slower in analyzing source code\n- Debugging is a lot harder than interpreted languages as the whole source code has to load in order to find the bug (which is time consuming )\nExs: __C, C++,Java__\n\n\n#### 5) What is a binary file ?\n\n\n\n#### 6) What is procedural Language?\nIt is a language that tells the computer what to do step by step. It relies on procedures known as routines.\n\n__A procedure__ consists of multiple series of computation. Procedural programming is also referred to as __imperative language__ or structured\n\nA procedural programming is very intuitive, as it runs as the programmer expect.Example of procedural languages __Fortan, C__\n\nA common technique in procedural programming is to use iteration, means that you write a set of steps, and you tell the computer to repeat for certain number of times\n\n\n#### 7- What is Metaprogramming ?\n __Meta programming__ allows programs to create method fast \n instead of having to Identify them in the program itself.\n Metaprogramming reduced repetitive code\n \n \n #### 8) What is Object-oriented Language?\n \n #### 9) What is data structure language?\n \n #### 10 ) What is data flow?\n \n\n\n\n"} +{"text": "\n\n\t\n\t\t1296\n\t\t11D50b\n\t\t2182\n\t\t1138.32\n\t\t568.00\n\t\t\n\t\t\tcom.apple.InterfaceBuilder.IBCocoaTouchPlugin\n\t\t\t1181\n\t\t\n\t\t\n\t\t\tIBProxyObject\n\t\t\tIBUIView\n\t\t\tIBUIWebView\n\t\t\n\t\t\n\t\t\tcom.apple.InterfaceBuilder.IBCocoaTouchPlugin\n\t\t\n\t\t\n\t\t\tPluginDependencyRecalculationVersion\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\tIBFilesOwner\n\t\t\t\tIBCocoaTouchFramework\n\t\t\t\n\t\t\t\n\t\t\t\tIBFirstResponder\n\t\t\t\tIBCocoaTouchFramework\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t274\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t274\n\t\t\t\t\t\t{320, 460}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t_NS:9\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tMSAxIDEAA\n\t\t\t\t\t\t\n\t\t\t\t\t\tIBCocoaTouchFramework\n\t\t\t\t\t\t1\n\t\t\t\t\t\tYES\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{0, 20}, {320, 460}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t3\n\t\t\t\t\tMQA\n\t\t\t\t\t\n\t\t\t\t\t\t2\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIBCocoaTouchFramework\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tview\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t3\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tmywebview\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t6\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t1\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t-1\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tFile's Owner\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t-2\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t4\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tMyWebViewController\n\t\t\t\tcom.apple.InterfaceBuilder.IBCocoaTouchPlugin\n\t\t\t\tUIResponder\n\t\t\t\tcom.apple.InterfaceBuilder.IBCocoaTouchPlugin\n\t\t\t\tcom.apple.InterfaceBuilder.IBCocoaTouchPlugin\n\t\t\t\tcom.apple.InterfaceBuilder.IBCocoaTouchPlugin\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t6\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tMyWebViewController\n\t\t\t\t\tUIViewController\n\t\t\t\t\t\n\t\t\t\t\t\tmywebview\n\t\t\t\t\t\tUIWebView\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tmywebview\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tmywebview\n\t\t\t\t\t\t\tUIWebView\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tIBProjectSource\n\t\t\t\t\t\t./Classes/MyWebViewController.h\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t0\n\t\tIBCocoaTouchFramework\n\t\t\n\t\t\tcom.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS\n\t\t\t\n\t\t\n\t\tYES\n\t\t3\n\t\t1181\n\t\n\n"} +{"text": "package com.tribbloids.spookystuff.utils.http;\n\nimport org.apache.http.ProtocolException;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.impl.client.LaxRedirectStrategy;\nimport org.apache.http.util.TextUtils;\n\nimport java.net.*;\nimport java.util.Locale;\n\n/**\n * Created by peng on 2/4/15.\n */\npublic class ResilientRedirectStrategy extends LaxRedirectStrategy {\n\n// @Override\n protected URI createLocationURI(final String location) throws ProtocolException {\n // One can try to rewrite malformed redirect locations\n\n try {\n URI uri = HttpUtils.uri(location);\n final URIBuilder b = new URIBuilder(uri);\n final String host = b.getHost();\n if (host != null) {\n b.setHost(host.toLowerCase(Locale.ENGLISH));\n }\n final String path = b.getPath();\n if (TextUtils.isEmpty(path)) {\n b.setPath(\"/\");\n }\n return b.build();\n } catch (final URISyntaxException ex) {\n throw new ProtocolException(\"Invalid redirect URI: \" + location, ex);\n }\n\n //at this point\n// try {\n// return HttpUtils.uri(location);\n// } catch (MalformedURLException | URISyntaxException e) {\n// throw new ProtocolException(\"malformed location\", e);\n// }\n }\n}"} +{"text": "using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Abp.Dependency;\n\nnamespace LTMCompanyNameFree.YoyoCmsTemplate.Authentication.External\n{\n public class ExternalAuthManager : IExternalAuthManager, ITransientDependency\n {\n private readonly IIocResolver _iocResolver;\n private readonly IExternalAuthConfiguration _externalAuthConfiguration;\n\n public ExternalAuthManager(IIocResolver iocResolver, IExternalAuthConfiguration externalAuthConfiguration)\n {\n _iocResolver = iocResolver;\n _externalAuthConfiguration = externalAuthConfiguration;\n }\n\n public Task IsValidUser(string provider, string providerKey, string providerAccessCode)\n {\n using (var providerApi = CreateProviderApi(provider))\n {\n return providerApi.Object.IsValidUser(providerKey, providerAccessCode);\n }\n }\n\n public Task GetUserInfo(string provider, string accessCode)\n {\n using (var providerApi = CreateProviderApi(provider))\n {\n return providerApi.Object.GetUserInfo(accessCode);\n }\n }\n\n public IDisposableDependencyObjectWrapper CreateProviderApi(string provider)\n {\n var providerInfo = _externalAuthConfiguration.Providers.FirstOrDefault(p => p.Name == provider);\n if (providerInfo == null)\n {\n throw new Exception(\"Unknown external auth provider: \" + provider);\n }\n\n var providerApi = _iocResolver.ResolveAsDisposable(providerInfo.ProviderApiType);\n providerApi.Object.Initialize(providerInfo);\n return providerApi;\n }\n }\n}\n"} +{"text": "#ifndef __LENCODER_H\n#define __LENCODER_H\n\n#include \"BitTreeCoder.h\"\n\nnamespace NLength {\n\nconst int kNumPosStatesBitsMax = 4;\nconst int kNumPosStatesMax = (1 << kNumPosStatesBitsMax);\n\n\nconst int kNumPosStatesBitsEncodingMax = 4;\nconst int kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);\n\n\nconst int kNumMoveBits = 5;\n\nconst int kNumLenBits = 3;\nconst int kNumLowSymbols = 1 << kNumLenBits;\nconst int kNumMidBits = 3;\nconst int kNumMidSymbols = 1 << kNumMidBits;\n\nconst int kNumHighBits = 8;\n\nconst int kNumSymbolsTotal = kNumLowSymbols + kNumMidSymbols + (1 << kNumHighBits);\n\nclass CEncoder\n{\n CMyBitEncoder m_Choice;\n CBitTreeEncoder m_LowCoder[kNumPosStatesEncodingMax];\n CMyBitEncoder m_Choice2;\n CBitTreeEncoder m_MidCoder[kNumPosStatesEncodingMax];\n CBitTreeEncoder m_HighCoder;\nprotected:\n UINT32 m_NumPosStates;\npublic:\n void Create(UINT32 aNumPosStates)\n { m_NumPosStates = aNumPosStates; }\n void Init();\n void Encode(CMyRangeEncoder *aRangeEncoder, UINT32 aSymbol, UINT32 aPosState);\n\n UINT32 GetPrice(UINT32 aSymbol, UINT32 aPosState) const;\n};\n\nconst int kNumSpecSymbols = kNumLowSymbols + kNumMidSymbols;\n\nclass CPriceTableEncoder: public CEncoder\n{\n UINT32 m_Prices[kNumSymbolsTotal][kNumPosStatesEncodingMax];\n UINT32 m_TableSize;\n UINT32 m_Counters[kNumPosStatesEncodingMax];\npublic:\n void SetTableSize(UINT32 aTableSize)\n { m_TableSize = aTableSize; }\n UINT32 GetPrice(UINT32 aSymbol, UINT32 aPosState) const\n { return m_Prices[aSymbol][aPosState]; }\n void UpdateTable(UINT32 aPosState)\n {\n for (UINT32 aLen = 0; aLen < m_TableSize; aLen++)\n m_Prices[aLen][aPosState] = CEncoder::GetPrice(aLen , aPosState);\n m_Counters[aPosState] = m_TableSize;\n }\n void UpdateTables()\n {\n for (UINT32 aPosState = 0; aPosState < m_NumPosStates; aPosState++)\n UpdateTable(aPosState);\n }\n void Encode(CMyRangeEncoder *aRangeEncoder, UINT32 aSymbol, UINT32 aPosState)\n {\n CEncoder::Encode(aRangeEncoder, aSymbol, aPosState);\n if (--m_Counters[aPosState] == 0)\n UpdateTable(aPosState);\n }\n};\n\n\nclass CDecoder\n{\n CMyBitDecoder m_Choice;\n CBitTreeDecoder m_LowCoder[kNumPosStatesMax];\n CMyBitDecoder m_Choice2;\n CBitTreeDecoder m_MidCoder[kNumPosStatesMax];\n CBitTreeDecoder m_HighCoder; \n UINT32 m_NumPosStates;\npublic:\n void Create(UINT32 aNumPosStates)\n { m_NumPosStates = aNumPosStates; }\n void Init()\n {\n m_Choice.Init();\n for (UINT32 aPosState = 0; aPosState < m_NumPosStates; aPosState++)\n {\n m_LowCoder[aPosState].Init();\n m_MidCoder[aPosState].Init();\n }\n m_Choice2.Init();\n m_HighCoder.Init();\n }\n UINT32 Decode(CMyRangeDecoder *aRangeDecoder, UINT32 aPosState)\n {\n if(m_Choice.Decode(aRangeDecoder) == 0)\n return m_LowCoder[aPosState].Decode(aRangeDecoder);\n else\n {\n UINT32 aSymbol = kNumLowSymbols;\n if(m_Choice2.Decode(aRangeDecoder) == 0)\n aSymbol += m_MidCoder[aPosState].Decode(aRangeDecoder);\n else\n {\n aSymbol += kNumMidSymbols;\n aSymbol += m_HighCoder.Decode(aRangeDecoder);\n }\n return aSymbol;\n }\n }\n\n};\n\n}\n\n\n#endif\n"} +{"text": "\n\n\n Child frame\n\n\n

This is a tall frame test

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
First row
Second row
Third row
Fourth row
\n
\n \n\n"} +{"text": ".\n */\n\n/**\n * Doctrine_Query_Check\n *\n * @package Doctrine\n * @subpackage Query\n * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\n * @link www.doctrine-project.org\n * @since 1.0\n * @version $Revision: 1080 $\n * @author Konsta Vesterinen \n */\nclass Doctrine_Query_Check\n{\n /**\n * @var Doctrine_Table $table Doctrine_Table object\n */\n protected $table;\n\n /**\n * @var string $sql database specific sql CHECK constraint definition \n * parsed from the given dql CHECK definition\n */\n protected $sql;\n \n protected $_tokenizer;\n\n /**\n * @param Doctrine_Table|string $table Doctrine_Table object\n */\n public function __construct($table)\n {\n if ( ! ($table instanceof Doctrine_Table)) {\n $table = Doctrine_Manager::getInstance()\n ->getCurrentConnection()\n ->getTable($table);\n }\n $this->table = $table;\n $this->_tokenizer = new Doctrine_Query_Tokenizer();\n }\n\n /**\n * getTable\n * returns the table object associated with this object\n *\n * @return Doctrine_Connection\n */\n public function getTable()\n {\n return $this->table;\n }\n\n /**\n * parse\n *\n * @param string $dql DQL CHECK constraint definition\n * @return string\n */\n public function parse($dql)\n {\n $this->sql = $this->parseClause($dql);\n }\n\n /**\n * parseClause\n *\n * @param string $alias component alias\n * @param string $field the field name\n * @param mixed $value the value of the field\n * @return void\n */\n public function parseClause($dql)\n {\n $parts = $this->_tokenizer->sqlExplode($dql, ' AND ');\n\n if (count($parts) > 1) {\n $ret = array();\n foreach ($parts as $part) {\n $ret[] = $this->parseSingle($part);\n }\n\n $r = implode(' AND ', $ret);\n } else {\n $parts = $this->_tokenizer->quoteExplode($dql, ' OR ');\n if (count($parts) > 1) {\n $ret = array();\n foreach ($parts as $part) {\n $ret[] = $this->parseClause($part);\n }\n\n $r = implode(' OR ', $ret);\n } else {\n $ret = $this->parseSingle($dql);\n return $ret;\n }\n }\n return '(' . $r . ')';\n }\n \n public function parseSingle($part)\n {\n $e = explode(' ', $part);\n \n $e[0] = $this->parseFunction($e[0]);\n\n switch ($e[1]) {\n case '>':\n case '<':\n case '=':\n case '!=':\n case '<>':\n\n break;\n default:\n throw new Doctrine_Query_Exception('Unknown operator ' . $e[1]);\n }\n\n return implode(' ', $e);\n }\n\n public function parseFunction($dql) \n {\n if (($pos = strpos($dql, '(')) !== false) {\n $func = substr($dql, 0, $pos);\n $value = substr($dql, ($pos + 1), -1);\n \n $expr = $this->table->getConnection()->expression;\n\n if ( ! method_exists($expr, $func)) {\n throw new Doctrine_Query_Exception('Unknown function ' . $func);\n }\n \n $func = $expr->$func($value);\n }\n return $func;\n }\n\n /**\n * getSql\n *\n * returns database specific sql CHECK constraint definition\n * parsed from the given dql CHECK definition\n *\n * @return string\n */\n public function getSql()\n {\n return $this->sql;\n }\n}"} +{"text": "\n\n\n\nCMSIS DSP Software Library: arm_biquad_casd_df1_inst_q31 Struct Reference\n\n\n\n\n\n\n\n\n
\n
\n \n
\n \n
\n
\n \n
\n

arm_biquad_casd_df1_inst_q31 Struct Reference

\n
\n
\n\n

Instance structure for the Q31 Biquad cascade filter. \nMore...

\n\n

#include <arm_math.h>

\n\n\n\n\n\n\n

\nData Fields

uint32_t numStages
q31_tpState
q31_tpCoeffs
uint8_t postShift
\n

Detailed Description

\n

Instance structure for the Q31 Biquad cascade filter.

\n
Examples:
\n

arm_graphic_equalizer_example_q31.c.

\n
\n
\n

Definition at line 1183 of file arm_math.h.

\n

Field Documentation

\n\n
\n
\n \n \n \n \n
uint32_t arm_biquad_casd_df1_inst_q31::numStages
\n
\n
\n

number of 2nd order stages in the filter. Overall order is 2*numStages.

\n\n

Definition at line 1185 of file arm_math.h.

\n\n
\n
\n\n
\n\n
\n

Points to the array of state coefficients. The array is of length 4*numStages.

\n\n

Definition at line 1186 of file arm_math.h.

\n\n
\n
\n\n
\n\n
\n

Points to the array of coefficients. The array is of length 5*numStages.

\n\n

Definition at line 1187 of file arm_math.h.

\n\n
\n
\n\n
\n\n
\n

Additional shift, in bits, applied to each output sample.

\n\n

Definition at line 1188 of file arm_math.h.

\n\n
\n
\n
The documentation for this struct was generated from the following file:\n
\n\n\n\n\n
\n\n
\n\n
Generated on Fri Jul 15 2011 13:16:22 for CMSIS DSP Software Library by \n\n\"doxygen\"/ 1.7.2
\n\n\n"} +{"text": ".class Lcom/d/a/a/V;\n.super Ljava/lang/Object;\n\n# interfaces\n.implements Lorg/apache/http/HttpEntity;\n\n\n# static fields\n.field private static final a:Ljava/lang/String; = \"SimpleMultipartEntity\"\n\n.field private static final b:Ljava/lang/String; = \"\\r\\n\"\n\n.field private static final c:[B\n\n.field private static final d:[B\n\n.field private static final e:[C\n\n\n# instance fields\n.field private final f:Ljava/lang/String;\n\n.field private final g:[B\n\n.field private final h:[B\n\n.field private i:Z\n\n.field private final j:Ljava/util/List;\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"Ljava/util/List\",\n \"<\",\n \"Lcom/d/a/a/W;\",\n \">;\"\n }\n .end annotation\n.end field\n\n.field private final k:Ljava/io/ByteArrayOutputStream;\n\n.field private final l:Lcom/d/a/a/S;\n\n.field private m:I\n\n.field private n:I\n\n\n# direct methods\n.method static constructor ()V\n .locals 1\n\n const-string v0, \"\\r\\n\"\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n sput-object v0, Lcom/d/a/a/V;->c:[B\n\n const-string v0, \"Content-Transfer-Encoding: binary\\r\\n\"\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n sput-object v0, Lcom/d/a/a/V;->d:[B\n\n const-string v0, \"-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n invoke-virtual {v0}, Ljava/lang/String;->toCharArray()[C\n\n move-result-object v0\n\n sput-object v0, Lcom/d/a/a/V;->e:[C\n\n return-void\n.end method\n\n.method public constructor (Lcom/d/a/a/S;)V\n .locals 5\n\n invoke-direct {p0}, Ljava/lang/Object;->()V\n\n new-instance v0, Ljava/util/ArrayList;\n\n invoke-direct {v0}, Ljava/util/ArrayList;->()V\n\n iput-object v0, p0, Lcom/d/a/a/V;->j:Ljava/util/List;\n\n new-instance v0, Ljava/io/ByteArrayOutputStream;\n\n invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;->()V\n\n iput-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n new-instance v1, Ljava/lang/StringBuilder;\n\n invoke-direct {v1}, Ljava/lang/StringBuilder;->()V\n\n new-instance v2, Ljava/util/Random;\n\n invoke-direct {v2}, Ljava/util/Random;->()V\n\n const/4 v0, 0x0\n\n :goto_0\n const/16 v3, 0x1e\n\n if-ge v0, v3, :cond_0\n\n sget-object v3, Lcom/d/a/a/V;->e:[C\n\n sget-object v4, Lcom/d/a/a/V;->e:[C\n\n array-length v4, v4\n\n invoke-virtual {v2, v4}, Ljava/util/Random;->nextInt(I)I\n\n move-result v4\n\n aget-char v3, v3, v4\n\n invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;\n\n add-int/lit8 v0, v0, 0x1\n\n goto :goto_0\n\n :cond_0\n invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v0\n\n iput-object v0, p0, Lcom/d/a/a/V;->f:Ljava/lang/String;\n\n new-instance v0, Ljava/lang/StringBuilder;\n\n invoke-direct {v0}, Ljava/lang/StringBuilder;->()V\n\n const-string v1, \"--\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n iget-object v1, p0, Lcom/d/a/a/V;->f:Ljava/lang/String;\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\r\\n\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n iput-object v0, p0, Lcom/d/a/a/V;->g:[B\n\n new-instance v0, Ljava/lang/StringBuilder;\n\n invoke-direct {v0}, Ljava/lang/StringBuilder;->()V\n\n const-string v1, \"--\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n iget-object v1, p0, Lcom/d/a/a/V;->f:Ljava/lang/String;\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"--\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\r\\n\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n iput-object v0, p0, Lcom/d/a/a/V;->h:[B\n\n iput-object p1, p0, Lcom/d/a/a/V;->l:Lcom/d/a/a/S;\n\n return-void\n.end method\n\n.method private a(Ljava/lang/String;)Ljava/lang/String;\n .locals 0\n\n if-nez p1, :cond_0\n\n const-string p1, \"application/octet-stream\"\n\n :cond_0\n return-object p1\n.end method\n\n.method private a(I)V\n .locals 3\n\n iget v0, p0, Lcom/d/a/a/V;->m:I\n\n add-int/2addr v0, p1\n\n iput v0, p0, Lcom/d/a/a/V;->m:I\n\n iget-object v0, p0, Lcom/d/a/a/V;->l:Lcom/d/a/a/S;\n\n iget v1, p0, Lcom/d/a/a/V;->m:I\n\n iget v2, p0, Lcom/d/a/a/V;->n:I\n\n invoke-interface {v0, v1, v2}, Lcom/d/a/a/S;->sendProgressMessage(II)V\n\n return-void\n.end method\n\n.method static synthetic a(Lcom/d/a/a/V;I)V\n .locals 0\n\n invoke-direct {p0, p1}, Lcom/d/a/a/V;->a(I)V\n\n return-void\n.end method\n\n.method static synthetic a()[B\n .locals 1\n\n sget-object v0, Lcom/d/a/a/V;->d:[B\n\n return-object v0\n.end method\n\n.method static synthetic a(Lcom/d/a/a/V;)[B\n .locals 1\n\n iget-object v0, p0, Lcom/d/a/a/V;->g:[B\n\n return-object v0\n.end method\n\n.method static synthetic a(Lcom/d/a/a/V;Ljava/lang/String;)[B\n .locals 1\n\n invoke-direct {p0, p1}, Lcom/d/a/a/V;->b(Ljava/lang/String;)[B\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method static synthetic a(Lcom/d/a/a/V;Ljava/lang/String;Ljava/lang/String;)[B\n .locals 1\n\n invoke-direct {p0, p1, p2}, Lcom/d/a/a/V;->b(Ljava/lang/String;Ljava/lang/String;)[B\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method static synthetic b()[B\n .locals 1\n\n sget-object v0, Lcom/d/a/a/V;->c:[B\n\n return-object v0\n.end method\n\n.method private b(Ljava/lang/String;)[B\n .locals 2\n\n new-instance v0, Ljava/lang/StringBuilder;\n\n invoke-direct {v0}, Ljava/lang/StringBuilder;->()V\n\n const-string v1, \"Content-Type: \"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-direct {p0, p1}, Lcom/d/a/a/V;->a(Ljava/lang/String;)Ljava/lang/String;\n\n move-result-object v1\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\r\\n\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method private b(Ljava/lang/String;Ljava/lang/String;)[B\n .locals 2\n\n new-instance v0, Ljava/lang/StringBuilder;\n\n invoke-direct {v0}, Ljava/lang/StringBuilder;->()V\n\n const-string v1, \"Content-Disposition: form-data; name=\\\"\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\\"; filename=\\\"\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\\"\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\r\\n\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method private c(Ljava/lang/String;)[B\n .locals 2\n\n new-instance v0, Ljava/lang/StringBuilder;\n\n invoke-direct {v0}, Ljava/lang/StringBuilder;->()V\n\n const-string v1, \"Content-Disposition: form-data; name=\\\"\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\\"\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n const-string v1, \"\\r\\n\"\n\n invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v0\n\n invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v0\n\n return-object v0\n.end method\n\n\n# virtual methods\n.method public a(Ljava/lang/String;Ljava/io/File;)V\n .locals 1\n\n const/4 v0, 0x0\n\n invoke-virtual {p0, p1, p2, v0}, Lcom/d/a/a/V;->a(Ljava/lang/String;Ljava/io/File;Ljava/lang/String;)V\n\n return-void\n.end method\n\n.method public a(Ljava/lang/String;Ljava/io/File;Ljava/lang/String;)V\n .locals 3\n\n iget-object v0, p0, Lcom/d/a/a/V;->j:Ljava/util/List;\n\n new-instance v1, Lcom/d/a/a/W;\n\n invoke-direct {p0, p3}, Lcom/d/a/a/V;->a(Ljava/lang/String;)Ljava/lang/String;\n\n move-result-object v2\n\n invoke-direct {v1, p0, p1, p2, v2}, Lcom/d/a/a/W;->(Lcom/d/a/a/V;Ljava/lang/String;Ljava/io/File;Ljava/lang/String;)V\n\n invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z\n\n return-void\n.end method\n\n.method public a(Ljava/lang/String;Ljava/lang/String;)V\n .locals 1\n\n const-string v0, \"text/plain; charset=UTF-8\"\n\n invoke-virtual {p0, p1, p2, v0}, Lcom/d/a/a/V;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V\n\n return-void\n.end method\n\n.method public a(Ljava/lang/String;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)V\n .locals 4\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n iget-object v1, p0, Lcom/d/a/a/V;->g:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-direct {p0, p1, p2}, Lcom/d/a/a/V;->b(Ljava/lang/String;Ljava/lang/String;)[B\n\n move-result-object v1\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-direct {p0, p4}, Lcom/d/a/a/V;->b(Ljava/lang/String;)[B\n\n move-result-object v1\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n sget-object v1, Lcom/d/a/a/V;->d:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n sget-object v1, Lcom/d/a/a/V;->c:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n const/16 v0, 0x1000\n\n new-array v0, v0, [B\n\n :goto_0\n invoke-virtual {p3, v0}, Ljava/io/InputStream;->read([B)I\n\n move-result v1\n\n const/4 v2, -0x1\n\n if-eq v1, v2, :cond_0\n\n iget-object v2, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n const/4 v3, 0x0\n\n invoke-virtual {v2, v0, v3, v1}, Ljava/io/ByteArrayOutputStream;->write([BII)V\n\n goto :goto_0\n\n :cond_0\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n sget-object v1, Lcom/d/a/a/V;->c:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->flush()V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-static {v0}, Lcom/d/a/a/a;->a(Ljava/io/OutputStream;)V\n\n return-void\n.end method\n\n.method public a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V\n .locals 3\n\n :try_start_0\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n iget-object v1, p0, Lcom/d/a/a/V;->g:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-direct {p0, p1}, Lcom/d/a/a/V;->c(Ljava/lang/String;)[B\n\n move-result-object v1\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-direct {p0, p3}, Lcom/d/a/a/V;->b(Ljava/lang/String;)[B\n\n move-result-object v1\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n sget-object v1, Lcom/d/a/a/V;->c:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-virtual {p2}, Ljava/lang/String;->getBytes()[B\n\n move-result-object v1\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n sget-object v1, Lcom/d/a/a/V;->c:[B\n\n invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write([B)V\n :try_end_0\n .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0\n\n :goto_0\n return-void\n\n :catch_0\n move-exception v0\n\n const-string v1, \"SimpleMultipartEntity\"\n\n const-string v2, \"addPart ByteArrayOutputStream exception\"\n\n invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I\n\n goto :goto_0\n.end method\n\n.method public a(Z)V\n .locals 0\n\n iput-boolean p1, p0, Lcom/d/a/a/V;->i:Z\n\n return-void\n.end method\n\n.method public consumeContent()V\n .locals 2\n\n invoke-virtual {p0}, Lcom/d/a/a/V;->isStreaming()Z\n\n move-result v0\n\n if-eqz v0, :cond_0\n\n new-instance v0, Ljava/lang/UnsupportedOperationException;\n\n const-string v1, \"Streaming entity does not implement #consumeContent()\"\n\n invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;->(Ljava/lang/String;)V\n\n throw v0\n\n :cond_0\n return-void\n.end method\n\n.method public getContent()Ljava/io/InputStream;\n .locals 2\n\n new-instance v0, Ljava/lang/UnsupportedOperationException;\n\n const-string v1, \"getContent() is not supported. Use writeTo() instead.\"\n\n invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;->(Ljava/lang/String;)V\n\n throw v0\n.end method\n\n.method public getContentEncoding()Lorg/apache/http/Header;\n .locals 1\n\n const/4 v0, 0x0\n\n return-object v0\n.end method\n\n.method public getContentLength()J\n .locals 8\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->size()I\n\n move-result v0\n\n int-to-long v0, v0\n\n iget-object v2, p0, Lcom/d/a/a/V;->j:Ljava/util/List;\n\n invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;\n\n move-result-object v3\n\n move-wide v1, v0\n\n :goto_0\n invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z\n\n move-result v0\n\n if-eqz v0, :cond_1\n\n invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;\n\n move-result-object v0\n\n check-cast v0, Lcom/d/a/a/W;\n\n invoke-virtual {v0}, Lcom/d/a/a/W;->a()J\n\n move-result-wide v4\n\n const-wide/16 v6, 0x0\n\n cmp-long v0, v4, v6\n\n if-gez v0, :cond_0\n\n const-wide/16 v0, -0x1\n\n :goto_1\n return-wide v0\n\n :cond_0\n add-long v0, v1, v4\n\n move-wide v1, v0\n\n goto :goto_0\n\n :cond_1\n iget-object v0, p0, Lcom/d/a/a/V;->h:[B\n\n array-length v0, v0\n\n int-to-long v3, v0\n\n add-long v0, v1, v3\n\n goto :goto_1\n.end method\n\n.method public getContentType()Lorg/apache/http/Header;\n .locals 4\n\n new-instance v0, Lorg/apache/http/message/BasicHeader;\n\n const-string v1, \"Content-Type\"\n\n new-instance v2, Ljava/lang/StringBuilder;\n\n invoke-direct {v2}, Ljava/lang/StringBuilder;->()V\n\n const-string v3, \"multipart/form-data; boundary=\"\n\n invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v2\n\n iget-object v3, p0, Lcom/d/a/a/V;->f:Ljava/lang/String;\n\n invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v2\n\n invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v2\n\n invoke-direct {v0, v1, v2}, Lorg/apache/http/message/BasicHeader;->(Ljava/lang/String;Ljava/lang/String;)V\n\n return-object v0\n.end method\n\n.method public isChunked()Z\n .locals 1\n\n const/4 v0, 0x0\n\n return v0\n.end method\n\n.method public isRepeatable()Z\n .locals 1\n\n iget-boolean v0, p0, Lcom/d/a/a/V;->i:Z\n\n return v0\n.end method\n\n.method public isStreaming()Z\n .locals 1\n\n const/4 v0, 0x0\n\n return v0\n.end method\n\n.method public writeTo(Ljava/io/OutputStream;)V\n .locals 2\n\n const/4 v0, 0x0\n\n iput v0, p0, Lcom/d/a/a/V;->m:I\n\n invoke-virtual {p0}, Lcom/d/a/a/V;->getContentLength()J\n\n move-result-wide v0\n\n long-to-int v0, v0\n\n iput v0, p0, Lcom/d/a/a/V;->n:I\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-virtual {v0, p1}, Ljava/io/ByteArrayOutputStream;->writeTo(Ljava/io/OutputStream;)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->k:Ljava/io/ByteArrayOutputStream;\n\n invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->size()I\n\n move-result v0\n\n invoke-direct {p0, v0}, Lcom/d/a/a/V;->a(I)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->j:Ljava/util/List;\n\n invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;\n\n move-result-object v1\n\n :goto_0\n invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z\n\n move-result v0\n\n if-eqz v0, :cond_0\n\n invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;\n\n move-result-object v0\n\n check-cast v0, Lcom/d/a/a/W;\n\n invoke-virtual {v0, p1}, Lcom/d/a/a/W;->a(Ljava/io/OutputStream;)V\n\n goto :goto_0\n\n :cond_0\n iget-object v0, p0, Lcom/d/a/a/V;->h:[B\n\n invoke-virtual {p1, v0}, Ljava/io/OutputStream;->write([B)V\n\n iget-object v0, p0, Lcom/d/a/a/V;->h:[B\n\n array-length v0, v0\n\n invoke-direct {p0, v0}, Lcom/d/a/a/V;->a(I)V\n\n return-void\n.end method\n"} +{"text": "\n\n\n"} +{"text": " - replies to the channel with \"\n match /^echo (.*)/, :sent_to_me => true do |phrase|\n reply(phrase) unless phrase.empty?\n end\nend\n"} +{"text": "VERB=\"DELETE\"\nURI=\"farms\"\n"} +{"text": "// Copyright 2014 the V8 project authors. All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following\n// disclaimer in the documentation and/or other materials provided\n// with the distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived\n// from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Flags: --allow-natives-syntax\n\nfunction g() {\n this.x = this;\n}\n\nfunction f() {\n return new g();\n};\n%PrepareFunctionForOptimization(f);\nf();\nf();\n%OptimizeFunctionOnNextCall(f);\nf();\n"} +{"text": "// Boost.Geometry (aka GGL, Generic Geometry Library)\r\n\r\n// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.\r\n// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.\r\n// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.\r\n\r\n// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library\r\n// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.\r\n\r\n// This file was modified by Oracle on 2013, 2014.\r\n// Modifications copyright (c) 2013, 2014, Oracle and/or its affiliates.\r\n\r\n// Use, modification and distribution is subject to the Boost Software License,\r\n// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\r\n// http://www.boost.org/LICENSE_1_0.txt)\r\n\r\n// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle\r\n\r\n#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP\r\n#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP\r\n\r\n#include \r\n#include \r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\n\r\nnamespace boost { namespace geometry\r\n{\r\n\r\n#ifndef DOXYGEN_NO_DETAIL\r\nnamespace detail { namespace section\r\n{\r\n\r\n\r\ntemplate \r\nstruct full_section_range\r\n{\r\n static inline Range const& apply(Range const& range, Section const& )\r\n {\r\n return range;\r\n }\r\n};\r\n\r\n\r\ntemplate \r\nstruct full_section_polygon\r\n{\r\n static inline typename ring_return_type::type apply(Polygon const& polygon, Section const& section)\r\n {\r\n return section.ring_id.ring_index < 0\r\n ? geometry::exterior_ring(polygon)\r\n : range::at(geometry::interior_rings(polygon),\r\n static_cast(section.ring_id.ring_index));\r\n }\r\n};\r\n\r\n\r\ntemplate\r\n<\r\n typename MultiGeometry,\r\n typename Section,\r\n typename Policy\r\n>\r\nstruct full_section_multi\r\n{\r\n static inline typename ring_return_type::type apply(\r\n MultiGeometry const& multi, Section const& section)\r\n {\r\n typedef typename boost::range_size::type size_type;\r\n\r\n BOOST_GEOMETRY_ASSERT\r\n (\r\n section.ring_id.multi_index >= 0\r\n && size_type(section.ring_id.multi_index) < boost::size(multi)\r\n );\r\n\r\n return Policy::apply(range::at(multi, size_type(section.ring_id.multi_index)), section);\r\n }\r\n};\r\n\r\n\r\n}} // namespace detail::section\r\n#endif\r\n\r\n\r\n#ifndef DOXYGEN_NO_DISPATCH\r\nnamespace dispatch\r\n{\r\n\r\n\r\ntemplate\r\n<\r\n typename Tag,\r\n typename Geometry,\r\n typename Section\r\n>\r\nstruct range_by_section\r\n{\r\n BOOST_MPL_ASSERT_MSG\r\n (\r\n false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE\r\n , (types)\r\n );\r\n};\r\n\r\n\r\ntemplate \r\nstruct range_by_section\r\n : detail::section::full_section_range\r\n{};\r\n\r\n\r\ntemplate \r\nstruct range_by_section\r\n : detail::section::full_section_range\r\n{};\r\n\r\n\r\ntemplate \r\nstruct range_by_section\r\n : detail::section::full_section_polygon\r\n{};\r\n\r\n\r\ntemplate \r\nstruct range_by_section\r\n : detail::section::full_section_multi\r\n <\r\n MultiPolygon,\r\n Section,\r\n detail::section::full_section_polygon\r\n <\r\n typename boost::range_value::type,\r\n Section\r\n >\r\n >\r\n{};\r\n\r\ntemplate \r\nstruct range_by_section\r\n : detail::section::full_section_multi\r\n <\r\n MultiLinestring,\r\n Section,\r\n detail::section::full_section_range\r\n <\r\n typename boost::range_value::type,\r\n Section\r\n >\r\n >\r\n{};\r\n\r\n\r\n} // namespace dispatch\r\n#endif\r\n\r\n\r\n/*!\r\n \\brief Get full ring (exterior, one of interiors, one from multi)\r\n indicated by the specified section\r\n \\ingroup sectionalize\r\n \\tparam Geometry type\r\n \\tparam Section type of section to get from\r\n \\param geometry geometry to take section of\r\n \\param section structure with section\r\n */\r\ntemplate \r\ninline typename ring_return_type::type\r\n range_by_section(Geometry const& geometry, Section const& section)\r\n{\r\n concepts::check();\r\n\r\n return dispatch::range_by_section\r\n <\r\n typename tag::type,\r\n Geometry,\r\n Section\r\n >::apply(geometry, section);\r\n}\r\n\r\n\r\n}} // namespace boost::geometry\r\n\r\n#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP\r\n"} +{"text": "{\n \"name\": \"Theme-BrillianceDull\",\n \"displayName\": \"Brilliance_Dull Theme\",\n \"description\": \"Brilliance_Dull Theme ported from the BrillianceDull TextMate Theme\",\n \"version\": \"0.0.5\",\n \"publisher\": \"gerane\",\n \"engines\": {\n \"vscode\": \"^0.10.1\"\n },\n \"categories\": [\n \"Themes\"\n ],\n \"icon\": \"icon.png\",\n \"homepage\": \"https://github.com/gerane/VSCodeThemes/blob/master/gerane.Theme-Brilliance_Dull/README.md\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/gerane/VSCodeThemes.git\"\n },\n \"contributes\": {\n \"themes\": [\n {\n \"label\": \"Brilliance_Dull\",\n \"path\": \"./themes/Brilliance_Dull.tmTheme\",\n \"uiTheme\": \"vs-dark\"\n }\n ]\n }\n}\n"} +{"text": "\n\n\n Services API\n \n \n \n \n\n\n
\n

Services API

\n\n
\n

Retrieve a Particular Service

\n

GET /v2/services/:guid

\n\n

Request

\n

Route

\n
GET /v2/services/53f52780-e93c-4af7-a96c-6958311c40e5
\n\n\n\n

Body

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameDescriptionDefaultValid ValuesExample Values
\n guid\n \n The guid of the service\n \n \n \n
    \n
\n
\n
    \n
\n
\n label\n \n The name of the service\n \n \n \n
    \n
\n
\n
    \n
  • SomeMysqlService
  • \n
\n
\n description\n \n A short blurb describing the service\n \n \n \n
    \n
\n
\n
    \n
  • Mysql stores things for you
  • \n
\n
\n long_description\n \n A longer description of the service\n \n \n \n
    \n
\n
\n
    \n
  • Mysql is a database. It stores things. Use it in your apps...
  • \n
\n
\n info_url\n \n A url that points to an info page for the service\n \n \n \n
    \n
\n
\n
    \n
  • http://info.somemysqlservice.com
  • \n
\n
\n documentation_url\n \n A url that points to a documentation page for the service\n \n \n \n
    \n
\n
\n
    \n
  • http://docs.somemysqlservice.com
  • \n
\n
\n timeout\n \n A timeout used by the v1 service gateway client\n \n \n \n
    \n
\n
\n
    \n
\n
\n active\n \n A boolean describing that the service can be provisioned by users\n \n false\n \n
    \n
\n
\n
    \n
\n
\n bindable\n \n A boolean describing that the service can be bound to applications\n \n true\n \n
    \n
\n
\n
    \n
\n
\n extra\n \n A JSON field with extra data pertaining to the service\n \n \n \n
    \n
\n
\n
    \n
  • {"providerDisplayName": "MyServiceProvider"}
  • \n
\n
\n unique_id\n \n A guid that identifies the service with the broker (not the same as the guid above)\n \n \n \n
    \n
\n
\n
    \n
\n
\n tags\n \n A list of tags for the service. Max characters: 2048\n \n []\n \n
    \n
\n
\n
    \n
  • database
  • \n
  • mysql
  • \n
\n
\n requires\n \n A list of dependencies for services. The presence of "syslog_drain" indicates that on binding an instance of the service to an application,\n logs for the app will be streamed to a url provided by the service. The presence of "route_forwarding" indicates that on binding an instance of the\n service to a route, requests for the route may be processed by the service before being forwarded to an application mapped to the route.\n \n []\n \n
    \n
\n
\n
    \n
  • syslog_drain
  • \n
  • route_forwarding
  • \n
\n
\n provider\n \n The name of the service provider (used only by v1 service gateways)\n \n \n \n
    \n
\n
\n
    \n
  • MySql Provider
  • \n
\n
\n version\n \n The version of the service (used only by v1 service gateways)\n \n \n \n
    \n
\n
\n
    \n
  • 2.0
  • \n
\n
\n url\n \n The url of the service provider (used only by v1 service gateways)\n \n \n \n
    \n
\n
\n
    \n
  • http://myql.provider.com
  • \n
\n
\n service_broker_guid\n \n The guid of the v2 service broker associated with the service\n \n \n \n
    \n
\n
\n
    \n
\n
\n service_broker_name\n \n The name of the v2 service broker associated with the service\n \n \n \n
    \n
\n
\n
    \n
\n
\n plan_updateable\n \n A boolean describing that an instance of this service can be updated to a different plan\n \n false\n \n
    \n
\n
\n
    \n
\n
\n instances_retrievable\n \n A boolean describing that the service may support fetching configuration parameters for service instances\n \n false\n \n
    \n
\n
\n
    \n
\n
\n bindings_retrievable\n \n A boolean describing that the service may support fetching configuration parameters for service bindings\n \n false\n \n
    \n
\n
\n
    \n
\n
\n\n\n

Headers

\n
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MSIsImVtYWlsIjoiZW1haWwtMTM2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTJ9.Az1OoZ-6t631XQxWQJatcsd2kkP7twEf4_vLd0SsYes\nHost: example.org\nCookie: 
\n\n

cURL

\n
curl "https://api.[your-domain.com]/v2/services/53f52780-e93c-4af7-a96c-6958311c40e5" -X GET \\\n\t-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MSIsImVtYWlsIjoiZW1haWwtMTM2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTJ9.Az1OoZ-6t631XQxWQJatcsd2kkP7twEf4_vLd0SsYes" \\\n\t-H "Host: example.org" \\\n\t-H "Cookie: "
\n\n

Response

\n\n

Status

\n
200 OK
\n\n

Body

\n\n
{\n  \"metadata\": {\n    \"guid\": \"53f52780-e93c-4af7-a96c-6958311c40e5\",\n    \"url\": \"/v2/services/53f52780-e93c-4af7-a96c-6958311c40e5\",\n    \"created_at\": \"2016-06-08T16:41:32Z\",\n    \"updated_at\": \"2016-06-08T16:41:26Z\"\n  },\n  \"entity\": {\n    \"label\": \"label-58\",\n    \"provider\": null,\n    \"url\": null,\n    \"description\": \"desc-135\",\n    \"long_description\": null,\n    \"version\": null,\n    \"info_url\": null,\n    \"active\": true,\n    \"bindable\": true,\n    \"unique_id\": \"c181996b-f233-43d1-8901-3a43eafcaacf\",\n    \"extra\": null,\n    \"tags\": [\n\n    ],\n    \"requires\": [\n\n    ],\n    \"documentation_url\": null,\n    \"service_broker_guid\": \"0e7250aa-364f-42c2-8fd2-808b0224376f\",\n    \"service_broker_name\": \"name-1700\",\n    \"plan_updateable\": false,\n    \"instances_retrievable\": false,\n    \"bindings_retrievable\": false,\n    \"service_plans_url\": \"/v2/services/53f52780-e93c-4af7-a96c-6958311c40e5/service_plans\"\n  }\n}
\n\n

Headers

\n
Content-Type: application/json;charset=utf-8\nX-VCAP-Request-ID: 5970782f-cc87-41b6-a6b1-84d443b033da\nContent-Length: 776\nX-Content-Type-Options: nosniff
\n\n
\n
\n\n\n"} +{"text": "function Person(first, last, age) {\n\tthis.first = first;\n\tthis.last = last;\n\tthis.age = age;\n}\n\nPerson.prototype.getName = function() {\n\tvar name = first + \" \" + last;\n\treturn name.trim();\n};"} +{"text": "package cn.blackshop.wechat.mp.controller;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\nimport javax.servlet.http.HttpServletRequest;\n\nimport cn.blackshop.wechat.mp.config.WxMpConfiguration;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.context.request.RequestContextHolder;\nimport org.springframework.web.context.request.ServletRequestAttributes;\n\nimport me.chanjar.weixin.common.api.WxConsts;\nimport me.chanjar.weixin.common.api.WxConsts.MenuButtonType;\nimport me.chanjar.weixin.common.bean.menu.WxMenu;\nimport me.chanjar.weixin.common.bean.menu.WxMenuButton;\nimport me.chanjar.weixin.common.error.WxErrorException;\nimport me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;\nimport me.chanjar.weixin.mp.bean.menu.WxMpMenu;\n\n/**\n * 微信菜单控制器\n */\n@RestController\n@RequestMapping(\"/wx/menu/{appid}\")\npublic class WxMenuController {\n\n\t/**\n\t *
\n\t * 自定义菜单创建接口\n\t * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN\n\t * 如果要创建个性化菜单,请设置matchrule属性\n\t * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN\n\t * 
\n\t *\n\t * @return 如果是个性化菜单,则返回menuid,否则返回null\n\t */\n\t@PostMapping(\"/create\")\n\tpublic String menuCreate(@PathVariable String appid, @RequestBody WxMenu menu) throws WxErrorException {\n\t\treturn WxMpConfiguration.getMpServices().get(appid).getMenuService().menuCreate(menu);\n\t}\n\n\t@GetMapping(\"/create\")\n\tpublic String menuCreateSample(@PathVariable String appid) throws WxErrorException, MalformedURLException {\n\t\tWxMenu menu = new WxMenu();\n\t\tWxMenuButton button1 = new WxMenuButton();\n\t\tbutton1.setType(MenuButtonType.CLICK);\n\t\tbutton1.setName(\"今日歌曲\");\n\t\tbutton1.setKey(\"V1001_TODAY_MUSIC\");\n\n\t\t// WxMenuButton button2 = new WxMenuButton();\n\t\t// button2.setType(WxConsts.BUTTON_MINIPROGRAM);\n\t\t// button2.setName(\"小程序\");\n\t\t// button2.setAppId(\"wx286b93c14bbf93aa\");\n\t\t// button2.setPagePath(\"pages/lunar/index.html\");\n\t\t// button2.setUrl(\"http://mp.weixin.qq.com\");\n\n\t\tWxMenuButton button3 = new WxMenuButton();\n\t\tbutton3.setName(\"菜单\");\n\n\t\tmenu.getButtons().add(button1);\n\t\t// menu.getButtons().add(button2);\n\t\tmenu.getButtons().add(button3);\n\n\t\tWxMenuButton button31 = new WxMenuButton();\n\t\tbutton31.setType(MenuButtonType.VIEW);\n\t\tbutton31.setName(\"搜索\");\n\t\tbutton31.setUrl(\"http://www.soso.com/\");\n\n\t\tWxMenuButton button32 = new WxMenuButton();\n\t\tbutton32.setType(MenuButtonType.VIEW);\n\t\tbutton32.setName(\"视频\");\n\t\tbutton32.setUrl(\"http://v.qq.com/\");\n\n\t\tWxMenuButton button33 = new WxMenuButton();\n\t\tbutton33.setType(MenuButtonType.CLICK);\n\t\tbutton33.setName(\"赞一下我们\");\n\t\tbutton33.setKey(\"V1001_GOOD\");\n\n\t\tWxMenuButton button34 = new WxMenuButton();\n\t\tbutton34.setType(MenuButtonType.VIEW);\n\t\tbutton34.setName(\"获取用户信息\");\n\n\t\tServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder\n\t\t\t\t.getRequestAttributes();\n\t\tif (servletRequestAttributes != null) {\n\t\t\tHttpServletRequest request = servletRequestAttributes.getRequest();\n\t\t\tURL requestURL = new URL(request.getRequestURL().toString());\n\t\t\tString url = WxMpConfiguration.getMpServices()\n\t\t\t\t\t.get(appid).oauth2buildAuthorizationUrl(String.format(\"%s://%s/wx/redirect/%s/greet\",\n\t\t\t\t\t\t\trequestURL.getProtocol(), requestURL.getHost(), appid),\n\t\t\t\t\t\t\tWxConsts.OAuth2Scope.SNSAPI_USERINFO, null);\n\t\t\tbutton34.setUrl(url);\n\t\t}\n\n\t\tbutton3.getSubButtons().add(button31);\n\t\tbutton3.getSubButtons().add(button32);\n\t\tbutton3.getSubButtons().add(button33);\n\t\tbutton3.getSubButtons().add(button34);\n\n\t\treturn WxMpConfiguration.getMpServices().get(appid).getMenuService().menuCreate(menu);\n\t}\n\n\t/**\n\t *
\n\t * 自定义菜单创建接口\n\t * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN\n\t * 如果要创建个性化菜单,请设置matchrule属性\n\t * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN\n\t * 
\n\t *\n\t * @param json\n\t * @return 如果是个性化菜单,则返回menuid,否则返回null\n\t */\n\t@PostMapping(\"/createByJson\")\n\tpublic String menuCreate(@PathVariable String appid, @RequestBody String json) throws WxErrorException {\n\t\treturn WxMpConfiguration.getMpServices().get(appid).getMenuService().menuCreate(json);\n\t}\n\n\t/**\n\t *
\n\t * 自定义菜单删除接口\n\t * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141015&token=&lang=zh_CN\n\t * 
\n\t */\n\t@GetMapping(\"/delete\")\n\tpublic void menuDelete(@PathVariable String appid) throws WxErrorException {\n\t\tWxMpConfiguration.getMpServices().get(appid).getMenuService().menuDelete();\n\t}\n\n\t/**\n\t *
\n\t * 删除个性化菜单接口\n\t * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN\n\t * 
\n\t *\n\t * @param menuId\n\t * 个性化菜单的menuid\n\t */\n\t@GetMapping(\"/delete/{menuId}\")\n\tpublic void menuDelete(@PathVariable String appid, @PathVariable String menuId) throws WxErrorException {\n\t\tWxMpConfiguration.getMpServices().get(appid).getMenuService().menuDelete(menuId);\n\t}\n\n\t/**\n\t *
\n\t * 自定义菜单查询接口\n\t * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141014&token=&lang=zh_CN\n\t * 
\n\t */\n\t@GetMapping(\"/get\")\n\tpublic WxMpMenu menuGet(@PathVariable String appid) throws WxErrorException {\n\t\treturn WxMpConfiguration.getMpServices().get(appid).getMenuService().menuGet();\n\t}\n\n\t/**\n\t *
\n\t * 测试个性化菜单匹配结果\n\t * 详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html\n\t * 
\n\t *\n\t * @param userid\n\t * 可以是粉丝的OpenID,也可以是粉丝的微信号。\n\t */\n\t@GetMapping(\"/menuTryMatch/{userid}\")\n\tpublic WxMenu menuTryMatch(@PathVariable String appid, @PathVariable String userid) throws WxErrorException {\n\t\treturn WxMpConfiguration.getMpServices().get(appid).getMenuService().menuTryMatch(userid);\n\t}\n\n\t/**\n\t *
\n\t * 获取自定义菜单配置接口\n\t * 本接口将会提供公众号当前使用的自定义菜单的配置,如果公众号是通过API调用设置的菜单,则返回菜单的开发配置,而如果公众号是在公众平台官网通过网站功能发布菜单,则本接口返回运营者设置的菜单配置。\n\t * 请注意:\n\t * 1、第三方平台开发者可以通过本接口,在旗下公众号将业务授权给你后,立即通过本接口检测公众号的自定义菜单配置,并通过接口再次给公众号设置好自动回复规则,以提升公众号运营者的业务体验。\n\t * 2、本接口与自定义菜单查询接口的不同之处在于,本接口无论公众号的接口是如何设置的,都能查询到接口,而自定义菜单查询接口则仅能查询到使用API设置的菜单配置。\n\t * 3、认证/未认证的服务号/订阅号,以及接口测试号,均拥有该接口权限。\n\t * 4、从第三方平台的公众号登录授权机制上来说,该接口从属于消息与菜单权限集。\n\t * 5、本接口中返回的图片/语音/视频为临时素材(临时素材每次获取都不同,3天内有效,通过素材管理-获取临时素材接口来获取这些素材),本接口返回的图文消息为永久素材素材(通过素材管理-获取永久素材接口来获取这些素材)。\n\t *  接口调用请求说明:\n\t * http请求方式: GET(请使用https协议)\n\t * https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token=ACCESS_TOKEN\n\t * 
\n\t */\n\t@GetMapping(\"/getSelfMenuInfo\")\n\tpublic WxMpGetSelfMenuInfoResult getSelfMenuInfo(@PathVariable String appid) throws WxErrorException {\n\t\treturn WxMpConfiguration.getMpServices().get(appid).getMenuService().getSelfMenuInfo();\n\t}\n}\n"} +{"text": "//\n// Adding_a_Tab_Bar_Controller_to_a_StoryboardTests.m\n// Adding a Tab Bar Controller to a StoryboardTests\n//\n// Created by Vandad NP on 29/06/2013.\n// Copyright (c) 2013 Pixolity Ltd. All rights reserved.\n//\n\n#import \n\n@interface Adding_a_Tab_Bar_Controller_to_a_StoryboardTests : XCTestCase\n\n@end\n\n@implementation Adding_a_Tab_Bar_Controller_to_a_StoryboardTests\n\n- (void)setUp\n{\n [super setUp];\n \n // Set-up code here.\n}\n\n- (void)tearDown\n{\n // Tear-down code here.\n \n [super tearDown];\n}\n\n- (void)testExample\n{\n XCTFail(@\"No implementation for \\\"%s\\\"\", __PRETTY_FUNCTION__);\n}\n\n@end\n"} +{"text": "package net.qiujuer.tips.factory.view;\n\n\nimport net.qiujuer.tips.factory.util.TipsCalender;\n\nimport java.util.UUID;\n\npublic interface RecordEditView extends RecordAddView {\n UUID getId();\n\n void setType(int type);\n\n void setBrief(String title);\n\n void setDate(TipsCalender date);\n\n void setColor(int color);\n\n void setContactName(String name);\n}\n"} +{"text": "#! FIELDS phi projection\n#! SET min_phi -pi\n#! SET max_phi pi\n#! SET nbins_phi 100\n#! SET periodic_phi true\n -3.141592654 68.585848989\n -3.078760801 67.223659404\n -3.015928947 65.776157215\n -2.953097094 64.374021180\n -2.890265241 63.180311593\n -2.827433388 62.366468566\n -2.764601535 62.067386942\n -2.701769682 62.321903341\n -2.638937829 63.014807524\n -2.576105976 63.885757021\n -2.513274123 64.700820473\n -2.450442270 65.420932364\n -2.387610417 66.106524172\n -2.324778564 66.772520608\n -2.261946711 67.365189258\n -2.199114858 67.770205418\n -2.136283004 67.751305742\n -2.073451151 66.666246909\n -2.010619298 63.324801595\n -1.947787445 57.622512856\n -1.884955592 50.506518183\n -1.822123739 42.553901742\n -1.759291886 34.161906600\n -1.696460033 25.756531404\n -1.633628180 17.813707586\n -1.570796327 10.830069381\n -1.507964474 5.279794306\n -1.445132621 1.569723767\n -1.382300768 0.000000000\n -1.319468915 0.734691797\n -1.256637061 3.784854706\n -1.193805208 9.004957229\n -1.130973355 16.102299050\n -1.068141502 24.657716237\n -1.005309649 34.154406245\n -0.942477796 44.010212671\n -0.879645943 53.605451398\n -0.816814090 62.252764557\n -0.753982237 68.822224395\n -0.691150384 72.116376776\n -0.628318531 73.341770591\n -0.565486678 73.782288942\n -0.502654825 73.798919906\n -0.439822972 73.492888665\n -0.376991118 72.894857061\n -0.314159265 71.987461820\n -0.251327412 70.728488151\n -0.188495559 69.146467681\n -0.125663706 67.446671799\n -0.062831853 65.956785080\n 0.000000000 64.971179394\n 0.062831853 64.663633248\n 0.125663706 65.074537022\n 0.188495559 66.121404383\n 0.251327412 67.611011033\n 0.314159265 69.256421414\n 0.376991118 70.732349878\n 0.439822972 71.800698101\n 0.502654825 72.407661155\n 0.565486678 72.624494355\n 0.628318531 72.537097227\n 0.691150384 72.204089074\n 0.753982237 71.659772174\n 0.816814090 70.924668103\n 0.879645943 70.019576761\n 0.942477796 68.988335136\n 1.005309649 67.921766503\n 1.068141502 66.960046596\n 1.130973355 66.262406182\n 1.193805208 65.962427998\n 1.256637061 66.132426908\n 1.319468915 66.763898118\n 1.382300768 67.761019377\n 1.445132621 68.948355234\n 1.507964474 70.106553986\n 1.570796327 71.045997263\n 1.633628180 71.674809036\n 1.696460033 71.993126538\n 1.759291886 72.036446551\n 1.822123739 71.837298556\n 1.884955592 71.418236576\n 1.947787445 70.797565506\n 2.010619298 69.998529405\n 2.073451151 69.062640531\n 2.136283004 68.065633223\n 2.199114858 67.124648570\n 2.261946711 66.384064279\n 2.324778564 65.982929557\n 2.387610417 66.019575044\n 2.450442270 66.524406784\n 2.513274123 67.442281324\n 2.576105976 68.624726713\n 2.638937829 69.844988856\n 2.701769682 70.863943019\n 2.764601535 71.531230372\n 2.827433388 71.819096603\n 2.890265241 71.759598900\n 2.953097094 71.384536533\n 3.015928947 70.714199472\n 3.078760801 69.769498624\n"} +{"text": "/*\n * Copyright (C) 2019. Uber Technologies\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage anotherpackage;\n\nimport static anotherpackage.DogTagTestUtil.getPreviousLineNumber;\nimport static com.google.common.truth.Truth.assertThat;\nimport static org.junit.Assert.fail;\n\nimport io.reactivex.rxjava3.core.Completable;\nimport io.reactivex.rxjava3.core.Flowable;\nimport io.reactivex.rxjava3.core.Maybe;\nimport io.reactivex.rxjava3.core.Observable;\nimport io.reactivex.rxjava3.core.Observer;\nimport io.reactivex.rxjava3.core.Single;\nimport io.reactivex.rxjava3.disposables.Disposable;\nimport io.reactivex.rxjava3.exceptions.CompositeException;\nimport io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException;\nimport io.reactivex.rxjava3.observers.TestObserver;\nimport io.reactivex.rxjava3.subjects.PublishSubject;\nimport java.util.Locale;\nimport java.util.concurrent.atomic.AtomicReference;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport rxdogtag2.RxDogTag;\nimport rxdogtag2.RxDogTagErrorReceiver;\nimport rxdogtag2.RxDogTagTaggedExceptionReceiver;\n\n/**\n * NOTE: These tests are a little odd. There are two conditions for them running correctly because\n * they verify via inspecting stacktraces. 1. the throwError() method MUST calculate the line number\n * immediately after subscribe (on the next line). 2. it must not be in the rxdogtag2 package\n * because that is filtered out in stacktrace inspection.\n */\npublic class DogTagObserverTest implements DogTagTest {\n\n @Rule public RxErrorsRule errorsRule = new RxErrorsRule();\n\n @Before\n public void setUp() {\n RxDogTag.install();\n }\n\n @After\n public void tearDown() {\n RxDogTag.reset();\n }\n\n @Test\n public void testObservable() {\n Exception original = new RuntimeException(\"Blah\");\n assertRewrittenStacktrace(subscribeError(Observable.error(original)), original);\n }\n\n @Test\n public void testFlowable() {\n Exception original = new RuntimeException(\"Blah\");\n assertRewrittenStacktrace(subscribeError(Flowable.error(original)), original);\n }\n\n @Test\n public void testSingle() {\n Exception original = new RuntimeException(\"Blah\");\n assertRewrittenStacktrace(subscribeError(Single.error(original)), original);\n }\n\n @Test\n public void testMaybe() {\n Exception original = new RuntimeException(\"Blah\");\n assertRewrittenStacktrace(subscribeError(Maybe.error(original)), original);\n }\n\n @Test\n public void testCompletable() {\n Exception original = new RuntimeException(\"Blah\");\n assertRewrittenStacktrace(subscribeError(Completable.error(original)), original);\n }\n\n @Test\n public void noConstructor_generatesStringFromStackElement_anonymous() {\n Exception originalError = new IllegalStateException(\"illegal state exception\");\n assertRewrittenStacktrace(\n throwError(new EmptyObserver() {}, originalError), originalError);\n }\n\n @Test\n public void noConstructor_generatesStringFromStackElement_instance() {\n Exception originalError = new IllegalStateException(\"illegal state exception\");\n Observer o = new EmptyObserver() {};\n assertRewrittenStacktrace(throwError(o, originalError), originalError);\n }\n\n @Test\n public void noConstructor_generatesStringFromStackElement_subclass() {\n Exception originalError = new IllegalStateException(\"illegal state exception\");\n Another o = new Another();\n assertRewrittenStacktrace(throwError(o, originalError), originalError);\n }\n\n @Test\n public void observerWithErrorHandling_ignoredByRxDogTag() {\n Exception originalError = new IllegalStateException(\"illegal state exception\");\n // Test observer which custom error handling.\n TestObserver testObserver = Observable.error(originalError).test();\n // No errors intercepted by RxDogTag.\n errorsRule.assertNoErrors();\n\n testObserver.assertError(\n (error) -> {\n assertThat(error).isNotInstanceOf(OnErrorNotImplementedException.class);\n assertThat(error).hasMessageThat().isEqualTo(originalError.getMessage());\n assertThat(error.getStackTrace()).isNotEmpty();\n return true;\n });\n }\n\n @Test\n public void nullOriginErrorMessage_replacedWithEmptyString() {\n Exception originalError = new IllegalStateException();\n int expectedLineNumber = subscribeError(Observable.error(originalError));\n\n Throwable e = errorsRule.take();\n assertThat(e).isInstanceOf(OnErrorNotImplementedException.class);\n // Original error message was null. Now replaced by empty string\n assertThat(e).hasMessageThat().isNotEqualTo(originalError.getMessage());\n assertThat(e).hasMessageThat().isEqualTo(\"\");\n\n assertThat(e.getStackTrace()).isEmpty();\n Throwable cause = e.getCause();\n assertThat(cause.getStackTrace()[0].getFileName())\n .isEqualTo(getClass().getSimpleName() + \".java\");\n assertThat(cause.getStackTrace()[0].getLineNumber()).isEqualTo(expectedLineNumber);\n assertThat(cause.getStackTrace()[1].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_SOURCE_HEADER);\n assertThat(cause.getStackTrace()[2].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_TRACE_HEADER);\n }\n\n @Test\n public void compositeException() {\n IllegalStateException original = new IllegalStateException(\"Initial exception\");\n RuntimeException runtimeException = new RuntimeException(\"Resulting exception\");\n\n CompositeException compositeException = new CompositeException(original, runtimeException);\n int expectedLineNumber = subscribeError(Observable.error(compositeException));\n\n assertRewrittenStacktrace(expectedLineNumber, compositeException);\n }\n\n @Test\n public void mangledCompositeException() {\n Observable mainObservable =\n Observable.concatDelayError(\n withError(\n Observable.just(\n withError(\n withError(Observable.just(1), new RuntimeException(\"1\")),\n new RuntimeException(\"2\"))),\n new RuntimeException(\"3\")));\n\n int expectedLineNumber = subscribeError(mainObservable);\n Throwable e = errorsRule.take();\n assertThat(e).isInstanceOf(OnErrorNotImplementedException.class);\n assertThat(e).hasMessageThat().isEqualTo(\"2 exceptions occurred. \"); // For composite exception\n assertThat(e.getStackTrace()).isEmpty();\n Throwable cause = e.getCause();\n assertThat(cause.getStackTrace()[0].getFileName())\n .isEqualTo(getClass().getSimpleName() + \".java\");\n assertThat(cause.getStackTrace()[0].getLineNumber()).isEqualTo(expectedLineNumber);\n assertThat(cause.getStackTrace()[1].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_SOURCE_HEADER);\n assertThat(cause.getStackTrace()[2].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_TRACE_HEADER);\n }\n\n @Test\n public void errorReceiver_noGuards() {\n RxDogTag.reset();\n RxDogTag.builder().guardObserverCallbacks(false).install();\n AtomicReference recordedError = new AtomicReference<>();\n TestErrorReceiver o =\n new TestErrorReceiver() {\n @Override\n public void onError(Throwable e) {\n recordedError.compareAndSet(null, e);\n }\n\n @Override\n public void onSubscribe(Disposable d) {}\n\n @Override\n public void onNext(Integer integer) {}\n\n @Override\n public void onComplete() {}\n };\n Exception original = new RuntimeException(\"Blah\");\n Observable.error(original).subscribe(o);\n Throwable recorded = recordedError.get();\n assertThat(recorded).isSameInstanceAs(original);\n }\n\n @Test\n public void errorReceiver_withGuard_noException() {\n RxDogTag.reset();\n RxDogTag.builder().guardObserverCallbacks(true).install();\n AtomicReference recordedError = new AtomicReference<>();\n TestErrorReceiver o =\n new TestErrorReceiver() {\n @Override\n public void onError(Throwable e) {\n recordedError.compareAndSet(null, e);\n }\n\n @Override\n public void onSubscribe(Disposable d) {}\n\n @Override\n public void onNext(Integer integer) {}\n\n @Override\n public void onComplete() {}\n };\n Exception original = new RuntimeException(\"Blah\");\n Observable.error(original).subscribe(o);\n Throwable recorded = recordedError.get();\n assertThat(recorded).isSameInstanceAs(original);\n }\n\n @Test\n public void errorReceiver_withGuard_withException() {\n RxDogTag.reset();\n RxDogTag.builder().guardObserverCallbacks(true).install();\n AtomicReference thrownException = new AtomicReference<>();\n TestErrorReceiver o =\n new TestErrorReceiver() {\n @Override\n public void onError(Throwable e) {\n RuntimeException toThrow = new RuntimeException(e);\n thrownException.compareAndSet(null, toThrow);\n throw toThrow;\n }\n\n @Override\n public void onSubscribe(Disposable d) {}\n\n @Override\n public void onNext(Integer integer) {}\n\n @Override\n public void onComplete() {}\n };\n Exception original = new RuntimeException(\"Blah\");\n PublishSubject subject = PublishSubject.create();\n // Can't do this one synchronously because it will fail in subscribe();\n subject.subscribe(o);\n int lineNumber = getPreviousLineNumber();\n subject.onError(original);\n Throwable recorded = errorsRule.take();\n Throwable thrown = thrownException.get();\n if (thrown == null) {\n // Partially more descriptive error message, partially to make NullAway happy since it doesn't\n // speak truth's isNotNull() assertions\n fail(\"thrown was null! This means the observer's onError was never called\");\n return;\n }\n assertThat(thrown).hasCauseThat().isSameInstanceAs(original);\n assertThat(recorded).isInstanceOf(OnErrorNotImplementedException.class);\n assertThat(recorded).hasCauseThat().isSameInstanceAs(thrown);\n // The original cause was put in this\n assertThat(recorded).hasMessageThat().contains(\"java.lang.RuntimeException: Blah\");\n\n // Slightly duplicated, but this is a special delegates case for onError\n Throwable cause = recorded.getCause();\n assertThat(cause).isNotNull();\n assertThat(cause.getStackTrace()[0].getFileName())\n .isEqualTo(getClass().getSimpleName() + \".java\");\n assertThat(cause.getStackTrace()[0].getLineNumber()).isEqualTo(lineNumber);\n assertThat(cause.getStackTrace()[1].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_SOURCE_HEADER);\n assertThat(cause.getStackTrace()[2].getClassName())\n .isEqualTo(String.format(Locale.US, RxDogTag.STACK_ELEMENT_SOURCE_DELEGATE, \"onError\"));\n assertThat(cause.getStackTrace()[3].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_TRACE_HEADER);\n }\n\n @Test\n public void taggedErrorReceiver() {\n AtomicReference recordedError = new AtomicReference<>();\n TestTaggedErrorReceiver o =\n new TestTaggedErrorReceiver() {\n @Override\n public void onError(Throwable e) {\n recordedError.compareAndSet(null, e);\n }\n\n @Override\n public void onSubscribe(Disposable d) {}\n\n @Override\n public void onNext(Integer integer) {}\n\n @Override\n public void onComplete() {}\n };\n Exception original = new RuntimeException(\"Blah\");\n Observable.error(original).subscribe(o);\n int lineNumber = getPreviousLineNumber();\n Throwable recorded = recordedError.get();\n if (recorded == null) {\n fail(\"No exception recorded!\");\n } else {\n assertRewrittenStacktrace(lineNumber, original, recorded);\n }\n }\n\n private interface TestTaggedErrorReceiver\n extends RxDogTagTaggedExceptionReceiver, Observer {}\n\n private interface TestErrorReceiver extends RxDogTagErrorReceiver, Observer {}\n\n /** This tests that the original stacktrace was rewritten with the relevant source information. */\n private void assertRewrittenStacktrace(int expectedLineNumber, Throwable original) {\n Throwable e = errorsRule.take();\n assertRewrittenStacktrace(expectedLineNumber, original, e);\n }\n /** This tests that the original stacktrace was rewritten with the relevant source information. */\n private void assertRewrittenStacktrace(\n int expectedLineNumber, Throwable original, Throwable recorded) {\n assertThat(recorded).isInstanceOf(OnErrorNotImplementedException.class);\n assertThat(recorded).hasMessageThat().isEqualTo(original.getMessage());\n assertThat(recorded.getStackTrace()).isEmpty();\n Throwable cause = recorded.getCause();\n assertThat(cause.getStackTrace()[0].getFileName())\n .isEqualTo(getClass().getSimpleName() + \".java\");\n assertThat(cause.getStackTrace()[0].getLineNumber()).isEqualTo(expectedLineNumber);\n assertThat(cause.getStackTrace()[1].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_SOURCE_HEADER);\n assertThat(cause.getStackTrace()[2].getClassName())\n .isEqualTo(RxDogTag.STACK_ELEMENT_TRACE_HEADER);\n }\n\n private static int subscribeError(Completable completable) {\n completable.subscribe();\n return getPreviousLineNumber();\n }\n\n private static int subscribeError(Observable observable) {\n observable.subscribe();\n return getPreviousLineNumber();\n }\n\n private static int subscribeError(Maybe maybe) {\n maybe.subscribe();\n return getPreviousLineNumber();\n }\n\n private static int subscribeError(Single single) {\n single.subscribe();\n return getPreviousLineNumber();\n }\n\n private static int subscribeError(Flowable flowable) {\n flowable.subscribe();\n return getPreviousLineNumber();\n }\n\n private static int throwError(Observer observer, Exception error) {\n Observable.defer(() -> Observable.error(error)).subscribe(observer);\n return getPreviousLineNumber();\n }\n\n private static Observable withError(Observable source, Exception exception) {\n return source.concatWith(Observable.error(exception));\n }\n\n private static class Another extends EmptyObserver {\n\n @Override\n public void onNext(Object unit) {}\n }\n}\n"} +{"text": "Android N引入了一种包含编译、解释和JIT(Just In Time)的混合运行时,以便在安装时间、内存占用、电池消耗和性能之间获得最好的折衷。\n\nART是在Android KitKat(译者注:Android 4.0)引入并在Lollipop(译者注:Android 5.0)中设为默认解决方案的主要特性之一,是当时的一种新的运行时。ART取代了Dalvik,但是前者与后者仍然保持了字节码级的兼容,因为前者仍在运行DEX文件。ART的主要特征之一就是安装时对应用的AOT编译。这种方式的主要优点就是优化产生的本地代码性能更好,执行起来需要更少的电量。劣势在于安装文件所需的空间和时间。在Lollipop和Marshmallow(译者注:Android 6.0)中,大的应用需要数分钟才能安装完。\n\nAndroid N包含了一个混合模式的运行时。应用在安装时不做编译,而是解释字节码,所以可以快速启动。ART中有一种新的、更快的解释器,通过一种新的JIT完成,但是这种JIT的信息不是持久化的。取而代之的是,代码在执行期间被分析,分析结果保存起来。然后,当设备空转和充电的时候,ART会执行针对“热代码”进行的基于分析的编译,其他代码不做编译。为了得到更优的代码,ART采用了几种技巧包括深度内联。\n\n对同一个应用可以编译数次,或者找到变“热”的代码路径或者对已经编译的代码进行新的优化,这取决于分析器在随后的执行中的分析数据。这个步骤仍被简称为AOT,可以理解为“全时段的编译”(All-Of-the-Time compilation)。\n\n这种混合使用AOT、解释、JIT的策略的全部优点如下。\n\n- 即使是大应用,安装时间也能缩短到几秒\n- 系统升级能更快地安装,因为不再需要优化这一步\n- 应用的内存占用更小,有些情况下可以降低50%\n- 改善了性能\n- 更低的电池消耗\n\n[原文](https://www.jianshu.com/p/8d3701e3ee94)"} +{"text": " 'https://api.cognitive.microsoft.com/sts/v1.0/issueToken'\n );\n\n /**\n * @var string\n */\n public $class_load = Constants_Engines::MICROSOFT_HUB;\n\n\n /**\n * @var array\n */\n public $extra_parameters = array(\n 'token' => null,\n 'token_endlife' => 0,\n 'client_id' => \"\",\n 'client_secret' => \"\",\n 'category' => \"\",\n );\n\n /**\n * @var int\n */\n public $google_api_compliant_version = 2;\n\n /**\n * @var int\n */\n public $penalty = 14;\n\n /**\n * An empty struct\n * @return EnginesModel_EngineStruct\n */\n public static function getStruct() {\n return new EnginesModel_MicrosoftHubStruct();\n }\n\n}"} +{"text": "from utils import *\n\n\ndef test_anima_golem():\n\tgame = prepare_game()\n\tanima = game.player1.give(\"GVG_077\")\n\tanima.play()\n\twisp1 = game.player1.summon(WISP)\n\twisp2 = game.player2.summon(WISP)\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tassert not anima.dead\n\twisp1.destroy()\n\tgame.end_turn()\n\n\tassert anima.dead\n\tassert not wisp2.dead\n\tgame.end_turn()\n\n\ndef test_ancestors_call():\n\tgame = prepare_game()\n\tgame.player1.discard_hand()\n\tgame.player2.discard_hand()\n\tnovice = game.player1.give(\"EX1_015\")\n\twisp = game.player2.give(WISP)\n\tcall = game.player1.give(\"GVG_029\")\n\tcall.play()\n\tassert novice in game.player1.field\n\tassert wisp in game.player2.field\n\tassert not game.player1.hand\n\tassert not game.player2.hand\n\n\ndef test_blingtron_3000():\n\tgame = prepare_game()\n\tblingtron = game.player1.give(\"GVG_119\")\n\tblingtron.play()\n\tassert game.player1.weapon\n\tassert game.player2.weapon\n\n\ndef test_bolvar_fordragon():\n\tgame = prepare_game()\n\tbolvar = game.player1.give(\"GVG_063\")\n\tassert bolvar.atk == 1\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tgame.player1.give(MOONFIRE).play(target=wisp)\n\tassert bolvar.atk == 2\n\tassert bolvar.buffs\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tgame.player1.give(MOONFIRE).play(target=wisp)\n\tassert bolvar.atk == 3\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tassert bolvar.atk == 3\n\tassert bolvar.buffs\n\tbolvar.play()\n\tassert bolvar.atk == 3\n\tassert bolvar.buffs\n\t# game.player1.give(DREAM).play(target=bolvar)\n\t# assert bolvar.atk == 1\n\t# assert not bolvar.buffs\n\n\ndef test_bomb_lobber():\n\tgame = prepare_game()\n\tlobber1 = game.player1.give(\"GVG_099\")\n\tlobber1.play()\n\tassert game.player2.hero.health == 30\n\tgame.end_turn()\n\n\twisp = game.player2.give(WISP)\n\twisp.play()\n\tstatue = game.player2.give(ANIMATED_STATUE)\n\tstatue.play()\n\tgame.end_turn()\n\n\tlobber2 = game.player1.give(\"GVG_099\")\n\tlobber2.play()\n\tassert wisp.dead ^ (statue.health == 10 - 4)\n\n\ndef test_bouncing_blade():\n\tgame = prepare_game()\n\tacolyte = game.player1.give(\"EX1_007\")\n\tacolyte.play()\n\tgame.player1.discard_hand()\n\tgame.player1.give(\"GVG_050\").play()\n\tassert acolyte.dead\n\tassert len(game.player1.hand) == 3\n\n\twisp1 = game.player1.summon(WISP)\n\twisp2 = game.player2.summon(WISP)\n\tgame.player1.give(\"GVG_050\").play()\n\tassert wisp1.dead ^ wisp2.dead\n\n\ndef test_bouncing_blade_commanding_shout():\n\tgame = prepare_game()\n\tacolyte = game.player1.give(\"EX1_007\")\n\tacolyte.play()\n\tshout = game.player1.give(\"NEW1_036\")\n\tshout.play()\n\tgame.player1.discard_hand()\n\tassert acolyte.min_health == 1\n\tblade = game.player1.give(\"GVG_050\")\n\tblade.play()\n\tassert acolyte.health == 1\n\tassert acolyte.zone == Zone.PLAY\n\tassert len(game.player1.hand) == 2\n\n\ndef test_crackle():\n\tgame = prepare_game()\n\tcrackle = game.player1.give(\"GVG_038\")\n\tcrackle.play(target=game.player2.hero)\n\tassert game.player2.hero.health in (24, 25, 26, 27)\n\tassert game.player1.overloaded == 1\n\n\ndef test_crackle_malygos():\n\tgame = prepare_game()\n\tmalygos = game.player1.give(\"EX1_563\")\n\tmalygos.play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tcrackle = game.player1.give(\"GVG_038\")\n\tcrackle.play(target=game.player2.hero)\n\tassert game.player2.hero.health in (19, 20, 21, 22)\n\tassert game.player1.overloaded == 1\n\n\ndef test_crush():\n\tgame = prepare_game()\n\tcrush = game.player1.give(\"GVG_052\")\n\tassert crush.cost == 7\n\ttoken = game.player1.give(SPELLBENDERT)\n\ttoken.play()\n\tassert crush.cost == 7\n\tgame.player1.give(MOONFIRE).play(token)\n\tassert crush.cost == 3\n\ttoken.destroy()\n\tassert crush.cost == 7\n\n\ndef test_cobalt_guardian():\n\tgame = prepare_game()\n\tcobalt = game.player1.give(\"GVG_062\")\n\tcobalt.play()\n\tassert not cobalt.divine_shield\n\tgame.player1.give(TARGET_DUMMY).play()\n\tassert cobalt.divine_shield\n\tgame.player1.give(TARGET_DUMMY).play()\n\tassert cobalt.divine_shield\n\n\ndef test_cogmaster():\n\tgame = prepare_game()\n\tcogmaster = game.player1.give(\"GVG_013\")\n\tcogmaster.play()\n\tassert cogmaster.atk == 1\n\tdummy = game.player1.give(TARGET_DUMMY)\n\tdummy.play()\n\tassert cogmaster.atk == 3\n\thumility = game.player1.give(\"EX1_360\")\n\thumility.play(target=cogmaster)\n\tassert cogmaster.atk == 3\n\tdummy.destroy()\n\tassert cogmaster.atk == 1\n\tgame.player1.give(TARGET_DUMMY).play()\n\tassert cogmaster.atk == 3\n\tblessedchamp = game.player1.give(\"EX1_355\")\n\tblessedchamp.play(target=cogmaster)\n\tassert cogmaster.atk == 4\n\n\ndef test_cogmasters_wrench():\n\tgame = prepare_game()\n\twrench = game.player1.summon(\"GVG_024\")\n\tassert wrench.atk == game.player1.hero.atk == 1\n\tdummy = game.player1.give(TARGET_DUMMY)\n\tdummy.play()\n\tassert wrench.atk == game.player1.hero.atk == 3\n\tdummy.destroy()\n\tassert wrench.atk == game.player1.hero.atk == 1\n\n\ndef test_dr_boom():\n\tgame = prepare_game()\n\tboom = game.player1.give(\"GVG_110\")\n\tassert len(game.player1.field) == 0\n\tboom.play()\n\tassert len(game.player1.field) == 3\n\tassert len(game.player1.field.filter(id=\"GVG_110t\")) == 2\n\t# Whirlwind the board\n\tgame.player1.give(\"EX1_400\").play()\n\tassert (30 - 2) >= game.player2.hero.health >= (30 - 8)\n\n\ndef test_druid_of_the_fang():\n\tgame = prepare_game()\n\tfang = game.player1.give(\"GVG_080\")\n\tassert not fang.powered_up\n\tfang.play()\n\tassert not fang.powered_up\n\tassert not fang.morphed\n\tassert fang in game.player1.field\n\tassert fang.id == \"GVG_080\"\n\tassert fang.atk == 4\n\tassert fang.health == 4\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tfang2 = game.player1.give(\"GVG_080\")\n\tassert not fang2.powered_up\n\tgame.player1.give(CHICKEN).play()\n\tassert fang2.powered_up\n\tfang2.play()\n\tdruid2 = fang2.morphed\n\tassert druid2 in game.player1.field\n\tassert druid2.id == \"GVG_080t\"\n\tassert druid2.atk == 7\n\tassert druid2.health == 7\n\tassert druid2.race == Race.BEAST\n\n\ndef test_echo_of_medivh():\n\tgame = prepare_game()\n\tgame.player1.give(WISP).play()\n\tgame.player1.give(WISP).play()\n\tgame.player1.give(TARGET_DUMMY).play()\n\tgame.player1.give(GOLDSHIRE_FOOTMAN).play()\n\tgame.end_turn()\n\tgame.player2.give(SPELLBENDERT).play()\n\tgame.end_turn()\n\tgame.player1.discard_hand()\n\techo = game.player1.give(\"GVG_005\")\n\techo.play()\n\tassert game.player1.hand == [WISP, WISP, TARGET_DUMMY, GOLDSHIRE_FOOTMAN]\n\tassert len(game.player1.field) == 4\n\n\ndef test_fel_cannon():\n\tgame = prepare_game()\n\tcannon = game.player1.give(\"GVG_020\")\n\tcannon.play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tassert game.player1.hero.health == game.player2.hero.health == 30\n\tassert cannon.health == 5\n\n\tdummy1 = game.player1.give(TARGET_DUMMY)\n\tdummy1.play()\n\tgame.end_turn()\n\n\tdummy2 = game.player2.give(TARGET_DUMMY)\n\tdummy2.play()\n\twisp = game.player2.give(WISP)\n\twisp.play()\n\tgame.end_turn()\n\n\tassert not wisp.dead\n\tgame.end_turn()\n\n\tassert dummy1.health == dummy2.health == 2\n\tassert not dummy1.dead\n\tassert not dummy2.dead\n\tassert wisp.dead\n\n\ndef test_fel_reaver():\n\tgame = prepare_game()\n\texpected_size = len(game.player1.deck)\n\tfelreaver = game.player1.give(\"GVG_016\")\n\tfelreaver.play()\n\tgame.end_turn()\n\n\tfor i in range(5):\n\t\tgame.player2.give(WISP).play()\n\t\texpected_size -= 3\n\t\tassert len(game.player1.deck) == expected_size\n\t\tassert len(game.player2.deck) == 25\n\n\ndef test_floating_watcher():\n\tgame = prepare_game(CardClass.WARLOCK, CardClass.WARLOCK)\n\twatcher = game.player1.give(\"GVG_100\")\n\twatcher.play()\n\tassert watcher.atk == watcher.health == 4\n\tgame.player1.give(MOONFIRE).play(target=game.player2.hero)\n\tassert watcher.atk == watcher.health == 4\n\tgame.player1.give(MOONFIRE).play(target=game.player1.hero)\n\tassert watcher.atk == watcher.health == 4 + 2\n\tgame.player1.hero.power.use()\n\tassert watcher.atk == watcher.health == 4 + 4\n\n\ndef test_floating_watcher_armor():\n\tgame = prepare_game()\n\twatcher = game.player1.give(\"GVG_100\")\n\twatcher.play()\n\tshieldblock = game.player1.give(\"EX1_606\")\n\tshieldblock.play()\n\tassert watcher.atk == watcher.health == 4\n\tassert game.player1.hero.armor == 5\n\tassert not game.player1.hero.damaged\n\tflameimp = game.player1.give(\"EX1_319\")\n\tflameimp.play()\n\tassert watcher.atk == watcher.health == 6\n\tassert game.player1.hero.armor == 2\n\tassert not game.player1.hero.damaged\n\n\ndef test_gahzrilla():\n\tgame = prepare_game()\n\tgahz = game.player1.give(\"GVG_049\")\n\tgahz.play()\n\tassert gahz.atk == 6\n\tgame.player1.give(MOONFIRE).play(target=gahz)\n\tassert gahz.atk == 6 * 2\n\ttimberwolf = game.player1.give(\"DS1_175\")\n\ttimberwolf.play()\n\tassert gahz.atk == (6 * 2) + 1\n\t# TODO: Buffs are always taken into account at the end\n\t# game.player1.give(MOONFIRE).play(target=gahz)\n\t# assert gahz.atk == (6*2*2) + 1\n\n\ndef test_gallywix():\n\tgame = prepare_game()\n\tgallywix = game.player1.give(\"GVG_028\")\n\tgallywix.play()\n\tgame.end_turn()\n\n\tgame.player1.discard_hand()\n\tgame.player2.discard_hand()\n\tgame.player2.give(\"CS2_029\").play(target=game.player1.hero)\n\tassert len(game.player1.hand) == 1\n\tassert game.player1.hand[0].id == \"CS2_029\"\n\tassert len(game.player2.hand) == 1\n\tassert game.player2.hand[0].id == \"GVG_028t\"\n\tgame.player2.hand[0].play()\n\tassert game.player2.temp_mana == 1\n\tassert len(game.player2.hand) == 0\n\n\ndef test_gazlowe():\n\tgame = prepare_empty_game()\n\tgame.player1.discard_hand()\n\tgazlowe = game.player1.give(\"GVG_117\")\n\tgazlowe.play()\n\tassert len(game.player1.hand) == 0\n\tsmite = game.player1.give(\"CS1_130\")\n\tassert smite.cost == 1\n\tsmite.play(target=gazlowe)\n\tassert len(game.player1.hand) == 1\n\tassert game.player1.hand[0].race == Race.MECHANICAL\n\n\ndef test_gazlowe_preparation():\n\tgame = prepare_empty_game()\n\tgame.player1.give(\"GVG_117\").play()\n\tdrainlife = game.player1.give(\"CS2_061\")\n\tassert drainlife.cost == 3\n\tgame.player1.give(\"EX1_145\").play()\n\tassert drainlife.cost == 1\n\tdrainlife.play(target=game.player2.hero)\n\tassert len(game.player1.hand) == 1\n\tassert game.player1.hand[0].race == Race.MECHANICAL\n\n\ndef test_gnomish_experimenter():\n\tgame = prepare_empty_game()\n\twisp = game.player1.give(WISP)\n\twisp.shuffle_into_deck()\n\tgnomish = game.player1.give(\"GVG_092\")\n\tgnomish.play()\n\tassert len(game.player1.hand) == 1\n\tassert wisp.morphed\n\tassert wisp.morphed.id == \"GVG_092t\"\n\tassert wisp.morphed in game.player1.hand\n\n\tgnomish2 = game.player1.give(\"GVG_092\")\n\tgnomish2.play()\n\tassert len(game.player1.hand) == 1\n\n\ndef test_goblin_blastmage():\n\tgame = prepare_game()\n\tblastmage1 = game.player1.give(\"GVG_004\")\n\tassert not blastmage1.powered_up\n\tassert game.player1.hero.health == 30\n\tblastmage1.play()\n\tassert game.player1.hero.health == 30\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tblastmage2 = game.player1.give(\"GVG_004\")\n\tassert not blastmage2.powered_up\n\tclockwork = game.player1.give(\"GVG_082\")\n\tclockwork.play()\n\tassert clockwork.race == Race.MECHANICAL\n\tassert blastmage2.powered_up\n\tblastmage2.play()\n\tassert game.player2.hero.health == 30 - 4\n\tgame.end_turn()\n\tgame.end_turn()\n\n\ndef test_grove_tender():\n\tgame = prepare_game(game_class=Game)\n\tfor i in range(3):\n\t\tgame.end_turn()\n\t\tgame.end_turn()\n\n\tassert game.player1.max_mana == 4\n\tassert game.player2.max_mana == 3\n\tgrovetender1 = game.player1.give(\"GVG_032\")\n\tgrovetender1.play(choose=\"GVG_032a\")\n\tassert game.player1.max_mana == 5\n\tassert game.player2.max_mana == 4\n\tassert game.player1.mana == 2\n\tassert game.player1.used_mana == 3\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tgame.player1.discard_hand()\n\tgame.player2.discard_hand()\n\tgrovetender2 = game.player1.give(\"GVG_032\")\n\tgrovetender2.play(choose=\"GVG_032b\")\n\tassert len(game.player1.hand) == 1\n\tassert len(game.player2.hand) == 1\n\n\tassert game.player1.max_mana == 6\n\tassert game.player2.max_mana == 5\n\tgame.player1.discard_hand()\n\tgame.player2.discard_hand()\n\tgame.player1.summon(FANDRAL_STAGHELM)\n\tgame.player1.give(\"GVG_032\").play()\n\tassert game.player1.max_mana == 7\n\tassert game.player2.max_mana == 6\n\tassert game.player1.mana == 6 - 3 - 3 + 1\n\tassert game.player1.used_mana == 3 + 3\n\n\ndef test_hobgoblin():\n\tgame = prepare_game()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tassert wisp.atk == 1\n\tassert wisp.health == 1\n\thobgoblin = game.player1.give(\"GVG_104\")\n\thobgoblin.play()\n\n\twolf1 = game.player1.give(\"DS1_175\")\n\twolf1.play()\n\tassert wolf1.atk == 3\n\tassert wolf1.health == 3\n\n\twolf2 = game.player1.give(\"DS1_175\")\n\twolf2.play()\n\tassert wolf1.atk == 4\n\tassert wolf1.health == 3\n\tassert wolf2.atk == 4\n\tassert wolf2.health == 3\n\n\tloothoarder = game.player1.give(\"EX1_096\")\n\tloothoarder.play()\n\tassert not loothoarder.buffs\n\tassert loothoarder.atk == 2\n\tassert loothoarder.health == 1\n\n\t# TODO: Test faceless-hobgoblin interaction\n\t# assert wisp.health == 1\n\t# assert wisp.atk == 1\n\t# faceless = game.player1.give(\"EX1_564\")\n\t# faceless.play(target=wisp)\n\t# assert not faceless.buffs\n\t# assert faceless.atk == 1\n\t# assert faceless.health == 1\n\n\ndef test_implosion():\n\tgame = prepare_game()\n\tstatue = game.player1.give(ANIMATED_STATUE)\n\tstatue.play()\n\tgame.end_turn()\n\n\timplosion = game.player2.give(\"GVG_045\")\n\timplosion.play(target=statue)\n\tstatue.damage in (2, 3, 4)\n\tassert len(game.player2.field) == statue.damage\n\tassert game.player2.field.contains(\"GVG_045t\")\n\n\ndef test_implosion_commanding_shout():\n\tgame = prepare_game()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tshout = game.player1.give(\"NEW1_036\")\n\tshout.play()\n\timplosion = game.player1.give(\"GVG_045\")\n\timplosion.play(target=wisp)\n\tassert not wisp.dead\n\tassert len(game.player1.field) in (3, 4, 5)\n\n\ndef test_implosion_divine_shield():\n\tgame = prepare_game()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tgame.player1.give(HAND_OF_PROTECTION).play(target=wisp)\n\tassert wisp.divine_shield\n\timplosion = game.player1.give(\"GVG_045\")\n\timplosion.play(target=wisp)\n\tassert not wisp.dead\n\tassert not wisp.divine_shield\n\tassert len(game.player1.field) == 1\n\n\ndef test_iron_juggernaut():\n\tgame = prepare_empty_game()\n\tgame.player2.discard_hand()\n\tjuggernaut = game.player1.give(\"GVG_056\")\n\tassert len(game.player2.deck) == 0\n\tjuggernaut.play()\n\n\tassert game.player2.hero.health == 30\n\tassert len(game.player2.deck) == 1\n\tassert len(game.player2.hand) == 0\n\tgame.end_turn()\n\tassert game.player2.hero.health == 20\n\tassert len(game.player2.deck) == 0\n\tassert len(game.player2.hand) == 0\n\n\ndef test_jeeves():\n\tgame = prepare_game()\n\tgame.player1.discard_hand()\n\tjeeves = game.player1.give(\"GVG_094\")\n\tjeeves.play()\n\tassert len(game.player1.hand) == 0\n\tgame.end_turn()\n\n\tassert len(game.player1.hand) == 3\n\n\ndef test_light_of_the_naaru():\n\tgame = prepare_game()\n\tnaaru1 = game.player1.give(\"GVG_012\")\n\tnaaru2 = game.player1.give(\"GVG_012\")\n\tnaaru3 = game.player1.give(\"GVG_012\")\n\tassert game.player1.hero.health == 30\n\tnaaru1.play(target=game.player1.hero)\n\tassert not game.player1.field\n\tassert game.player1.hero.health == 30\n\n\tgame.player1.give(MOONFIRE).play(target=game.player1.hero)\n\tassert game.player1.hero.health == 29\n\tnaaru2.play(target=game.player1.hero)\n\tassert not game.player1.field\n\tassert game.player1.hero.health == 30\n\n\tfor i in range(5):\n\t\tgame.player1.give(MOONFIRE).play(target=game.player1.hero)\n\tassert game.player1.hero.health == 25\n\tnaaru3.play(target=game.player1.hero)\n\tassert len(game.player1.field) == 1\n\tassert game.player1.field[0].id == \"EX1_001\"\n\tassert game.player1.hero.health == 28\n\n\ndef test_lightbomb():\n\tgame = prepare_game()\n\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tassert wisp.health == wisp.atk\n\n\tgame.player1.give(LIGHTS_JUSTICE).play()\n\tassert game.player1.hero.atk > 0\n\tassert game.player1.hero.health == 30\n\tgame.end_turn()\n\n\tdummy = game.player2.give(TARGET_DUMMY)\n\tdummy.play()\n\tassert dummy.health == 2\n\tassert dummy.atk == 0\n\n\tgoldshire = game.player2.give(GOLDSHIRE_FOOTMAN)\n\tgoldshire.play()\n\tassert goldshire.atk == 1\n\tassert goldshire.health == 2\n\tgame.end_turn()\n\n\tlightbomb = game.player1.give(\"GVG_008\")\n\tlightbomb.play()\n\tassert wisp.dead\n\tassert not dummy.dead\n\tassert dummy.health == 2\n\tassert goldshire.health == 1\n\tassert game.player1.hero.health == 30\n\n\ndef test_malganis():\n\tgame = prepare_game(CardClass.HUNTER, CardClass.HUNTER)\n\tvoidwalker = game.player1.give(\"CS2_065\")\n\tvoidwalker.play()\n\tmalganis = game.player1.give(\"GVG_021\")\n\tassert voidwalker.atk == 1\n\tassert voidwalker.health == 3\n\tmalganis.play()\n\tassert voidwalker.atk == 1 + 2\n\tassert voidwalker.health == 3 + 2\n\tassert game.player1.hero.immune\n\tgame.end_turn()\n\n\tgame.player2.hero.power.use()\n\tassert game.player1.hero.health == 30\n\tmalganis.destroy()\n\tassert voidwalker.atk == 1\n\tassert voidwalker.health == 3\n\n\ndef test_malorne():\n\tgame = prepare_empty_game()\n\tassert len(game.player1.deck) == 0\n\tgame.player1.give(\"GVG_035\")\n\n\tfor i in range(3):\n\t\tmalorne = game.player1.hand[0]\n\t\tassert malorne.id == \"GVG_035\"\n\t\tmalorne.play()\n\t\tassert len(game.player1.field) == 1\n\t\tassert len(game.player1.hand) == 0\n\t\tassert len(game.player1.deck) == 0\n\t\tmalorne.destroy()\n\t\tassert len(game.player1.field) == 0\n\t\tassert len(game.player1.deck) == 1\n\t\tassert len(game.player1.hand) == 0\n\t\tgame.end_turn()\n\t\tgame.end_turn()\n\n\t\tassert len(game.player1.field) == 0\n\t\tassert len(game.player1.deck) == 0\n\t\tassert len(game.player1.hand) == 1\n\n\ndef test_malorne_slam():\n\tgame = prepare_game()\n\tmalorne = game.player1.give(\"GVG_035\")\n\tmalorne.play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tgame.player1.discard_hand()\n\tfor _ in range(5):\n\t\tgame.player1.give(MOONFIRE).play(target=malorne)\n\tassert malorne.health == 2\n\tslam = game.player1.give(\"EX1_391\")\n\tslam.play(target=malorne)\n\tassert malorne.zone == Zone.DECK\n\tassert malorne in game.player1.deck\n\tassert not game.player1.hand\n\n\ndef test_mechwarper():\n\tgame = prepare_game()\n\tmechwarper = game.player1.give(\"GVG_006\")\n\tgoldshire = game.player1.give(GOLDSHIRE_FOOTMAN)\n\tharvest = game.player1.give(\"EX1_556\")\n\tclockwork = game.player1.give(\"GVG_082\")\n\tclockwork2 = game.player1.give(\"GVG_082\")\n\tassert harvest.cost == 3\n\tassert goldshire.cost == 1\n\tassert clockwork.cost == clockwork2.cost == 1\n\n\tmechwarper.play()\n\tassert harvest.cost == 3 - 1\n\tassert goldshire.cost == 1\n\tassert clockwork.cost == clockwork2.cost == 0\n\n\tclockwork.play()\n\tassert clockwork.cost == 1\n\n\tgame.player1.give(SILENCE).play(target=mechwarper)\n\tassert harvest.cost == 3\n\tassert goldshire.cost == 1\n\tassert clockwork.cost == clockwork2.cost == 1\n\n\tmechwarper.destroy()\n\tassert harvest.cost == 3\n\tassert goldshire.cost == 1\n\tassert clockwork.cost == clockwork2.cost == 1\n\n\ndef test_mekgineer_thermaplugg():\n\tgame = prepare_game()\n\tmekgineer = game.player1.give(\"GVG_116\")\n\tmekgineer.play()\n\n\tassert len(game.player1.field) == 1\n\tassert len(game.player2.field) == 0\n\twisp1 = game.player1.give(WISP)\n\twisp1.play()\n\tgame.player1.give(MOONFIRE).play(target=wisp1)\n\tassert wisp1.dead\n\tassert len(game.player1.field) == 1\n\tassert len(game.player2.field) == 0\n\tgame.end_turn()\n\n\twisp2 = game.player2.give(WISP)\n\twisp2.play()\n\tgame.player2.give(MOONFIRE).play(target=wisp2)\n\tassert wisp2.dead\n\tassert len(game.player1.field) == 2\n\tassert len(game.player1.field.filter(id=\"EX1_029\")) == 1\n\tassert len(game.player2.field) == 0\n\n\ndef test_metaltooth_leaper():\n\tgame = prepare_game()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tdummy = game.player1.give(TARGET_DUMMY)\n\tdummy.play()\n\tmetaltooth = game.player1.give(\"GVG_048\")\n\tmetaltooth.play()\n\tassert metaltooth.atk == 3\n\tassert metaltooth.health == 3\n\tassert wisp.atk == 1\n\tassert dummy.atk == 0 + 2\n\n\ndef test_micro_machine():\n\tgame = prepare_game()\n\tmicro = game.player1.give(\"GVG_103\")\n\tmicro.play()\n\tassert micro.atk == 1\n\tgame.end_turn()\n\n\tassert micro.atk == 2\n\tgame.end_turn()\n\n\tassert micro.atk == 3\n\tgame.end_turn()\n\n\tassert micro.atk == 4\n\n\ndef test_mimirons_head():\n\tgame = prepare_game()\n\thead = game.player1.give(\"GVG_111\")\n\thead.play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tassert not head.dead\n\tassert head.race == Race.MECHANICAL\n\tassert len(game.player1.field) == 1\n\tdummy1 = game.player1.give(TARGET_DUMMY)\n\tdummy1.play()\n\tdummy2 = game.player1.give(TARGET_DUMMY)\n\tdummy2.play()\n\tgame.end_turn()\n\n\tassert not head.dead\n\tassert len(game.player1.field) == 3\n\tgame.end_turn()\n\n\tassert head.dead\n\tassert len(game.player1.field) == 1\n\tvoltron = game.player1.field[0]\n\tassert voltron.id == \"GVG_111t\"\n\tassert voltron.windfury == 3\n\tassert voltron.charge\n\tfor i in range(4):\n\t\tassert voltron.can_attack()\n\t\tvoltron.attack(game.player2.hero)\n\tassert not voltron.can_attack()\n\n\ndef test_mimirons_head_full_board():\n\tgame = prepare_game()\n\thead = game.player1.give(\"GVG_111\")\n\thead.play()\n\tfor i in range(6):\n\t\tgame.player1.give(TARGET_DUMMY).play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tassert head.dead\n\tassert len(game.player1.field) == 1\n\tassert game.player1.field[0].id == \"GVG_111t\"\n\n\ndef test_mogor_the_ogre():\n\tgame = prepare_game()\n\tmogor = game.player1.give(\"GVG_112\").play()\n\tgame.end_turn()\n\n\twisp = game.player2.give(WISP).play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\twisp.attack(game.player1.hero)\n\tassert (\n\t\t(mogor.health == 5 and wisp.dead) ^\n\t\t(game.player1.hero.health == 29 and not wisp.dead)\n\t)\n\n\ndef test_neptulon():\n\tgame = prepare_game()\n\tgame.player1.discard_hand()\n\tgame.player2.discard_hand()\n\tassert len(game.player1.hand) == 0\n\tassert len(game.player2.hand) == 0\n\tgame.player1.give(\"GVG_042\").play()\n\tassert len(game.player1.hand) == 4\n\tassert len(game.player2.hand) == 0\n\tfor i in range(4):\n\t\tassert game.player1.hand[i].race == Race.MURLOC\n\tassert game.player1.overloaded == 3\n\n\ndef test_powermace():\n\tgame = prepare_game()\n\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tpowermace1 = game.player1.give(\"GVG_036\")\n\tpowermace1.play()\n\tassert wisp.atk == 1\n\tassert wisp.health == 1\n\tpowermace1.destroy()\n\tassert wisp.atk == 1\n\tassert wisp.health == 1\n\n\tdummy = game.player1.give(TARGET_DUMMY)\n\tdummy.play()\n\tpowermace2 = game.player1.give(\"GVG_036\")\n\tpowermace2.play()\n\tassert dummy.atk == 0\n\tassert dummy.health == 2\n\tpowermace2.destroy()\n\tassert dummy.atk == 0 + 2\n\tassert dummy.health == 2 + 2\n\n\ndef test_recombobulator():\n\tgame = prepare_game()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\trecom = game.player1.give(\"GVG_108\")\n\trecom.play(target=wisp)\n\n\tassert wisp not in game.player1.field\n\tassert game.player1.field[0].cost == 0\n\tassert game.player1.field[1] == recom\n\n\ndef test_recombobulator_molten_giant():\n\tgame = prepare_game()\n\tgame.player1.hero.set_current_health(15)\n\n\tmolten = game.player1.give(\"EX1_620\")\n\tassert molten.cost == 20 - 15\n\tmolten.play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\trecom = game.player1.give(\"GVG_108\")\n\trecom.play(target=molten)\n\trecom.destroy()\n\n\tassert molten not in game.player1.field\n\tassert game.player1.field[0].cost == molten.cost\n\n\ndef test_reversing_switch():\n\tgame = prepare_game()\n\tswitch = game.player1.give(\"PART_006\")\n\tgoldshire = game.player1.give(GOLDSHIRE_FOOTMAN)\n\tgoldshire.play()\n\tgame.end_turn()\n\tgame.end_turn()\n\n\tswitch.play(goldshire)\n\tassert goldshire.atk == 2\n\n\ndef test_sabotage():\n\tgame = prepare_game()\n\tsabotage = game.player1.give(\"GVG_047\")\n\tsabotage.play()\n\n\tsabotage2 = game.player1.give(\"GVG_047\")\n\tsabotage2.play()\n\tgame.end_turn()\n\n\tweapon = game.player2.give(LIGHTS_JUSTICE)\n\tweapon.play()\n\twisp = game.player2.give(WISP)\n\twisp.play()\n\tgame.end_turn()\n\n\tsabotage3 = game.player1.give(\"GVG_047\")\n\tsabotage3.play()\n\tassert not weapon.dead\n\tassert wisp.dead\n\n\tsabotage4 = game.player1.give(\"GVG_047\")\n\tsabotage4.play()\n\tassert weapon.dead\n\n\ndef test_siege_engine():\n\tgame = prepare_game(CardClass.WARRIOR, CardClass.WARRIOR)\n\tengine = game.player1.give(\"GVG_086\")\n\tengine.play()\n\tassert engine.atk == 5\n\tgame.player1.hero.power.use()\n\tassert game.player1.hero.armor == 2\n\tassert engine.atk == 6\n\tgame.end_turn()\n\tgame.player2.hero.power.use()\n\tassert engine.atk == 6\n\tgame.end_turn()\n\n\t# Shield Block\n\tgame.player1.give(\"EX1_606\").play()\n\tassert game.player1.hero.armor == 7\n\tassert engine.atk == 7\n\n\ndef test_screwjank_clunker():\n\tgame = prepare_game()\n\tscrewjank = game.player1.give(\"GVG_055\")\n\tassert not screwjank.targets\n\tscrewjank.play()\n\n\tscrewjank2 = game.player1.give(\"GVG_055\")\n\tassert screwjank2.targets == [screwjank]\n\tscrewjank2.play(target=screwjank)\n\tassert screwjank.atk == 2 + 2\n\tassert screwjank.health == 5 + 2\n\n\ndef test_siltfin_spiritwalker():\n\tgame = prepare_game()\n\tgame.player1.discard_hand()\n\tsiltfin = game.player1.give(\"GVG_040\")\n\tsiltfin.play()\n\tmurloc = game.player1.give(MURLOC)\n\tmurloc.play()\n\tgame.player1.give(MOONFIRE).play(target=murloc)\n\tassert len(game.player1.hand) == 1\n\n\ndef test_shrinkmeister():\n\tgame = prepare_game()\n\tdummy = game.player1.give(TARGET_DUMMY)\n\tdummy.play()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tboulderfist = game.player1.give(\"CS2_200\")\n\tboulderfist.play()\n\tgame.end_turn()\n\n\tassert dummy.atk == 0\n\tgame.player2.give(\"GVG_011\").play(target=dummy)\n\tassert dummy.buffs\n\tassert dummy.atk == 0\n\n\tassert wisp.atk == 1\n\tgame.player2.give(\"GVG_011\").play(target=wisp)\n\tassert wisp.buffs\n\tassert wisp.atk == 0\n\n\tassert boulderfist.atk == 6\n\tgame.player2.give(\"GVG_011\").play(target=boulderfist)\n\tassert boulderfist.buffs\n\tassert boulderfist.atk == 6 - 2\n\tgame.end_turn()\n\n\t# ensure buffs are gone after end of turn\n\tassert not dummy.buffs\n\tassert dummy.atk == 0\n\tassert not wisp.buffs\n\tassert wisp.atk == 1\n\tassert not boulderfist.buffs\n\tassert boulderfist.atk == 6\n\n\ndef test_sneeds_old_shredder():\n\tgame = prepare_game()\n\tsneeds = game.player1.give(\"GVG_114\")\n\tsneeds.play()\n\tsneeds.destroy()\n\tassert len(game.player1.field) == 1\n\tpilot = game.player1.field[0]\n\tassert pilot.rarity == Rarity.LEGENDARY\n\tassert pilot.data.collectible\n\n\ndef test_tinkertown_technician():\n\tgame = prepare_game()\n\tgame.player1.discard_hand()\n\tgame.player1.give(WISP).play()\n\ttech = game.player1.give(\"GVG_102\")\n\tassert not tech.powered_up\n\ttech.play()\n\tassert tech.atk == tech.health == 3\n\tassert len(game.player1.hand) == 0\n\n\tdummy = game.player1.give(TARGET_DUMMY)\n\tdummy.play()\n\ttech2 = game.player1.give(\"GVG_102\")\n\tassert tech2.powered_up\n\ttech2.play()\n\tassert tech2.atk == tech2.health == 4\n\tassert len(game.player1.hand) == 1\n\tassert game.player1.hand[0].type == CardType.SPELL\n\n\ndef test_tree_of_life():\n\tgame = prepare_game()\n\ttoken1 = game.player1.give(SPELLBENDERT)\n\ttoken1.play()\n\ttree = game.player1.give(\"GVG_033\")\n\tgame.end_turn()\n\n\ttoken2 = game.player2.give(SPELLBENDERT)\n\ttoken2.play()\n\tgame.end_turn()\n\n\ttargets = (game.player1.hero, game.player2.hero, token1, token2)\n\tfor target in targets:\n\t\tgame.player1.give(MOONFIRE).play(target=target)\n\n\tassert token1.health == token2.health == 3 - 1\n\tassert game.player1.hero.health == game.player2.hero.health == 30 - 1\n\ttree.play()\n\tassert token1.health == token2.health == 3\n\tassert game.player1.hero.health == game.player2.hero.health == 30\n\n\ndef test_unstable_portal():\n\tgame = prepare_game()\n\tgame.player1.discard_hand()\n\tportal = game.player1.give(\"GVG_003\")\n\tportal.play()\n\tassert len(game.player1.hand) == 1\n\tminion = game.player1.hand[0]\n\tassert minion.type == CardType.MINION\n\tassert minion.creator is portal\n\tassert minion.buffs\n\n\ndef test_velens_chosen():\n\tgame = prepare_game()\n\twisp = game.player1.give(WISP)\n\twisp.play()\n\tgame.player1.give(\"GVG_010\").play(target=wisp)\n\tassert wisp.atk == 1 + 2\n\tassert wisp.health == 1 + 4\n\tassert wisp.spellpower == 0 + 1\n\tassert game.player1.spellpower == 1\n\tgame.player1.give(\"GVG_010\").play(target=wisp)\n\tassert wisp.atk == 1 + 2 + 2\n\tassert wisp.health == 1 + 4 + 4\n\tassert wisp.spellpower == 0 + 1 + 1\n\tassert game.player1.spellpower == 2\n\tgame.end_turn()\n\n\tassert game.player2.spellpower == 0\n\tkobold = game.player2.give(KOBOLD_GEOMANCER)\n\tkobold.play()\n\tassert game.player2.spellpower == 1\n\tgame.player2.give(\"GVG_010\").play(target=kobold)\n\tassert kobold.spellpower == 2\n\tassert game.player2.spellpower == 2\n\tassert game.player1.spellpower == 2\n\n\ndef test_voljin():\n\tgame = prepare_game()\n\tvoljin = game.player1.give(\"GVG_014\")\n\tstatue = game.player1.summon(ANIMATED_STATUE)\n\tassert voljin.health == 2\n\tassert statue.health == 10\n\tvoljin.play(target=statue)\n\tassert voljin.health == 10\n\tassert statue.health == 2\n\n\ndef test_voljin_stealth():\n\tgame = prepare_game()\n\ttiger = game.player1.give(\"EX1_028\")\n\ttiger.play()\n\tgame.end_turn()\n\n\tvoljin = game.player2.give(\"GVG_014\")\n\tassert not voljin.targets\n\tvoljin.play()\n\tassert not voljin.dead\n\tassert voljin.health == 2\n\tassert tiger.health == 5\n\n\ndef test_wee_spellstopper():\n\tgame = prepare_game(CardClass.MAGE, CardClass.MAGE)\n\toutside = game.player1.give(WISP)\n\toutside.play(index=0)\n\tleft = game.player1.give(TARGET_DUMMY)\n\tleft.play(index=1)\n\n\tmoonfire = game.player1.give(MOONFIRE)\n\tassert outside in moonfire.targets\n\tassert not left.cant_be_targeted_by_abilities\n\tassert left in moonfire.targets\n\tspellstopper = game.player1.give(\"GVG_122\")\n\tspellstopper.play(index=2)\n\tassert outside in moonfire.targets\n\tassert left.cant_be_targeted_by_abilities\n\tassert left not in moonfire.targets\n"} +{"text": "/*\n * GPIO driver for the ACCES PCI-IDIO-16\n * Copyright (C) 2017 William Breathitt Gray\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License, version 2, as\n * published by the Free Software Foundation.\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * General Public License for more details.\n */\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n/**\n * struct idio_16_gpio_reg - GPIO device registers structure\n * @out0_7:\tRead: FET Drive Outputs 0-7\n *\t\tWrite: FET Drive Outputs 0-7\n * @in0_7:\tRead: Isolated Inputs 0-7\n *\t\tWrite: Clear Interrupt\n * @irq_ctl:\tRead: Enable IRQ\n *\t\tWrite: Disable IRQ\n * @filter_ctl:\tRead: Activate Input Filters 0-15\n *\t\tWrite: Deactivate Input Filters 0-15\n * @out8_15:\tRead: FET Drive Outputs 8-15\n *\t\tWrite: FET Drive Outputs 8-15\n * @in8_15:\tRead: Isolated Inputs 8-15\n *\t\tWrite: Unused\n * @irq_status:\tRead: Interrupt status\n *\t\tWrite: Unused\n */\nstruct idio_16_gpio_reg {\n\tu8 out0_7;\n\tu8 in0_7;\n\tu8 irq_ctl;\n\tu8 filter_ctl;\n\tu8 out8_15;\n\tu8 in8_15;\n\tu8 irq_status;\n};\n\n/**\n * struct idio_16_gpio - GPIO device private data structure\n * @chip:\tinstance of the gpio_chip\n * @lock:\tsynchronization lock to prevent I/O race conditions\n * @reg:\tI/O address offset for the GPIO device registers\n * @irq_mask:\tI/O bits affected by interrupts\n */\nstruct idio_16_gpio {\n\tstruct gpio_chip chip;\n\traw_spinlock_t lock;\n\tstruct idio_16_gpio_reg __iomem *reg;\n\tunsigned long irq_mask;\n};\n\nstatic int idio_16_gpio_get_direction(struct gpio_chip *chip,\n\tunsigned int offset)\n{\n\tif (offset > 15)\n\t\treturn 1;\n\n\treturn 0;\n}\n\nstatic int idio_16_gpio_direction_input(struct gpio_chip *chip,\n\tunsigned int offset)\n{\n\treturn 0;\n}\n\nstatic int idio_16_gpio_direction_output(struct gpio_chip *chip,\n\tunsigned int offset, int value)\n{\n\tchip->set(chip, offset, value);\n\treturn 0;\n}\n\nstatic int idio_16_gpio_get(struct gpio_chip *chip, unsigned int offset)\n{\n\tstruct idio_16_gpio *const idio16gpio = gpiochip_get_data(chip);\n\tunsigned long mask = BIT(offset);\n\n\tif (offset < 8)\n\t\treturn !!(ioread8(&idio16gpio->reg->out0_7) & mask);\n\n\tif (offset < 16)\n\t\treturn !!(ioread8(&idio16gpio->reg->out8_15) & (mask >> 8));\n\n\tif (offset < 24)\n\t\treturn !!(ioread8(&idio16gpio->reg->in0_7) & (mask >> 16));\n\n\treturn !!(ioread8(&idio16gpio->reg->in8_15) & (mask >> 24));\n}\n\nstatic int idio_16_gpio_get_multiple(struct gpio_chip *chip,\n\tunsigned long *mask, unsigned long *bits)\n{\n\tstruct idio_16_gpio *const idio16gpio = gpiochip_get_data(chip);\n\tsize_t i;\n\tconst unsigned int gpio_reg_size = 8;\n\tunsigned int bits_offset;\n\tsize_t word_index;\n\tunsigned int word_offset;\n\tunsigned long word_mask;\n\tconst unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0);\n\tunsigned long port_state;\n\tvoid __iomem *ports[] = {\n\t\t&idio16gpio->reg->out0_7, &idio16gpio->reg->out8_15,\n\t\t&idio16gpio->reg->in0_7, &idio16gpio->reg->in8_15,\n\t};\n\n\t/* clear bits array to a clean slate */\n\tbitmap_zero(bits, chip->ngpio);\n\n\t/* get bits are evaluated a gpio port register at a time */\n\tfor (i = 0; i < ARRAY_SIZE(ports); i++) {\n\t\t/* gpio offset in bits array */\n\t\tbits_offset = i * gpio_reg_size;\n\n\t\t/* word index for bits array */\n\t\tword_index = BIT_WORD(bits_offset);\n\n\t\t/* gpio offset within current word of bits array */\n\t\tword_offset = bits_offset % BITS_PER_LONG;\n\n\t\t/* mask of get bits for current gpio within current word */\n\t\tword_mask = mask[word_index] & (port_mask << word_offset);\n\t\tif (!word_mask) {\n\t\t\t/* no get bits in this port so skip to next one */\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* read bits from current gpio port */\n\t\tport_state = ioread8(ports[i]);\n\n\t\t/* store acquired bits at respective bits array offset */\n\t\tbits[word_index] |= port_state << word_offset;\n\t}\n\n\treturn 0;\n}\n\nstatic void idio_16_gpio_set(struct gpio_chip *chip, unsigned int offset,\n\tint value)\n{\n\tstruct idio_16_gpio *const idio16gpio = gpiochip_get_data(chip);\n\tunsigned int mask = BIT(offset);\n\tvoid __iomem *base;\n\tunsigned long flags;\n\tunsigned int out_state;\n\n\tif (offset > 15)\n\t\treturn;\n\n\tif (offset > 7) {\n\t\tmask >>= 8;\n\t\tbase = &idio16gpio->reg->out8_15;\n\t} else\n\t\tbase = &idio16gpio->reg->out0_7;\n\n\traw_spin_lock_irqsave(&idio16gpio->lock, flags);\n\n\tif (value)\n\t\tout_state = ioread8(base) | mask;\n\telse\n\t\tout_state = ioread8(base) & ~mask;\n\n\tiowrite8(out_state, base);\n\n\traw_spin_unlock_irqrestore(&idio16gpio->lock, flags);\n}\n\nstatic void idio_16_gpio_set_multiple(struct gpio_chip *chip,\n\tunsigned long *mask, unsigned long *bits)\n{\n\tstruct idio_16_gpio *const idio16gpio = gpiochip_get_data(chip);\n\tunsigned long flags;\n\tunsigned int out_state;\n\n\traw_spin_lock_irqsave(&idio16gpio->lock, flags);\n\n\t/* process output lines 0-7 */\n\tif (*mask & 0xFF) {\n\t\tout_state = ioread8(&idio16gpio->reg->out0_7) & ~*mask;\n\t\tout_state |= *mask & *bits;\n\t\tiowrite8(out_state, &idio16gpio->reg->out0_7);\n\t}\n\n\t/* shift to next output line word */\n\t*mask >>= 8;\n\n\t/* process output lines 8-15 */\n\tif (*mask & 0xFF) {\n\t\t*bits >>= 8;\n\t\tout_state = ioread8(&idio16gpio->reg->out8_15) & ~*mask;\n\t\tout_state |= *mask & *bits;\n\t\tiowrite8(out_state, &idio16gpio->reg->out8_15);\n\t}\n\n\traw_spin_unlock_irqrestore(&idio16gpio->lock, flags);\n}\n\nstatic void idio_16_irq_ack(struct irq_data *data)\n{\n}\n\nstatic void idio_16_irq_mask(struct irq_data *data)\n{\n\tstruct gpio_chip *chip = irq_data_get_irq_chip_data(data);\n\tstruct idio_16_gpio *const idio16gpio = gpiochip_get_data(chip);\n\tconst unsigned long mask = BIT(irqd_to_hwirq(data));\n\tunsigned long flags;\n\n\tidio16gpio->irq_mask &= ~mask;\n\n\tif (!idio16gpio->irq_mask) {\n\t\traw_spin_lock_irqsave(&idio16gpio->lock, flags);\n\n\t\tiowrite8(0, &idio16gpio->reg->irq_ctl);\n\n\t\traw_spin_unlock_irqrestore(&idio16gpio->lock, flags);\n\t}\n}\n\nstatic void idio_16_irq_unmask(struct irq_data *data)\n{\n\tstruct gpio_chip *chip = irq_data_get_irq_chip_data(data);\n\tstruct idio_16_gpio *const idio16gpio = gpiochip_get_data(chip);\n\tconst unsigned long mask = BIT(irqd_to_hwirq(data));\n\tconst unsigned long prev_irq_mask = idio16gpio->irq_mask;\n\tunsigned long flags;\n\n\tidio16gpio->irq_mask |= mask;\n\n\tif (!prev_irq_mask) {\n\t\traw_spin_lock_irqsave(&idio16gpio->lock, flags);\n\n\t\tioread8(&idio16gpio->reg->irq_ctl);\n\n\t\traw_spin_unlock_irqrestore(&idio16gpio->lock, flags);\n\t}\n}\n\nstatic int idio_16_irq_set_type(struct irq_data *data, unsigned int flow_type)\n{\n\t/* The only valid irq types are none and both-edges */\n\tif (flow_type != IRQ_TYPE_NONE &&\n\t\t(flow_type & IRQ_TYPE_EDGE_BOTH) != IRQ_TYPE_EDGE_BOTH)\n\t\treturn -EINVAL;\n\n\treturn 0;\n}\n\nstatic struct irq_chip idio_16_irqchip = {\n\t.name = \"pci-idio-16\",\n\t.irq_ack = idio_16_irq_ack,\n\t.irq_mask = idio_16_irq_mask,\n\t.irq_unmask = idio_16_irq_unmask,\n\t.irq_set_type = idio_16_irq_set_type\n};\n\nstatic irqreturn_t idio_16_irq_handler(int irq, void *dev_id)\n{\n\tstruct idio_16_gpio *const idio16gpio = dev_id;\n\tunsigned int irq_status;\n\tstruct gpio_chip *const chip = &idio16gpio->chip;\n\tint gpio;\n\n\traw_spin_lock(&idio16gpio->lock);\n\n\tirq_status = ioread8(&idio16gpio->reg->irq_status);\n\n\traw_spin_unlock(&idio16gpio->lock);\n\n\t/* Make sure our device generated IRQ */\n\tif (!(irq_status & 0x3) || !(irq_status & 0x4))\n\t\treturn IRQ_NONE;\n\n\tfor_each_set_bit(gpio, &idio16gpio->irq_mask, chip->ngpio)\n\t\tgeneric_handle_irq(irq_find_mapping(chip->irq.domain, gpio));\n\n\traw_spin_lock(&idio16gpio->lock);\n\n\t/* Clear interrupt */\n\tiowrite8(0, &idio16gpio->reg->in0_7);\n\n\traw_spin_unlock(&idio16gpio->lock);\n\n\treturn IRQ_HANDLED;\n}\n\n#define IDIO_16_NGPIO 32\nstatic const char *idio_16_names[IDIO_16_NGPIO] = {\n\t\"OUT0\", \"OUT1\", \"OUT2\", \"OUT3\", \"OUT4\", \"OUT5\", \"OUT6\", \"OUT7\",\n\t\"OUT8\", \"OUT9\", \"OUT10\", \"OUT11\", \"OUT12\", \"OUT13\", \"OUT14\", \"OUT15\",\n\t\"IIN0\", \"IIN1\", \"IIN2\", \"IIN3\", \"IIN4\", \"IIN5\", \"IIN6\", \"IIN7\",\n\t\"IIN8\", \"IIN9\", \"IIN10\", \"IIN11\", \"IIN12\", \"IIN13\", \"IIN14\", \"IIN15\"\n};\n\nstatic int idio_16_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n{\n\tstruct device *const dev = &pdev->dev;\n\tstruct idio_16_gpio *idio16gpio;\n\tint err;\n\tconst size_t pci_bar_index = 2;\n\tconst char *const name = pci_name(pdev);\n\n\tidio16gpio = devm_kzalloc(dev, sizeof(*idio16gpio), GFP_KERNEL);\n\tif (!idio16gpio)\n\t\treturn -ENOMEM;\n\n\terr = pcim_enable_device(pdev);\n\tif (err) {\n\t\tdev_err(dev, \"Failed to enable PCI device (%d)\\n\", err);\n\t\treturn err;\n\t}\n\n\terr = pcim_iomap_regions(pdev, BIT(pci_bar_index), name);\n\tif (err) {\n\t\tdev_err(dev, \"Unable to map PCI I/O addresses (%d)\\n\", err);\n\t\treturn err;\n\t}\n\n\tidio16gpio->reg = pcim_iomap_table(pdev)[pci_bar_index];\n\n\t/* Deactivate input filters */\n\tiowrite8(0, &idio16gpio->reg->filter_ctl);\n\n\tidio16gpio->chip.label = name;\n\tidio16gpio->chip.parent = dev;\n\tidio16gpio->chip.owner = THIS_MODULE;\n\tidio16gpio->chip.base = -1;\n\tidio16gpio->chip.ngpio = IDIO_16_NGPIO;\n\tidio16gpio->chip.names = idio_16_names;\n\tidio16gpio->chip.get_direction = idio_16_gpio_get_direction;\n\tidio16gpio->chip.direction_input = idio_16_gpio_direction_input;\n\tidio16gpio->chip.direction_output = idio_16_gpio_direction_output;\n\tidio16gpio->chip.get = idio_16_gpio_get;\n\tidio16gpio->chip.get_multiple = idio_16_gpio_get_multiple;\n\tidio16gpio->chip.set = idio_16_gpio_set;\n\tidio16gpio->chip.set_multiple = idio_16_gpio_set_multiple;\n\n\traw_spin_lock_init(&idio16gpio->lock);\n\n\terr = devm_gpiochip_add_data(dev, &idio16gpio->chip, idio16gpio);\n\tif (err) {\n\t\tdev_err(dev, \"GPIO registering failed (%d)\\n\", err);\n\t\treturn err;\n\t}\n\n\t/* Disable IRQ by default and clear any pending interrupt */\n\tiowrite8(0, &idio16gpio->reg->irq_ctl);\n\tiowrite8(0, &idio16gpio->reg->in0_7);\n\n\terr = gpiochip_irqchip_add(&idio16gpio->chip, &idio_16_irqchip, 0,\n\t\thandle_edge_irq, IRQ_TYPE_NONE);\n\tif (err) {\n\t\tdev_err(dev, \"Could not add irqchip (%d)\\n\", err);\n\t\treturn err;\n\t}\n\n\terr = devm_request_irq(dev, pdev->irq, idio_16_irq_handler, IRQF_SHARED,\n\t\tname, idio16gpio);\n\tif (err) {\n\t\tdev_err(dev, \"IRQ handler registering failed (%d)\\n\", err);\n\t\treturn err;\n\t}\n\n\treturn 0;\n}\n\nstatic const struct pci_device_id idio_16_pci_dev_id[] = {\n\t{ PCI_DEVICE(0x494F, 0x0DC8) }, { 0 }\n};\nMODULE_DEVICE_TABLE(pci, idio_16_pci_dev_id);\n\nstatic struct pci_driver idio_16_driver = {\n\t.name = \"pci-idio-16\",\n\t.id_table = idio_16_pci_dev_id,\n\t.probe = idio_16_probe\n};\n\nmodule_pci_driver(idio_16_driver);\n\nMODULE_AUTHOR(\"William Breathitt Gray \");\nMODULE_DESCRIPTION(\"ACCES PCI-IDIO-16 GPIO driver\");\nMODULE_LICENSE(\"GPL v2\");\n"} +{"text": "\n\n\n\n\nWatchBuilder.WatchFactory (weblogic-kubernetes-operator 2.3.0 API)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n\n
\n
\n\n

Interface WatchBuilder.WatchFactory

\n
\n
\n
\n
    \n
  • \n
    \n
    Enclosing class:
    \n
    WatchBuilder
    \n
    \n
    \n
    public static interface WatchBuilder.WatchFactory
    \n
  • \n
\n
\n
\n\n
\n
\n
    \n
  • \n\n
    \n
      \n
    • \n\n\n

      Method Detail

      \n\n\n\n
        \n
      • \n

        createWatch

        \n
        <T> WatchI<T> createWatch​(Pool<io.kubernetes.client.ApiClient> pool,\n                          CallParams callParams,\n                          Class<?> responseBodyType,\n                          BiFunction<io.kubernetes.client.ApiClient,​CallParams,​com.squareup.okhttp.Call> function)\n                   throws io.kubernetes.client.ApiException
        \n
        \n
        Throws:
        \n
        io.kubernetes.client.ApiException
        \n
        \n
      • \n
      \n
    • \n
    \n
    \n
  • \n
\n
\n
\n
\n\n
\n\n

Copyright © 2017–2019. All rights reserved.

\n
\n\n\n"} +{"text": "//hong QQ:1410919373\npackage com.zlchat.utils {\n import com.zlchat.ui.*;\n import flash.events.*;\n import fl.data.*;\n import flash.net.*;\n import com.zlchat.events.*;\n import flash.utils.*;\n import flash.media.*;\n import flash.system.*;\n import flash.external.*;\n\n public class VideoConnection extends NetConnection { \n\n public function VideoConnection(){ \n } \n\t\tpublic function onBWDone():void{};\n\t}\n}//package com.zlchat.utils \n"} +{"text": "/*\nCopyright 2017 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage v1\n\nimport \"fmt\"\n\n// MatchTaint checks if the taint matches taintToMatch. Taints are unique by key:effect,\n// if the two taints have same key:effect, regard as they match.\nfunc (t *Taint) MatchTaint(taintToMatch *Taint) bool {\n\treturn t.Key == taintToMatch.Key && t.Effect == taintToMatch.Effect\n}\n\n// taint.ToString() converts taint struct to string in format '=:', '=:', ':', or ''.\nfunc (t *Taint) ToString() string {\n\tif len(t.Effect) == 0 {\n\t\tif len(t.Value) == 0 {\n\t\t\treturn fmt.Sprintf(\"%v\", t.Key)\n\t\t}\n\t\treturn fmt.Sprintf(\"%v=%v:\", t.Key, t.Value)\n\t}\n\tif len(t.Value) == 0 {\n\t\treturn fmt.Sprintf(\"%v:%v\", t.Key, t.Effect)\n\t}\n\treturn fmt.Sprintf(\"%v=%v:%v\", t.Key, t.Value, t.Effect)\n}\n"} +{"text": "---\ntitle: 元素\nms.date: 03/30/2017\nf1_keywords:\n- http://schemas.microsoft.com/.NetConfiguration/v2.0#configuration/system.diagnostics/switches/add\nhelpviewer_keywords:\n- element for \n- add element for \nms.assetid: 712ac3a7-7abf-4a9e-8db4-acd241c2f369\nms.openlocfilehash: 5be39425363cb6d2a0eca6a0fa3f4154ce857bb5\nms.sourcegitcommit: 5b475c1855b32cf78d2d1bbb4295e4c236f39464\nms.translationtype: MT\nms.contentlocale: zh-CN\nms.lasthandoff: 09/24/2020\nms.locfileid: \"91173934\"\n---\n# \\ 的 \\ 元素\n\n指定对跟踪开关设置的级别。 \n\n[**\\**](../configuration-element.md)\\\n  [**\\**](system-diagnostics-element.md)\\\n    [**\\**](switches-element.md)\\\n      **\\**\n\n## 语法 \n \n```xml \n \n``` \n \n## 特性和元素 \n\n 下列各节描述了特性��子元素和父元素。 \n \n### 特性 \n \n|属性|描述| \n|---------------|-----------------| \n|name|必需的特性。

指定开关的名称。 此属性的值对应于传递给 switch 构造函数的 *displayName* 参数。| \n|**value**|必需的特性。

指定开关的级别。| \n \n### 子元素 \n\n 无。 \n \n### 父元素 \n \n|元素|描述| \n|-------------|-----------------| \n|`configuration`|公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。| \n|`switches`|包含跟踪开关和对该跟踪开关设置的级别。| \n|`system.diagnostics`|指定用于收集、存储和路由消息的跟踪侦听器以及对跟踪开关设置的级别。| \n \n## 备注 \n\n 可以通过将跟踪开关置于配置文件中来更改其级别。 如果开关是 ,则可以将其打开或关闭。 如果开关是 ,则可以为其分配不同的级别,以指定应用程序输出的跟踪或调试消息的类型。 \n \n## 示例 \n\n 下面的示例演示如何使用 **\\** 元素将 `General` 跟踪开关设置为 级别,并启用 `Data` 布尔型跟踪开关。 \n \n```xml \n \n \n \n \n \n \n \n \n``` \n \n## 请参阅\n\n- \n- \n- \n- [跟踪和调试设置架构](index.md)\n"} +{"text": "2\n4\n2\n2\n2\n2\n4\n4\n4\n0\n2\n6\n4\n4\n0\n2\n4\n2\n2\n4\n6\n2\n2\n4\n2\n2\n2\n4\n0\n6\n0\n2\n2\n4\n2\n0\n2\n2\n0\n4\n2\n4\n2\n0\n2\n2\n4\n2\n2\n2\n2\n2\n2\n2\n6\n2\n4\n4\n2\n2\n0\n2\n4\n0\n2\n4\n0\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n4\n0\n2\n6\n4\n2\n2\n2\n2\n4\n4\n0\n2\n2\n0\n2\n2\n4\n4\n2\n2\n2\n4\n4\n2\n4\n2\n4\n4\n2\n2\n4\n2\n0\n2\n2\n4\n4\n2\n2\n2\n2\n2\n2\n2\n4\n4\n2\n2\n2\n2\n2\n2\n2\n2\n0\n4\n2\n2\n2\n4\n2\n4\n2\n2\n2\n2\n4\n0\n2\n4\n0\n8\n2\n2\n2\n6\n2\n4\n2\n2\n4\n4\n4\n2\n2\n2\n2\n6\n2\n4\n0\n2\n2\n4\n2\n2\n0\n4\n2\n2\n4\n2\n2\n2\n4\n2\n2\n2\n4\n4\n2\n4\n4\n4\n2\n0\n2\n4\n6\n4\n2\n2\n0\n0\n2\n2\n2\n0\n2\n0\n2\n2\n2\n2\n2\n0\n2\n4\n2\n0\n4\n2\n2\n2\n2\n2\n2\n2\n2\n0\n4\n0\n4\n2\n4\n4\n6\n2\n0\n0\n4\n2\n4\n2\n6\n0\n2\n2\n2\n2\n2\n0\n4\n2\n2\n2\n2\n0\n4\n2\n2\n0\n2\n6\n2\n2\n0\n4\n0\n2\n2\n2\n4\n2\n4\n2\n0\n0\n2\n2\n2\n4\n0\n2\n2\n4\n2\n"} +{"text": "package com.sequenceiq.cloudbreak.converter.v4.stacks;\n\nimport org.springframework.stereotype.Component;\n\nimport com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.tags.TagsV4Response;\nimport com.sequenceiq.cloudbreak.cloud.model.StackTags;\nimport com.sequenceiq.cloudbreak.converter.AbstractConversionServiceAwareConverter;\n\n@Component\npublic class StackTagsToTagsV4ResponseConverter extends AbstractConversionServiceAwareConverter {\n\n @Override\n public TagsV4Response convert(StackTags source) {\n TagsV4Response response = new TagsV4Response();\n response.setApplication(source.getApplicationTags());\n response.setDefaults(source.getDefaultTags());\n response.setUserDefined(source.getUserDefinedTags());\n return response;\n }\n\n}\n"} +{"text": "// Copyright (C) 2017 Davis E. King (davis@dlib.net)\n// License: Boost Software License See LICENSE.txt for the full license.\n#undef DLIB_UPPER_bOUND_FUNCTION_ABSTRACT_Hh_\n#ifdef DLIB_UPPER_bOUND_FUNCTION_ABSTRACT_Hh_\n\n#include \"../matrix.h\"\n#include \n\nnamespace dlib\n{\n\n// ----------------------------------------------------------------------------------------\n\n struct function_evaluation\n {\n /*!\n WHAT THIS OBJECT REPRESENTS\n This object records the output of a real valued function in response to\n some input. \n\n In particular, if you have a function F(x) then the function_evaluation is\n simply a struct that records x and the scalar value F(x).\n !*/\n\n function_evaluation() = default;\n function_evaluation(const matrix& x, double y) :x(x), y(y) {}\n\n matrix x;\n double y = std::numeric_limits::quiet_NaN();\n };\n\n// ----------------------------------------------------------------------------------------\n\n class upper_bound_function\n {\n /*!\n WHAT THIS OBJECT REPRESENTS\n This object represents a piecewise linear non-parametric function that can\n be used to define an upper bound on some more complex and unknown function.\n To describe this precisely, lets assume there is a function F(x) which you\n are capable of sampling from but otherwise know nothing about, and that you\n would like to find an upper bounding function U(x) such that U(x) >= F(x)\n for any x. It would also be good if U(x)-F(x) was minimal. I.e. we would\n like U(x) to be a tight upper bound, not something vacuous like U(x) =\n infinity.\n\n The upper_bound_function class is a tool for creating this kind of upper\n bounding function from a set of function_evaluations of F(x). We do this\n by considering only U(x) of the form:\n U = [](matrix x) {\n double min_ub = infinity;\n for (size_t i = 0; i < POINTS.size(); ++i) {\n function_evaluation p = POINTS[i]\n double local_bound = p.y + sqrt(noise_terms[i] + trans(p.x-x)*M*(p.x-x))\n min_ub = min(min_ub, local_bound)\n }\n return min_ub;\n }\n Where POINTS is an array of function_evaluation instances drawn from F(x),\n M is a diagonal matrix, and noise_terms is an array of scalars.\n\n To create an upper bound U(x), the upper_bound_function takes a POINTS array\n containing evaluations of F(x) as input and solves the following quadratic\n program to find the parameters of U(x):\n \n min_{M,noise_terms}: sum(squared(M)) + sum(squared(noise_terms/relative_noise_magnitude))\n s.t. U(POINTS[i].x) >= POINTS[i].y, for all i \n noise_terms[i] >= 0\n min(M) >= 0\n M is a diagonal matrix \n \n Therefore, the quadratic program finds the U(x) that always upper bounds\n F(x) on the supplied POINTS, but is otherwise as small as possible.\n\n\n\n The inspiration for the upper_bound_function object came from the AdaLIPO\n algorithm from this excellent paper:\n Global optimization of Lipschitz functions \n Malherbe, Cédric and Vayatis, Nicolas \n International Conference on Machine Learning - 2017\n In that paper, they propose to use a simpler U(x) where noise_terms is\n always 0 and M is a diagonal matrix where each diagonal element is the same\n value. Therefore, there is only a single scalar parameter for U(x) in\n their formulation of the problem. This causes difficulties if F(x) is\n stochastic or has discontinuities since, without the noise term, M will\n become really huge and the upper bound becomes vacuously large. It is also\n problematic if the gradient of F(x) with respect to x contains elements of\n widely varying magnitude since the simpler formulation of U(x) assumes a\n uniform rate of change regardless of which dimension is varying. \n !*/\n\n public:\n\n upper_bound_function(\n );\n /*!\n ensures\n - #num_points() == 0\n - #dimensionality() == 0\n !*/\n\n explicit upper_bound_function(\n const std::vector& points,\n const double relative_noise_magnitude = 0.001,\n const double solver_eps = 0.0001\n );\n /*!\n requires\n - all the x vectors in points must have the same non-zero dimensionality.\n - relative_noise_magnitude >= 0\n - solver_eps > 0\n ensures\n - Creates an upper bounding function U(x), as described above, assuming that\n the given points are drawn from F(x).\n - Uses the provided relative_noise_magnitude when solving the QP, as\n described above. Note that relative_noise_magnitude can be set to 0. If\n you do this then all the noise terms are constrained to 0. You should\n only do this if you know F(x) is non-stochastic and continuous\n everywhere.\n - When solving the QP used to find the parameters of U(x), the upper\n bounding function, we solve the QP to solver_eps accuracy. It's\n possible that large enough solver_eps can lead to upper bounds that don't\n upper bound all the supplied points. But for reasonable epsilon values\n this shouldn't be a problem. \n - #num_points() == points.size()\n - #dimensionality() == points[0].x.size()\n !*/\n\n upper_bound_function(\n const double relative_noise_magnitude,\n const double solver_eps \n );\n /*!\n requires\n - relative_noise_magnitude >= 0\n - solver_eps > 0\n ensures\n - #num_points() == 0\n - #dimensionality() == 0\n - This destructor is the same as calling the above constructor with points.size()==0\n !*/\n\n\n void add (\n const function_evaluation& point\n );\n /*!\n requires\n - num_points() == 0 || point.x.size() == dimensionality()\n - point.x.size() != 0\n ensures\n - Adds point to get_points().\n - Incrementally updates the upper bounding function with the given function\n evaluation. That is, we assume that F(point.x)==point.y and solve the QP\n described above to find the new U(x) that upper bounds all the points\n this object knows about (i.e. all the points in get_points() and the new point).\n - Calling add() is much faster than recreating the upper_bound_function\n from scratch with all the points. This is because we warm start with the\n previous solution to the QP. This is done by discarding any non-active\n constraints and solving the QP again with only the previously active\n constraints and the new constraints formed by all the pairs of the new\n point and the old points. This means the QP solved by add() is much\n smaller than the QP that would be solved by a fresh call to the\n upper_bound_function constructor.\n !*/\n\n const std::vector& get_points(\n ) const;\n /*!\n ensures\n - returns the points from F(x) used to define this upper bounding function.\n These are all the function_evaluation objects given to this object via\n its constructor and add().\n !*/\n\n long num_points(\n ) const;\n /*!\n ensures\n - returns the number of points used to define the upper bounding function.\n (i.e. returns get_points().size())\n !*/\n\n long dimensionality(\n ) const;\n /*!\n ensures\n - returns the dimensionality of the input vectors to the upper bounding function. \n !*/\n\n double operator() (\n const matrix& x\n ) const;\n /*!\n requires\n - num_points() > 0\n - x.size() == dimensionality()\n ensures\n - return U(x)\n (i.e. returns the upper bound on F(x) at x given by our upper bounding function)\n !*/\n\n };\n\n// ----------------------------------------------------------------------------------------\n\n}\n\n#endif // DLIB_UPPER_bOUND_FUNCTION_ABSTRACT_Hh_\n\n\n"} +{"text": "\n \n \n \n\n"} +{"text": "# Tenko parser autogenerated test case\n\n- From: tests/testcases/strict_mode/directive_headers/func_decl/autogen.md\n- Path: tests/testcases/strict_mode/directive_headers/func_decl/gen/obj_method_as_func_name_w_directive/eval.md\n\n> :: strict mode : directive headers : func decl : gen : obj method as func name w directive\n>\n> ::> eval\n\n## Input\n\n\n`````js\nf = {\n eval(b){\n \"use strict\"; \n }\n}\n`````\n\n## Output\n\n_Note: the whole output block is auto-generated. Manual changes will be overwritten!_\n\nBelow follow outputs in five parsing modes: sloppy, sloppy+annexb, strict script, module, module+annexb.\n\nNote that the output parts are auto-generated by the test runner to reflect actual result.\n\n### Sloppy mode\n\nParsed with script goal and as if the code did not start with strict mode header.\n\n`````\nast: {\n type: 'Program',\n loc:{start:{line:1,column:0},end:{line:5,column:1},source:''},\n body: [\n {\n type: 'ExpressionStatement',\n loc:{start:{line:1,column:0},end:{line:5,column:1},source:''},\n expression: {\n type: 'AssignmentExpression',\n loc:{start:{line:1,column:0},end:{line:5,column:1},source:''},\n left: {\n type: 'Identifier',\n loc:{start:{line:1,column:0},end:{line:1,column:1},source:''},\n name: 'f'\n },\n operator: '=',\n right: {\n type: 'ObjectExpression',\n loc:{start:{line:1,column:4},end:{line:5,column:1},source:''},\n properties: [\n {\n type: 'Property',\n loc:{start:{line:2,column:2},end:{line:4,column:3},source:''},\n key: {\n type: 'Identifier',\n loc:{start:{line:2,column:2},end:{line:2,column:6},source:''},\n name: 'eval'\n },\n kind: 'init',\n method: true,\n computed: false,\n value: {\n type: 'FunctionExpression',\n loc:{start:{line:2,column:2},end:{line:4,column:3},source:''},\n generator: false,\n async: false,\n id: null,\n params: [\n {\n type: 'Identifier',\n loc:{start:{line:2,column:7},end:{line:2,column:8},source:''},\n name: 'b'\n }\n ],\n body: {\n type: 'BlockStatement',\n loc:{start:{line:2,column:9},end:{line:4,column:3},source:''},\n body: [\n {\n type: 'ExpressionStatement',\n loc:{start:{line:3,column:4},end:{line:3,column:17},source:''},\n expression: {\n type: 'Literal',\n loc:{start:{line:3,column:4},end:{line:3,column:16},source:''},\n value: 'use strict',\n raw: '\"use strict\"'\n },\n directive: 'use strict'\n }\n ]\n }\n },\n shorthand: false\n }\n ]\n }\n }\n }\n ]\n}\n\ntokens (14x):\n IDENT PUNC_EQ PUNC_CURLY_OPEN ID_eval PUNC_PAREN_OPEN IDENT\n PUNC_PAREN_CLOSE PUNC_CURLY_OPEN STRING_DOUBLE PUNC_SEMI\n PUNC_CURLY_CLOSE PUNC_CURLY_CLOSE ASI\n`````\n\n### Strict mode\n\nParsed with script goal but as if it was starting with `\"use strict\"` at the top.\n\n_Output same as sloppy mode._\n\n### Module goal\n\nParsed with the module goal.\n\n_Output same as sloppy mode._\n\n### Sloppy mode with AnnexB\n\nParsed with script goal with AnnexB rules enabled and as if the code did not start with strict mode header.\n\n_Output same as sloppy mode._\n\n### Module goal with AnnexB\n\nParsed with the module goal with AnnexB rules enabled.\n\n_Output same as sloppy mode._\n\n## AST Printer\n\nPrinter output different from input [sloppy][annexb:no]:\n\n````js\nf = {eval(b){\"use strict\";}};\n````\n\nProduces same AST\n"} +{"text": "RUN: llvm-readobj --coff-imports %p/Inputs/imports.exe.coff-i386 | FileCheck -check-prefix=X86 %s\nRUN: llvm-readobj --coff-imports %p/Inputs/imports.exe.coff-x86-64 | FileCheck -check-prefix=X64 %s\n\nX86: Import {\nX86-NEXT: Name: KERNEL32.dll\nX86-NEXT: ImportLookupTableRVA: 0x2108\nX86-NEXT: ImportAddressTableRVA: 0x2000\nX86-NEXT: Symbol: ExitProcess (337)\nX86-NEXT: Symbol: GetProcAddress (669)\nX86-NEXT: Symbol: FreeLibrary (414)\nX86-NEXT: Symbol: GetLastError (592)\nX86-NEXT: Symbol: RaiseException (1087)\nX86-NEXT: Symbol: LoadLibraryExA (934)\nX86-NEXT: }\nX86-NEXT: Import {\nX86-NEXT: Name: USER32.dll\nX86-NEXT: ImportLookupTableRVA: 0x2124\nX86-NEXT: ImportAddressTableRVA: 0x201C\nX86-NEXT: Symbol: MessageBoxA (582)\nX86-NEXT: }\nX86-NEXT: Import {\nX86-NEXT: Name: mydll.dll\nX86-NEXT: ImportLookupTableRVA: 0x212C\nX86-NEXT: ImportAddressTableRVA: 0x2024\nX86-NEXT: Symbol: Func1 (0)\nX86-NEXT: Symbol: Func2 (1)\nX86-NEXT: Symbol: (3)\nX86-NEXT: }\nX86-NEXT: DelayImport {\nX86-NEXT: Name: lazyload.dll\nX86-NEXT: Attributes: 0x1\nX86-NEXT: ModuleHandle: 0x301C\nX86-NEXT: ImportAddressTable: 0x3010\nX86-NEXT: ImportNameTable: 0x2090\nX86-NEXT: BoundDelayImportTable: 0x20AC\nX86-NEXT: UnloadDelayImportTable: 0x0\nX86-NEXT: Import {\nX86-NEXT: Symbol: Func5 (0)\nX86-NEXT: Address: 0x401073\nX86-NEXT: }\nX86-NEXT: Import {\nX86-NEXT: Symbol: Func4 (0)\nX86-NEXT: Address: 0x401052\nX86-NEXT: }\nX86-NEXT: }\n\nX64: Import {\nX64-NEXT: Name: KERNEL32.dll\nX64-NEXT: ImportLookupTableRVA: 0x2170\nX64-NEXT: ImportAddressTableRVA: 0x2000\nX64-NEXT: Symbol: ExitProcess (343)\nX64-NEXT: Symbol: GetProcAddress (676)\nX64-NEXT: Symbol: FreeLibrary (420)\nX64-NEXT: Symbol: GetLastError (598)\nX64-NEXT: Symbol: RaiseException (1091)\nX64-NEXT: Symbol: LoadLibraryExA (937)\nX64-NEXT: }\nX64-NEXT: Import {\nX64-NEXT: Name: USER32.dll\nX64-NEXT: ImportLookupTableRVA: 0x21A8\nX64-NEXT: ImportAddressTableRVA: 0x2038\nX64-NEXT: Symbol: MessageBoxA (586)\nX64-NEXT: }\nX64-NEXT: Import {\nX64-NEXT: Name: mydll.dll\nX64-NEXT: ImportLookupTableRVA: 0x21B8\nX64-NEXT: ImportAddressTableRVA: 0x2048\nX64-NEXT: Symbol: Func1 (0)\nX64-NEXT: Symbol: Func2 (1)\nX64-NEXT: Symbol: (3)\nX64-NEXT: }\nX64-NEXT: DelayImport {\nX64-NEXT: Name: lazyload.dll\nX64-NEXT: Attributes: 0x1\nX64-NEXT: ModuleHandle: 0x3028\nX64-NEXT: ImportAddressTable: 0x3010\nX64-NEXT: ImportNameTable: 0x20E0\nX64-NEXT: BoundDelayImportTable: 0x2108\nX64-NEXT: UnloadDelayImportTable: 0x0\nX64-NEXT: Import {\nX64-NEXT: Symbol: Func5 (0)\nX64-NEXT: Address: 0x1400010F1\nX64-NEXT: }\nX64-NEXT: Import {\nX64-NEXT: Symbol: Func4 (0)\nX64-NEXT: Address: 0x140001066\nX64-NEXT: }\nX64-NEXT: }\n"} +{"text": "# -*- coding: utf-8 -*-\nimport re\nfrom pathlib import Path\n\nROOT = Path(__file__).parent\n\nwith open(str(ROOT / 'html_style.css'), 'r') as f:\n style = f.read()\n# end with\n\n\ndef get_value():\n return _minify(style)\n# end def\n\n\ndef _minify(css):\n result = ''\n\n # remove comments - this will break IE<6 comment hacks\n css = re.sub(r'/\\*[\\s\\S]*?\\*/', \"\", css)\n\n # url() doesn't need quotes\n #css = re.sub(r'url\\(([\"\\'])([^)]*)\\1\\)', r'url(\\2)', css)\n\n # spaces may be safely collapsed as generated content will collapse them anyway\n css = re.sub(r'\\s+', ' ', css)\n\n # shorten collapsable colors: #aabbcc to #abc\n css = re.sub(\n r'#([0-9a-f])\\1([0-9a-f])\\2([0-9a-f])\\3(\\s|;)', r'#\\1\\2\\3\\4', css)\n\n # fragment values can loose zeros\n css = re.sub(r':\\s*0(\\.\\d+([cm]m|e[mx]|in|p[ctx]))\\s*;', r':\\1;', css)\n\n for rule in re.findall(r'([^{]+){([^}]*)}', css):\n # we don't need spaces around operators\n selectors = [re.sub(r'(?<=[\\[\\(>+=])\\s+|\\s+(?=[=~^$*|>+\\]\\)])',\n r'', selector.strip()) for selector in rule[0].split(',')]\n # order is important, but we still want to discard repetitions\n properties = {}\n porder = []\n for prop in re.findall(r'(.*?):(.*?)(;|$)', rule[1]):\n key = prop[0].strip().lower()\n if key not in porder:\n porder.append(key)\n properties[key] = prop[1].strip()\n # output rule if it contains any declarations\n if properties:\n result += \"%s{%s}\" % (','.join(selectors), ''.join(\n ['%s:%s;' % (key, properties[key]) for key in porder])[:-1])\n\n return result\n# end def\n"} +{"text": "package org.jetbrains.plugins.scala.lang.refactoring.extractTrait;\n\nimport com.intellij.openapi.application.ApplicationManager;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.ui.DialogWrapper;\nimport com.intellij.refactoring.RefactoringBundle;\nimport com.intellij.refactoring.ui.PackageNameReferenceEditorCombo;\nimport com.intellij.refactoring.util.CommonRefactoringUtil;\nimport com.intellij.ui.DocumentAdapter;\nimport com.intellij.uiDesigner.core.GridConstraints;\nimport com.intellij.uiDesigner.core.GridLayoutManager;\nimport com.intellij.uiDesigner.core.Spacer;\nimport org.jetbrains.annotations.Nullable;\nimport org.jetbrains.plugins.scala.ScalaBundle;\nimport org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTemplateDefinition;\n\nimport javax.swing.*;\nimport javax.swing.event.DocumentEvent;\nimport java.awt.*;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport static org.jetbrains.plugins.scala.lang.refactoring.ScalaNamesValidator$.MODULE$;\n\n/**\n * Nikolay.Tropin\n * 2014-05-23\n */\npublic class ScalaExtractTraitDialog extends DialogWrapper {\n\n private static final String REFACTORING_NAME = ScalaBundle.message(\"extract.trait.name\");\n private static final String DESTINATION_PACKAGE_RECENT_KEY = \"ExtractTrait.RECENT_KEYS\";\n\n private final ScTemplateDefinition mySourceClass;\n private final Project myProject;\n private final List myMembers;\n private JPanel contentPane;\n private JTextField mySourceClassFld;\n private JTextField traitNameFld;\n private JLabel sourceNameLbl;\n private JLabel traitNameLbl;\n private JPanel memberSelectionPane;\n private JPanel packageSelectionPane;\n private JLabel packageLbl;\n private PackageNameReferenceEditorCombo myPackageNameField;\n\n public ScalaExtractTraitDialog(Project project, ScTemplateDefinition sourceClass) {\n super(project, false);\n mySourceClass = sourceClass;\n myProject = mySourceClass.getProject();\n myMembers = ExtractSuperUtil.possibleMembersToExtract(sourceClass);\n setTitle(ScalaBundle.message(\"extract.trait.title\"));\n init();\n setupDialog();\n updateOkStatus();\n }\n\n public List getSelectedMembers() {\n ArrayList result = new ArrayList();\n for (ScalaExtractMemberInfo info : myMembers) {\n if (info.isChecked()) {\n result.add(info);\n }\n }\n return result;\n }\n\n public String getTraitName() {\n return traitNameFld.getText();\n }\n\n public String getPackageName() {\n return myPackageNameField.getText();\n }\n\n private void setupDialog() {\n setOKButtonText(\"Refactor\");\n setOKButtonMnemonic('R');\n sourceNameLbl.setText(ScalaBundle.message(\"extract.trait.top.label.text\"));\n traitNameLbl.setText(ScalaBundle.message(\"extract.trait.name\"));\n packageLbl.setText(ScalaBundle.message(\"extract.trait.package.label\"));\n mySourceClassFld.setText(ExtractSuperUtil.classPresentableName(mySourceClass));\n\n memberSelectionPane.add(createMemberSelectionPanel(), new GridConstraints());\n myPackageNameField = createPackageNameField();\n packageSelectionPane.add(myPackageNameField, BorderLayout.CENTER);\n\n traitNameFld.getDocument().addDocumentListener(new DocumentAdapter() {\n @Override\n protected void textChanged(DocumentEvent e) {\n updateOkStatus();\n }\n });\n }\n\n private JPanel createMemberSelectionPanel() {\n String title = ScalaBundle.message(\"members.to.extract\");\n String abstractHeader = ScalaBundle.message(\"extract.abstracts\");\n return new ScalaExtractMembersSelectionPanel(title, myMembers, abstractHeader);\n }\n\n protected PackageNameReferenceEditorCombo createPackageNameField() {\n String name = ExtractSuperUtil.packageName(mySourceClass);\n return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,\n RefactoringBundle.message(\"choose.destination.package\"));\n }\n\n private void updateOkStatus() {\n setOKActionEnabled(MODULE$.isIdentifier(getTraitName()));\n }\n\n @Override\n protected void doOKAction() {\n String pckgWarning = ExtractSuperUtil.checkPackage(getPackageName(), getTraitName(), mySourceClass);\n if (pckgWarning != null) {\n showErrorMessage(pckgWarning);\n return;\n }\n\n super.doOKAction();\n }\n\n private void showErrorMessage(String message) {\n if (ApplicationManager.getApplication().isUnitTestMode()) throw new RuntimeException(message);\n CommonRefactoringUtil.showErrorMessage(REFACTORING_NAME, message, null, myProject);\n }\n\n @Nullable\n @Override\n protected JComponent createCenterPanel() {\n return contentPane;\n }\n\n @Override\n protected JComponent createContentPane() {\n return contentPane;\n }\n\n @Nullable\n @Override\n public JComponent getPreferredFocusedComponent() {\n return traitNameFld;\n }\n\n {\n// GUI initializer generated by IntelliJ IDEA GUI Designer\n// >>> IMPORTANT!! <<<\n// DO NOT EDIT OR ADD ANY CODE HERE!\n $$$setupUI$$$();\n }\n\n /**\n * Method generated by IntelliJ IDEA GUI Designer\n * >>> IMPORTANT!! <<<\n * DO NOT edit this method OR call it in your code!\n *\n * @noinspection ALL\n */\n private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n mySourceClassFld = new JTextField();\n mySourceClassFld.setEditable(false);\n mySourceClassFld.setEnabled(true);\n panel1.add(mySourceClassFld, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n sourceNameLbl = new JLabel();\n sourceNameLbl.setText(\"Extract trait from:\");\n panel1.add(sourceNameLbl, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n traitNameLbl = new JLabel();\n traitNameLbl.setText(\"Trait name:\");\n panel1.add(traitNameLbl, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n traitNameFld = new JTextField();\n panel1.add(traitNameFld, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final Spacer spacer1 = new Spacer();\n contentPane.add(spacer1, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n memberSelectionPane = new JPanel();\n memberSelectionPane.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(memberSelectionPane, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JPanel panel2 = new JPanel();\n panel2.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n packageSelectionPane = new JPanel();\n packageSelectionPane.setLayout(new BorderLayout(0, 0));\n panel2.add(packageSelectionPane, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n packageLbl = new JLabel();\n packageLbl.setText(\"Package for new trait:\");\n panel2.add(packageLbl, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }\n\n /**\n * @noinspection ALL\n */\n public JComponent $$$getRootComponent$$$() {\n return contentPane;\n }\n}\n"} +{"text": "// This work is licensed under the Creative Commons Attribution 3.0 Unported License.\n// To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/\n// or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View,\n// California, 94041, USA.\n\n// Persistence Of Vision raytracer sample file.\n// File by Dieter Bayer.\n//\n// -w320 -h240\n// -w800 -h600 +a0.3\n\n#version 3.6;\n\nglobal_settings {\n assumed_gamma 1.0\n}\n\n#include \"colors.inc\"\n\ncamera {\n location <0, 20, -100>\n angle 85 // direction <0, 0, 0.7>\n up <0, 1, 0>\n right x*image_width/image_height\n}\n\nbackground { color SkyBlue }\n\n// declare rainbow's colours\n\n#declare r_violet1 = colour red 1.0 green 0.5 blue 1.0 filter 1.0;\n#declare r_violet2 = colour red 1.0 green 0.5 blue 1.0 filter 0.8;\n#declare r_indigo = colour red 0.5 green 0.5 blue 1.0 filter 0.8;\n#declare r_blue = colour red 0.2 green 0.2 blue 1.0 filter 0.8;\n#declare r_cyan = colour red 0.2 green 1.0 blue 1.0 filter 0.8;\n#declare r_green = colour red 0.2 green 1.0 blue 0.2 filter 0.8;\n#declare r_yellow = colour red 1.0 green 1.0 blue 0.2 filter 0.8;\n#declare r_orange = colour red 1.0 green 0.5 blue 0.2 filter 0.8;\n#declare r_red1 = colour red 1.0 green 0.2 blue 0.2 filter 0.8;\n#declare r_red2 = colour red 1.0 green 0.2 blue 0.2 filter 1.0;\n\n// create the rainbow\n\nrainbow {\n angle 42.5\n width 5\n distance 1.0e7\n direction <-0.2, -0.2, 1>\n jitter 0.01\n colour_map {\n [0.000 colour r_violet1]\n [0.100 colour r_violet2]\n [0.214 colour r_indigo]\n [0.328 colour r_blue]\n [0.442 colour r_cyan]\n [0.556 colour r_green]\n [0.670 colour r_yellow]\n [0.784 colour r_orange]\n [0.900 colour r_red1]\n }\n}\n\nrainbow {\n angle 37\n width 5\n distance 1.0e7\n direction <-0.2, -0.2, 1>\n jitter 0.01\n colour_map {\n [0.000 colour r_violet1]\n [0.100 colour r_violet2]\n [0.214 colour r_indigo]\n [0.328 colour r_blue]\n [0.442 colour r_cyan]\n [0.556 colour r_green]\n [0.670 colour r_yellow]\n [0.784 colour r_orange]\n [0.900 colour r_red1]\n }\n}\n\nsky_sphere {\n pigment {\n gradient y\n color_map {\n [0 colour SkyBlue]\n [1 colour MidnightBlue]\n }\n scale 2\n translate <-1, -1, -1>\n }\n}\n\n/* Put down the beloved famous raytrace green/yellow checkered floor */\nplane { y, -10\n pigment {\n checker colour Yellow colour Green\n scale 20\n }\n finish {\n ambient 0.2\n diffuse 0.8\n }\n}\n\nsphere { <0, 25, 0>, 40\n\n pigment {Red}\n finish {\n ambient 0.2\n diffuse 0.6\n phong 1.0\n phong_size 20\n }\n}\n\nsphere { <-100, 150, 200>, 20\n pigment {Magenta}\n finish {\n ambient 0.2\n diffuse 0.6\n phong 1.0\n phong_size 20\n }\n}\n\nsphere { <100, 25, 100>, 30\n pigment {Red}\n finish {\n ambient 0.2\n diffuse 0.6\n phong 1.0\n phong_size 20\n }\n}\n\nlight_source {<100, 120, 40> colour White}\n"} +{"text": "; Joomla! Project\n; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.\n; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php\n; Note : All ini files need to be saved as UTF-8\n\nCOM_POSTINSTALL=\"Post-installation Messages\"\nCOM_POSTINSTALL_BTN_HIDE=\"Hide this message\"\nCOM_POSTINSTALL_BTN_RESET=\"Reset Messages\"\nCOM_POSTINSTALL_CONFIGURATION=\"Post-installation Messages: Options\"\nCOM_POSTINSTALL_LBL_MESSAGES=\"Post-installation and Upgrade Messages\"\nCOM_POSTINSTALL_LBL_NOMESSAGES_DESC=\"You have read all the messages.\"\nCOM_POSTINSTALL_LBL_NOMESSAGES_TITLE=\"No Messages\"\nCOM_POSTINSTALL_LBL_RELEASENEWS=\"Release news from the Joomla! Project\"\nCOM_POSTINSTALL_LBL_SINCEVERSION=\"Since version %s\"\nCOM_POSTINSTALL_MESSAGES_FOR=\"Showing messages for\"\nCOM_POSTINSTALL_MESSAGES_TITLE=\"Post-installation Messages for %s\"\nCOM_POSTINSTALL_XML_DESCRIPTION=\"Displays post-installation and post-upgrade messages for Joomla and its extensions.\"\n"} +{"text": "package com.twitter.util.tunable\n\nimport org.scalatest.funsuite.AnyFunSuite\n\nclass ServiceLoadedTunableTestClient1 extends ServiceLoadedTunableMap with TunableMap.Proxy {\n\n private val tunableMap = TunableMap.newMutable()\n\n tunableMap.put(\"tunableId1\", \"foo\")\n tunableMap.put(\"tunableId2\", 5)\n\n protected def underlying: TunableMap = tunableMap\n def id: String = \"client1\"\n}\n\nclass ServiceLoadedTunableTestClient2 extends ServiceLoadedTunableMap with TunableMap.Proxy {\n protected def underlying: TunableMap = NullTunableMap\n def id: String = \"client2\"\n}\n\nclass ServiceLoadedTunableTestClient2Dup extends ServiceLoadedTunableMap with TunableMap.Proxy {\n protected def underlying: TunableMap = NullTunableMap\n def id: String = \"client2\"\n}\n\nclass ServiceLoadedTunableMapTest extends AnyFunSuite {\n\n test(\n \"IllegalArgumentException thrown when there is more than one ServiceLoadedTunableMap \" +\n \"for a given serviceName/id\"\n ) {\n\n val ex = intercept[IllegalStateException] {\n ServiceLoadedTunableMap(\"client2\")\n }\n assert(ex.getMessage.contains(\"Found multiple `ServiceLoadedTunableMap`s for client2\"))\n }\n\n test(\"NullTunableMap returned when no matches\") {\n intercept[IllegalStateException] {\n val tunableMap = ServiceLoadedTunableMap(\"Non-existent-id\")\n assert(tunableMap eq NullTunableMap)\n }\n }\n\n test(\"TunableMap returned when there is one match for id\") {\n intercept[IllegalStateException] {\n\n val tunableMap = ServiceLoadedTunableMap(\"client1\")\n\n assert(tunableMap.entries.size == 2)\n assert(tunableMap(TunableMap.Key[String](\"tunableId1\"))() == Some(\"foo\"))\n assert(tunableMap(TunableMap.Key[Int](\"tunableId2\"))() == Some(5))\n }\n }\n}\n"} +{"text": "// boost cast.hpp header file ----------------------------------------------//\n\n// (C) Copyright Kevlin Henney and Dave Abrahams 1999.\n// Distributed under the Boost\n// Software License, Version 1.0. (See accompanying file\n// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n\n// See http://www.boost.org/libs/conversion for Documentation.\n\n// Revision History\n// 23 JUN 05 Code extracted from /boost/cast.hpp into this new header.\n// Keeps this legacy version of numeric_cast<> for old compilers\n// wich can't compile the new version in /boost/numeric/conversion/cast.hpp\n// (Fernando Cacciola)\n// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included\n// instead (the workaround did not\n// actually compile when BOOST_NO_LIMITS was defined in\n// any case, so we loose nothing). (John Maddock)\n// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never\n// worked with stock GCC; trying to get it to do that broke\n// vc-stlport.\n// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.\n// Removed unused BOOST_EXPLICIT_TARGET macro. Moved\n// boost::detail::type to boost/type.hpp. Made it compile with\n// stock gcc again (Dave Abrahams)\n// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal\n// Review (Beman Dawes)\n// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams)\n// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC\n// (Dave Abrahams)\n// 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams)\n// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes)\n// 27 Jun 00 More MSVC6 workarounds\n// 15 Jun 00 Add workarounds for MSVC6\n// 2 Feb 00 Remove bad_numeric_cast \";\" syntax error (Doncho Angelov)\n// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)\n// 29 Dec 99 Change using declarations so usages in other namespaces work\n// correctly (Dave Abrahams)\n// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors\n// as suggested Darin Adler and improved by Valentin Bonnard.\n// 2 Sep 99 Remove controversial asserts, simplify, rename.\n// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast,\n// place in nested namespace.\n// 3 Aug 99 Initial version\n\n#ifndef BOOST_OLD_NUMERIC_CAST_HPP\n#define BOOST_OLD_NUMERIC_CAST_HPP\n\n# include \n# include \n# include \n# include \n# include \n# include \n\n// It has been demonstrated numerous times that MSVC 6.0 fails silently at link\n// time if you use a template function which has template parameters that don't\n// appear in the function's argument list.\n//\n// TODO: Add this to config.hpp?\n// FLC: This macro is repeated in boost/cast.hpp but only locally (is undefined at the bottom)\n// so is OK to reproduce it here.\n# if defined(BOOST_MSVC) && BOOST_MSVC < 1300\n# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type* = 0\n# else\n# define BOOST_EXPLICIT_DEFAULT_TARGET\n# endif\n\nnamespace boost\n{\n using numeric::bad_numeric_cast;\n\n// LEGACY numeric_cast [only for some old broken compilers] --------------------------------------//\n\n// Contributed by Kevlin Henney\n\n// numeric_cast ------------------------------------------------------------//\n\n#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)\n\n namespace detail\n {\n template \n struct signed_numeric_limits : std::numeric_limits\n {\n static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()\n {\n return (std::numeric_limits::min)() >= 0\n // unary minus causes integral promotion, thus the static_cast<>\n ? static_cast(-(std::numeric_limits::max)())\n : (std::numeric_limits::min)();\n };\n };\n\n // Move to namespace boost in utility.hpp?\n template \n struct fixed_numeric_limits_base\n : public if_true< std::numeric_limits::is_signed >\n ::BOOST_NESTED_TEMPLATE then< signed_numeric_limits,\n std::numeric_limits\n >::type\n {};\n\n template \n struct fixed_numeric_limits\n : fixed_numeric_limits_base::is_specialized)>\n {};\n\n# ifdef BOOST_HAS_LONG_LONG\n // cover implementations which supply no specialization for long\n // long / unsigned long long. Not intended to be full\n // numeric_limits replacements, but good enough for numeric_cast<>\n template <>\n struct fixed_numeric_limits_base< ::boost::long_long_type, false>\n {\n BOOST_STATIC_CONSTANT(bool, is_specialized = true);\n BOOST_STATIC_CONSTANT(bool, is_signed = true);\n static ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()\n {\n# ifdef LONGLONG_MAX\n return LONGLONG_MAX;\n# else\n return 9223372036854775807LL; // hope this is portable\n# endif\n }\n\n static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()\n {\n# ifdef LONGLONG_MIN\n return LONGLONG_MIN;\n# else\n return -( 9223372036854775807LL )-1; // hope this is portable\n# endif\n }\n };\n\n template <>\n struct fixed_numeric_limits_base< ::boost::ulong_long_type, false>\n {\n BOOST_STATIC_CONSTANT(bool, is_specialized = true);\n BOOST_STATIC_CONSTANT(bool, is_signed = false);\n static ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()\n {\n# ifdef ULONGLONG_MAX\n return ULONGLONG_MAX;\n# else\n return 0xffffffffffffffffULL; // hope this is portable\n# endif\n }\n\n static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }\n };\n# endif\n } // namespace detail\n\n// less_than_type_min -\n // x_is_signed should be numeric_limits::is_signed\n // y_is_signed should be numeric_limits::is_signed\n // y_min should be numeric_limits::min()\n //\n // check(x, y_min) returns true iff x < y_min without invoking comparisons\n // between signed and unsigned values.\n //\n // \"poor man's partial specialization\" is in use here.\n template \n struct less_than_type_min\n {\n template \n static bool check(X x, Y y_min)\n { return x < y_min; }\n };\n\n template <>\n struct less_than_type_min\n {\n template \n static bool check(X, Y)\n { return false; }\n };\n\n template <>\n struct less_than_type_min\n {\n template \n static bool check(X x, Y)\n { return x < 0; }\n };\n\n // greater_than_type_max -\n // same_sign should be:\n // numeric_limits::is_signed == numeric_limits::is_signed\n // y_max should be numeric_limits::max()\n //\n // check(x, y_max) returns true iff x > y_max without invoking comparisons\n // between signed and unsigned values.\n //\n // \"poor man's partial specialization\" is in use here.\n template \n struct greater_than_type_max;\n\n template<>\n struct greater_than_type_max\n {\n template \n static inline bool check(X x, Y y_max)\n { return x > y_max; }\n };\n\n template <>\n struct greater_than_type_max\n {\n // What does the standard say about this? I think it's right, and it\n // will work with every compiler I know of.\n template \n static inline bool check(X x, Y)\n { return x >= 0 && static_cast(static_cast(x)) != x; }\n\n# if defined(BOOST_MSVC) && BOOST_MSVC < 1300\n // MSVC6 can't static_cast unsigned __int64 -> floating types\n# define BOOST_UINT64_CAST(src_type) \\\n static inline bool check(src_type x, unsigned __int64) \\\n { \\\n if (x < 0) return false; \\\n unsigned __int64 y = static_cast(x); \\\n bool odd = y & 0x1; \\\n __int64 div2 = static_cast<__int64>(y >> 1); \\\n return ((static_cast(div2) * 2.0) + odd) != x; \\\n }\n\n BOOST_UINT64_CAST(long double);\n BOOST_UINT64_CAST(double);\n BOOST_UINT64_CAST(float);\n# undef BOOST_UINT64_CAST\n# endif\n };\n\n template<>\n struct greater_than_type_max\n {\n template \n static inline bool check(X x, Y y_max)\n { return x > y_max; }\n };\n\n template <>\n struct greater_than_type_max\n {\n // What does the standard say about this? I think it's right, and it\n // will work with every compiler I know of.\n template \n static inline bool check(X x, Y)\n { return static_cast(static_cast(x)) != x; }\n };\n\n#else // use #pragma hacks if available\n\n namespace detail\n {\n# if BOOST_MSVC\n# pragma warning(push)\n# pragma warning(disable : 4018)\n# pragma warning(disable : 4146)\n#elif defined(__BORLANDC__)\n# pragma option push -w-8041\n# endif\n\n // Move to namespace boost in utility.hpp?\n template \n struct fixed_numeric_limits : public std::numeric_limits\n {\n static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()\n {\n return std::numeric_limits::is_signed && (std::numeric_limits::min)() >= 0\n ? T(-(std::numeric_limits::max)()) : (std::numeric_limits::min)();\n }\n };\n\n# if BOOST_MSVC\n# pragma warning(pop)\n#elif defined(__BORLANDC__)\n# pragma option pop\n# endif\n } // namespace detail\n\n#endif\n\n template\n inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)\n {\n // typedefs abbreviating respective trait classes\n typedef detail::fixed_numeric_limits arg_traits;\n typedef detail::fixed_numeric_limits result_traits;\n\n#if defined(BOOST_STRICT_CONFIG) \\\n || (!defined(__HP_aCC) || __HP_aCC > 33900) \\\n && (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \\\n || defined(BOOST_SGI_CPP_LIMITS))\n // typedefs that act as compile time assertions\n // (to be replaced by boost compile time assertions\n // as and when they become available and are stable)\n typedef bool argument_must_be_numeric[arg_traits::is_specialized];\n typedef bool result_must_be_numeric[result_traits::is_specialized];\n\n const bool arg_is_signed = arg_traits::is_signed;\n const bool result_is_signed = result_traits::is_signed;\n const bool same_sign = arg_is_signed == result_is_signed;\n\n if (less_than_type_min::check(arg, (result_traits::min)())\n || greater_than_type_max::check(arg, (result_traits::max)())\n )\n\n#else // We need to use #pragma hacks if available\n\n# if BOOST_MSVC\n# pragma warning(push)\n# pragma warning(disable : 4018)\n#elif defined(__BORLANDC__)\n#pragma option push -w-8012\n# endif\n if ((arg < 0 && !result_traits::is_signed) // loss of negative range\n || (arg_traits::is_signed && arg < (result_traits::min)()) // underflow\n || arg > (result_traits::max)()) // overflow\n# if BOOST_MSVC\n# pragma warning(pop)\n#elif defined(__BORLANDC__)\n#pragma option pop\n# endif\n#endif\n {\n throw bad_numeric_cast();\n }\n return static_cast(arg);\n } // numeric_cast\n\n# undef BOOST_EXPLICIT_DEFAULT_TARGET\n\n} // namespace boost\n\n#endif // BOOST_OLD_NUMERIC_CAST_HPP\n"} +{"text": "name: \"BHS\"\nurl: \"http://www.bhs.com.br\"\n"} +{"text": "/* Glazed Lists (c) 2003-2006 */\n/* http://publicobject.com/glazedlists/ publicobject.com,*/\n/* O'Dell Engineering Ltd.*/\npackage ca.odell.glazedlists.impl.gui;\n\nimport ca.odell.glazedlists.GlazedLists;\nimport ca.odell.glazedlists.gui.AbstractTableComparatorChooser;\nimport ca.odell.glazedlists.gui.AdvancedTableFormat;\nimport ca.odell.glazedlists.gui.TableFormat;\nimport ca.odell.glazedlists.impl.sort.ComparatorChain;\nimport ca.odell.glazedlists.impl.sort.ReverseComparator;\nimport ca.odell.glazedlists.impl.sort.TableColumnComparator;\n\nimport java.beans.PropertyChangeListener;\nimport java.beans.PropertyChangeSupport;\nimport java.util.*;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\n/**\n * Keep track of which columns are sorted and how. This is\n * largely independent of how that state is applied to a\n * SortedList, which is managed independently by\n * TableComparatorChooser.\n *\n *

Users must explicity call {@link #fireSortingChanged()} in order\n * to prepare a new Comparator for the target table.\n *\n * @author Jesse Wilson\n */\npublic class SortingState {\n\n /** this regular expression for parsing the string representation of a column */\n private static final Pattern FROM_STRING_PATTERN = Pattern.compile(\"^\\\\s*column\\\\s+(\\\\d+)(\\\\s+comparator\\\\s+(\\\\d+))?(\\\\s+(reversed))?\\\\s*$\", Pattern.CASE_INSENSITIVE);\n\n /** the sorting style on a column is used for icon choosing */\n protected static final int COLUMN_UNSORTED = 0;\n protected static final int COLUMN_PRIMARY_SORTED = 1;\n protected static final int COLUMN_PRIMARY_SORTED_REVERSE = 2;\n protected static final int COLUMN_PRIMARY_SORTED_ALTERNATE = 3;\n protected static final int COLUMN_PRIMARY_SORTED_ALTERNATE_REVERSE = 4;\n protected static final int COLUMN_SECONDARY_SORTED = 5;\n protected static final int COLUMN_SECONDARY_SORTED_REVERSE = 6;\n protected static final int COLUMN_SECONDARY_SORTED_ALTERNATE = 7;\n protected static final int COLUMN_SECONDARY_SORTED_ALTERNATE_REVERSE = 8;\n\n /** the columns and their click counts in indexed order */\n protected List sortingColumns;\n\n /** a list that contains all ColumnClickTrackers with non-zero click counts in their visitation order */\n protected List recentlyClickedColumns = new ArrayList<>(2);\n\n private final AbstractTableComparatorChooser tableComparatorChooser;\n\n /** whom to notify when the sorting state is chaged */\n private final PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);\n\n public SortingState(AbstractTableComparatorChooser tableComparatorChooser) {\n this.tableComparatorChooser = tableComparatorChooser;\n }\n\n public AbstractTableComparatorChooser getTableComparatorChooser() {\n return tableComparatorChooser;\n }\n\n public void fireSortingChanged() {\n changeSupport.firePropertyChange(\"comparator\", null, null);\n }\n public void addPropertyChangeListener(PropertyChangeListener listener) {\n changeSupport.addPropertyChangeListener(listener);\n }\n public void removePropertyChangeListener(PropertyChangeListener listener) {\n changeSupport.removePropertyChangeListener(listener);\n }\n\n public Comparator buildComparator() {\n // build a new comparator\n if(recentlyClickedColumns.isEmpty()) {\n return null;\n } else {\n List> comparators = new ArrayList<>(recentlyClickedColumns.size());\n for(Iterator i = recentlyClickedColumns.iterator(); i.hasNext(); ) {\n SortingColumn sortingColumn = i.next();\n Comparator comparator = sortingColumn.getComparator();\n if(comparator == null) throw new IllegalStateException();\n comparators.add(comparator);\n }\n\n return GlazedLists.chainComparators(comparators);\n }\n }\n\n /**\n * @return the indices of the columns currently being sorted.\n */\n public List getSortingColumnIndexes() {\n final List sortingColumns = new ArrayList<>();\n final List recentlyClickedColumns = getRecentlyClickedColumns();\n for(int c = 0; c < recentlyClickedColumns.size(); c++) {\n SortingState.SortingColumn clickedColumn = recentlyClickedColumns.get(c);\n sortingColumns.add(new Integer(clickedColumn.getColumn()));\n }\n return sortingColumns;\n }\n\n public void appendComparator(int column, int comparatorIndex, boolean reverse) {\n if(column > getColumns().size()) throw new IllegalArgumentException(\"invalid column \" + column + \", must be in range 0, \" + sortingColumns.size());\n if(comparatorIndex >= sortingColumns.get(column).getComparators().size()) throw new IllegalArgumentException(\"invalid comparator index \" + comparatorIndex + \", must be in range 0, \" + sortingColumns.get(column).getComparators().size());\n if(recentlyClickedColumns.contains(getColumns().get(column))) return;\n\n // add clicks to the specified column\n SortingColumn sortingColumn = sortingColumns.get(column);\n sortingColumn.setComparatorIndex(comparatorIndex);\n sortingColumn.setReverse(reverse);\n\n // rebuild the clicked column list\n recentlyClickedColumns.add(sortingColumn);\n }\n\n public void detectStateFromComparator(Comparator foreignComparator) {\n // Clear the current click counts\n clearComparators();\n\n // Populate a list of Comparators\n final List comparatorsList;\n if(foreignComparator == null) {\n comparatorsList = Collections.emptyList();\n } else if(foreignComparator instanceof ComparatorChain) {\n ComparatorChain chain = (ComparatorChain)foreignComparator;\n comparatorsList = Arrays.asList(chain.getComparators());\n } else {\n comparatorsList = Collections.singletonList(foreignComparator);\n }\n\n // walk through the list of Comparators and assign click counts\n for(Iterator i = comparatorsList.iterator(); i.hasNext(); ) {\n // get the current comparator\n Comparator comparator = i.next();\n boolean reverse = false;\n if(comparator instanceof ReverseComparator) {\n reverse = true;\n comparator = ((ReverseComparator)comparator).getSourceComparator();\n }\n\n // discover where to add clicks for this comparator\n for(int c = 0; c < sortingColumns.size(); c++) {\n if(recentlyClickedColumns.contains(sortingColumns.get(c))) {\n continue;\n }\n int comparatorIndex = sortingColumns.get(c).getComparators().indexOf(comparator);\n if(comparatorIndex != -1) {\n final SortingColumn columnClickTracker = sortingColumns.get(c);\n columnClickTracker.setComparatorIndex(comparatorIndex);\n columnClickTracker.setReverse(reverse);\n recentlyClickedColumns.add(columnClickTracker);\n }\n }\n }\n }\n\n public void clearComparators() {\n // clear the click counts\n for(Iterator i = recentlyClickedColumns.iterator(); i.hasNext(); ) {\n SortingColumn sortingColumn = i.next();\n sortingColumn.clear();\n }\n recentlyClickedColumns.clear();\n }\n\n /**\n * When the column model is changed, this resets the column clicks and\n * comparator list for each column.\n */\n public void rebuildColumns(TableFormat tableFormat) {\n // build the column click trackers\n final int columnCount = tableFormat.getColumnCount();\n\n sortingColumns = new ArrayList<>(columnCount);\n for(int i = 0; i < columnCount; i++) {\n sortingColumns.add(createSortingColumn(tableFormat, i));\n }\n\n recentlyClickedColumns.clear();\n }\n\n protected SortingColumn createSortingColumn(TableFormat tableFormat, int columnIndex) {\n return new SortingColumn(tableFormat, columnIndex);\n }\n\n public List getColumns() {\n return sortingColumns;\n }\n\n public List getRecentlyClickedColumns() {\n return recentlyClickedColumns;\n }\n\n @Override\n public String toString() {\n final StringBuffer result = new StringBuffer();\n for(Iterator i = getSortingColumnIndexes().iterator(); i.hasNext();) {\n final int columnIndex = i.next().intValue();\n final SortingState.SortingColumn sortingColumn = getColumns().get(columnIndex);\n\n // write the column index\n result.append(\"column \");\n result.append(columnIndex);\n\n // write the comparator index\n final int comparatorIndex = sortingColumn.getComparatorIndex();\n if(comparatorIndex != 0) {\n result.append(\" comparator \");\n result.append(comparatorIndex);\n }\n\n // write reversed\n if(sortingColumn.isReverse()) {\n result.append(\" reversed\");\n }\n\n // add a comma if more columns exist\n if (i.hasNext()) {\n result.append(\", \");\n }\n }\n return result.toString();\n }\n\n public void fromString(String stringEncoded) {\n clearComparators();\n\n // parse each column part in sequence using regex groups\n String[] parts = stringEncoded.split(\",\");\n for(int p = 0; p < parts.length; p++) {\n // skip empty strings\n if(parts[p].trim().length() == 0) continue;\n\n Matcher matcher = FROM_STRING_PATTERN.matcher(parts[p]);\n\n if(!matcher.find())\n throw new IllegalArgumentException(\"Failed to parse column spec, \\\"\" + parts[p] + \"\\\"\");\n\n int columnIndex = Integer.parseInt(matcher.group(1));\n int comparatorIndex = matcher.group(3) == null ? 0 : Integer.parseInt(matcher.group(3));\n boolean reversedComparator = matcher.group(5) != null;\n\n // bail on invalid data\n if(columnIndex >= sortingColumns.size()) continue;\n if(comparatorIndex >= sortingColumns.get(columnIndex).getComparators().size()) continue;\n\n // add this comparator in sequence\n appendComparator(columnIndex, comparatorIndex, reversedComparator);\n }\n\n }\n\n public class SortingColumn {\n /** the column whose sorting state is being managed */\n private final int column;\n /** the sequence of comparators for this column */\n private final List comparators = new ArrayList<>(1);\n /** whether this column is sorted in reverse order */\n private boolean reverse = false;\n /** the comparator in the comparator list to sort by */\n private int comparatorIndex = -1;\n\n\n public SortingColumn(TableFormat tableFormat, int column) {\n this.column = column;\n\n // add the preferred comparator for AdvancedTableFormat\n if(tableFormat instanceof AdvancedTableFormat) {\n AdvancedTableFormat advancedTableFormat = (AdvancedTableFormat)tableFormat;\n Comparator columnComparator = advancedTableFormat.getColumnComparator(column);\n if(columnComparator != null) comparators.add(new TableColumnComparator(tableFormat, column, columnComparator));\n // otherwise just add the default comparator\n } else {\n comparators.add(new TableColumnComparator(tableFormat, column));\n }\n }\n\n public void clear() {\n this.reverse = false;\n this.comparatorIndex = -1;\n }\n\n public int getColumn() {\n return column;\n }\n\n /**\n * Gets the index of the comparator to use for this column.\n */\n public void setComparatorIndex(int comparatorIndex) {\n assert(comparatorIndex < comparators.size());\n this.comparatorIndex = comparatorIndex;\n }\n public int getComparatorIndex() {\n return comparatorIndex;\n }\n\n /**\n * Gets the list of comparators for this column.\n */\n public List getComparators() {\n return comparators;\n }\n\n /**\n * Gets the current best comparator to sort this column.\n */\n public Comparator getComparator() {\n if(comparatorIndex == -1) return null;\n Comparator comparator = comparators.get(getComparatorIndex());\n if(isReverse()) comparator = GlazedLists.reverseComparator(comparator);\n return comparator;\n }\n\n /**\n * Get whether this column is in reverse order.\n */\n public boolean isReverse() {\n return reverse;\n }\n public void setReverse(boolean reverse) {\n this.reverse = reverse;\n }\n\n /**\n * Gets the sorting style for this column.\n */\n public int getSortingStyle() {\n if(comparatorIndex == -1) return COLUMN_UNSORTED;\n boolean primaryColumn = !recentlyClickedColumns.isEmpty() && recentlyClickedColumns.get(0) == this;\n boolean primaryComparator = getComparatorIndex() == 0;\n\n if(primaryColumn) {\n if(!isReverse()) {\n if(primaryComparator) return COLUMN_PRIMARY_SORTED;\n else return COLUMN_PRIMARY_SORTED_ALTERNATE;\n } else {\n if(primaryComparator) return COLUMN_PRIMARY_SORTED_REVERSE;\n else return COLUMN_PRIMARY_SORTED_ALTERNATE_REVERSE;\n }\n } else {\n if(!isReverse()) {\n if(primaryComparator) return COLUMN_SECONDARY_SORTED;\n else return COLUMN_SECONDARY_SORTED_ALTERNATE;\n } else {\n if(primaryComparator) return COLUMN_SECONDARY_SORTED_REVERSE;\n else return COLUMN_SECONDARY_SORTED_ALTERNATE_REVERSE;\n }\n }\n }\n }\n}"} +{"text": "\npackage mage.cards.f;\n\nimport java.util.UUID;\nimport mage.ObjectColor;\nimport mage.abilities.Ability;\nimport mage.abilities.common.SimpleStaticAbility;\nimport mage.abilities.effects.ContinuousEffectImpl;\nimport mage.abilities.keyword.ProtectionAbility;\nimport mage.cards.CardImpl;\nimport mage.cards.CardSetInfo;\nimport mage.constants.*;\nimport mage.filter.FilterCard;\nimport mage.filter.FilterPermanent;\nimport mage.filter.StaticFilters;\nimport mage.filter.common.FilterCreaturePermanent;\nimport mage.filter.predicate.Predicates;\nimport mage.filter.predicate.mageobject.ColorPredicate;\nimport mage.filter.predicate.mageobject.ConvertedManaCostPredicate;\nimport mage.game.Game;\nimport mage.game.permanent.Permanent;\n\n/**\n *\n * @author emerald000\n */\npublic final class FavorOfTheMighty extends CardImpl {\n\n public FavorOfTheMighty(UUID ownerId, CardSetInfo setInfo) {\n super(ownerId, setInfo, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, \"{1}{W}\");\n this.subtype.add(SubType.GIANT);\n\n // Each creature with the highest converted mana cost has protection from all colors.\n this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new FavorOfTheMightyEffect()));\n }\n\n public FavorOfTheMighty(final FavorOfTheMighty card) {\n super(card);\n }\n\n @Override\n public FavorOfTheMighty copy() {\n return new FavorOfTheMighty(this);\n }\n}\n\n@SuppressWarnings(\"unchecked\")\nclass FavorOfTheMightyEffect extends ContinuousEffectImpl {\n\n private static final FilterCard filter = new FilterCard(\"all colors\");\n\n static {\n filter.add(Predicates.or(\n new ColorPredicate(ObjectColor.WHITE),\n new ColorPredicate(ObjectColor.BLUE),\n new ColorPredicate(ObjectColor.BLACK),\n new ColorPredicate(ObjectColor.RED),\n new ColorPredicate(ObjectColor.GREEN)));\n }\n\n FavorOfTheMightyEffect() {\n super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);\n this.staticText = \"Each creature with the highest converted mana cost has protection from all colors.\";\n }\n\n FavorOfTheMightyEffect(final FavorOfTheMightyEffect effect) {\n super(effect);\n }\n\n @Override\n public FavorOfTheMightyEffect copy() {\n return new FavorOfTheMightyEffect(this);\n }\n\n @Override\n public boolean apply(Game game, Ability source) {\n int maxCMC = Integer.MIN_VALUE;\n for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {\n if (permanent != null && permanent.getConvertedManaCost() > maxCMC) {\n maxCMC = permanent.getConvertedManaCost();\n }\n }\n FilterPermanent filterMaxCMC = new FilterCreaturePermanent();\n filterMaxCMC.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, maxCMC));\n for (Permanent permanent : game.getBattlefield().getActivePermanents(filterMaxCMC, source.getControllerId(), game)) {\n if (permanent != null) {\n permanent.addAbility(new ProtectionAbility(filter), source.getSourceId(), game);\n }\n }\n return true;\n }\n}\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.drill.exec.physical.impl.svremover;\n\nimport org.apache.drill.exec.record.VectorContainer;\nimport org.apache.drill.exec.record.VectorAccessible;\n\npublic interface Copier {\n void setup(VectorAccessible incoming, VectorContainer outgoing);\n int copyRecords(int index, int recordCount);\n int appendRecord(int index);\n int appendRecords(int index, int recordCount);\n}\n"} +{"text": "function [F,B]=solveFB(I,alpha)\n [h,w,c]=size(I);\n mask=(alpha>=0.02).*(alpha<=0.98);\n [Gx,Gy,Gd1,Gd2]=getGMatByMask(w,h,mask);\n G=[Gx;Gy;Gd1;Gd2];\n Ga=G*alpha(:);\n wgf=abs(Ga).^0.5+0.003*repmat((1-alpha(:)),4,1);\n wgb=abs(Ga).^0.5+0.003*repmat(alpha(:),4,1);\n\n \n wf=(alpha(:)>0.98)*100+0.03*alpha(:).*(alpha(:)>0.7)+0.01*(alpha(:)<0.02);\n wb=(alpha(:)<0.02)*100+0.03*(1-alpha(:)).*(alpha(:)<0.3)+0.01*(alpha(:)>0.98);\n \n \n wgf=spdiags(wgf(:),0,length(wgf),length(wgf));\n wgb=spdiags(wgb(:),0,length(wgb),length(wgb)); \n wf=spdiags(wf(:),0,length(wf),length(wf));\n wb=spdiags(wb(:),0,length(wb),length(wb)); \n \n \n for t=1:c\n tI=I(:,:,t);\n Ag=[wgf*G,sparse(size(G,1),size(G,2));sparse(size(G,1),size(G,2)),wgb* ...\n G];\n bg=zeros(size(Ag,1),1);\n Ai=[wf,sparse(w*h,w*h);sparse(w*h,w*h),wb];\n bi=[wf*tI(:).*(alpha(:)>0.02);wb*tI(:).*(alpha(:)<0.98)];\n As=[spdiags(alpha(:),0,w*h,w*h),spdiags(1-alpha(:),0,w*h,w*h)];\n bs=tI(:);\n A=[Ai;As;Ag];\n b=[bi;bs;bg];\n x=(A'*A)\\(A'*b);\n F(:,:,t)=reshape(x(1:w*h),h,w);\n B(:,:,t)=reshape(x(w*h+1:end),h,w);\n\n end "} +{"text": "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nnamespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel\n{\n using System.Collections.Generic;\n using Microsoft.VisualStudio.TestPlatform.ObjectModel;\n\n ///

\n /// The discovery complete payload.\n /// \n public class DiscoveryCompletePayload\n {\n /// \n /// Gets or sets the total number of tests discovered.\n /// \n public long TotalTests { get; set; }\n\n /// \n /// Gets or sets the last chunk of discovered tests.\n /// \n public IEnumerable LastDiscoveredTests { get; set; }\n\n /// \n /// Gets or sets a value indicating whether discovery was aborted.\n /// \n public bool IsAborted { get; set; }\n\n /// \n /// Gets or sets the Metrics\n /// \n public IDictionary Metrics { get; set; }\n }\n}\n"} +{"text": "\n@protocol P1\n- (void)protoMethod;\n- (void)protoMethodWithParam:(int)param;\n@end\n\n@protocol P3\n- (void)protoMethod;\n@end\n\n@protocol P2 \n- (void)protoMethod;\n@end\n\n@interface A\n- (void)method;\n- (void)protoMethod;\n+ (void)methodWithParam:(int)param;\n@end\n\n@interface B : A \n- (void)method;\n- (void)protoMethod;\n@end\n\n@implementation B\n- (void)method { }\n+ (void)methodWithParam:(int)param { }\n@end\n\n@protocol P4 \n- (void)protoMethod;\n@end\n\n@interface B(cat) \n- (void)protoMethod;\n@end\n\n@interface B2\n@end\n\n@interface B2(cat)\n-(void)meth;\n@end\n\n@interface I2 : B2\n@end\n\n@implementation I2\n-(void)meth { }\n@end\n\n@protocol P5\n-(void)kol;\n-(void)kol;\n@end\n\n@protocol P6\n@property (readonly) id prop1;\n@property (readonly) id prop2;\n-(void)meth;\n@end\n\n@interface I3 \n@property (readwrite) id prop1;\n@property (readonly) id bar;\n@end\n\n@interface I3()\n@property (readwrite) id prop2;\n@property (readwrite) id bar;\n-(void)meth;\n@end\n\n@interface B4\n-(id)prop;\n-(void)setProp:(id)prop;\n@end\n\n@interface I4 : B4\n@property (assign) id prop;\n@end\n\n@interface B5\n@end\n\n@interface I5 : B5\n-(void)meth;\n@end\n\n@interface B5(cat)\n-(void)meth;\n@end\n\n@implementation I5\n-(void)meth{}\n@end\n\n// RUN: c-index-test -test-load-source local %s | FileCheck %s\n// CHECK: overrides.m:12:9: ObjCInstanceMethodDecl=protoMethod:12:9 [Overrides @3:9]\n// CHECK: overrides.m:22:9: ObjCInstanceMethodDecl=method:22:9 [Overrides @16:9]\n// CHECK: overrides.m:23:9: ObjCInstanceMethodDecl=protoMethod:23:9 [Overrides @8:9, @12:9, @17:9, @32:9]\n// CHECK: overrides.m:27:9: ObjCInstanceMethodDecl=method:27:9 (Definition) [Overrides @16:9]\n// CHECK: overrides.m:28:9: ObjCClassMethodDecl=methodWithParam::28:9 (Definition) [Overrides @18:9]\n// CHECK: overrides.m:32:9: ObjCInstanceMethodDecl=protoMethod:32:9 [Overrides @8:9]\n// CHECK: overrides.m:36:9: ObjCInstanceMethodDecl=protoMethod:36:9 [Overrides @8:9, @12:9, @17:9, @32:9]\n// CHECK: overrides.m:50:8: ObjCInstanceMethodDecl=meth:50:8 (Definition) [Overrides @43:8]\n// CHECK: overrides.m:55:8: ObjCInstanceMethodDecl=kol:55:8 Extent=[55:1 - 55:12]\n// CHECK: overrides.m:65:26: ObjCInstanceMethodDecl=prop1:65:26 [Overrides @59:25] Extent=[65:26 - 65:31]\n// CHECK: overrides.m:65:26: ObjCInstanceMethodDecl=setProp1::65:26 Extent=[65:26 - 65:31]\n// CHECK: overrides.m:70:26: ObjCInstanceMethodDecl=prop2:70:26 [Overrides @60:25] Extent=[70:26 - 70:31]\n// CHECK: overrides.m:70:26: ObjCInstanceMethodDecl=setProp2::70:26 Extent=[70:26 - 70:31]\n// CHECK: overrides.m:71:26: ObjCInstanceMethodDecl=setBar::71:26 Extent=[71:26 - 71:29]\n// CHECK: overrides.m:72:8: ObjCInstanceMethodDecl=meth:72:8 [Overrides @61:8] Extent=[72:1 - 72:13]\n// CHECK: overrides.m:81:23: ObjCInstanceMethodDecl=prop:81:23 [Overrides @76:6] Extent=[81:23 - 81:27]\n// CHECK: overrides.m:81:23: ObjCInstanceMethodDecl=setProp::81:23 [Overrides @77:8] Extent=[81:23 - 81:27]\n// CHECK: overrides.m:92:8: ObjCInstanceMethodDecl=meth:92:8 Extent=[92:1 - 92:13]\n// CHECK: overrides.m:95:17: ObjCImplementationDecl=I5:95:17 (Definition) Extent=[95:1 - 97:2]\n// CHECK: overrides.m:96:8: ObjCInstanceMethodDecl=meth:96:8 (Definition) [Overrides @92:8] Extent=[96:1 - 96:14]\n"} +{"text": "// Copyright 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\npackage org.chromium.chrome.browser.payments.ui;\n\n/**\n * The line item on the bill.\n */\npublic class LineItem {\n private final String mLabel;\n private final String mCurrency;\n private final String mPrice;\n private final boolean mIsPending;\n\n /**\n * Builds a line item.\n *\n * @param label The line item label.\n * @param currency The currency code.\n * @param price The price string.\n * @param isPending Whether the price is pending.\n */\n public LineItem(String label, String currency, String price, boolean isPending) {\n mLabel = label;\n mCurrency = currency;\n mPrice = price;\n mIsPending = isPending;\n }\n\n /**\n * Returns the label of this line item. For example, “CA state tax”.\n *\n * @return The label of this line item.\n */\n public String getLabel() {\n return mLabel;\n }\n\n /**\n * Returns the currency code string of this line item. For example, “USD”.\n *\n * @return The currency code string of this line item.\n */\n public String getCurrency() {\n return mCurrency;\n }\n\n /**\n * Returns the price string of this line item. For example, “$10.00”.\n *\n * @return The price string of this line item.\n */\n public String getPrice() {\n return mPrice;\n }\n\n /** @return Whether the price is pending. */\n public boolean getIsPending() {\n return mIsPending;\n }\n}\n"} +{"text": "\n\n \n \n \n \n\n"} +{"text": ".. :changelog:\n\nRelease History\n===============\n\n0.1.0\n++++++\n* Initial release.\n"} +{"text": "package com.googlecode.aviator.example;\n\nimport com.googlecode.aviator.AviatorEvaluator;\nimport com.googlecode.aviator.Options;\n\npublic class TraceEvalExample {\n\n public static void main(String[] args) {\n AviatorEvaluator.setOption(Options.TRACE_EVAL, true);\n AviatorEvaluator.exec(\"a + b * c\", 1, 2, 3);\n AviatorEvaluator.exec(\"a && b && c\", true, false, true);\n }\n}\n"} +{"text": "/*\n * IsoApplet: A Java Card PKI applet aimiing for ISO 7816 compliance.\n * Copyright (C) 2014 Philip Wendland (wendlandphilip@gmail.com)\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\npackage net.pwendland.javacard.pki.isoapplet;\n\nimport net.pwendland.javacard.pki.isoapplet.UtilTLV;\n\n/**\n * \\brief The File class acting as superclass for any file.\n */\npublic abstract class File {\n private final short fileID;\n private DedicatedFile parentDF;\n\n final byte[] fci;\n private final short aclPos;\n\n /* Access Control Operations */\n public static final byte ACL_OP_DELETE_SELF = (byte) 0x01;\n\n public static final byte ACL_OP_CREATE_DF = (byte) 0x02;\n public static final byte ACL_OP_CREATE_EF = (byte) 0x03;\n public static final byte ACL_OP_DELETE_CHILD = (byte) 0x04;\n\n public static final byte ACL_OP_WRITE = (byte) 0x05;\n public static final byte ACL_OP_UPDATE_ERASE = (byte) 0x06;\n public static final byte ACL_OP_READ_SEARCH = (byte) 0x07;\n\n /**\n * \\brief Abstract constructor to be called by subclasses.\n *\n * \\param fileID The ID of the file.\n *\n * \\param fileControlInformation The FCI according to ISO 7816-4 table 12. Necessary tags: 82, 83. No copy is made.\n */\n public File(short fileID, byte[] fileControlInformation) {\n this.fileID = fileID;\n this.parentDF = null;\n this.fci = fileControlInformation;\n // Save the position of the ACL (Value field) in the FCI for performance reasons.\n // If the position is -1, then every action may be performed.\n this.aclPos = UtilTLV.findTag(fci, (short) 2, fci[(short)1], (byte) 0x86);\n }\n\n /**\n * \\brief Get the relevant ACL byte for the operation.\n *\n * \\param flag_operation The operation. One of ACL_OP_*.\n *\n * \\return The ACL byte.\n */\n public byte getACLRequirements(byte flag_operation) {\n if(aclPos == -1) {\n return (byte) 0x00; // Any operation is allowed if there is no ACL.\n }\n\n switch(flag_operation) {\n case ACL_OP_DELETE_SELF:\n return fci[(short)(aclPos+3)];\n\n case ACL_OP_WRITE:\n case ACL_OP_CREATE_DF:\n return fci[(short)(aclPos+7)];\n\n case ACL_OP_UPDATE_ERASE:\n case ACL_OP_CREATE_EF:\n return fci[(short)(aclPos+8)];\n\n case ACL_OP_READ_SEARCH:\n case ACL_OP_DELETE_CHILD:\n return fci[(short)(aclPos+9)];\n\n default:\n return (byte) 0xFF; // No access for unknown actions.\n }\n }\n\n /**\n * \\brief Get the file identifier.\n *\n * \\return The file ID.\n */\n public short getFileID() {\n return this.fileID;\n }\n\n /**\n * \\brief Get the parent Dedicated File (DF).\n *\n * \\return The parent DF or null if the file had not been added yet.\n */\n public DedicatedFile getParentDF() {\n return this.parentDF;\n }\n\n /**\n * \\brief Set the parent Dedicated File (DF).\n *\n * \\param parent the parent DF.\n */\n public void setParentDF(DedicatedFile parent) {\n this.parentDF = parent;\n }\n\n /**\n * \\brief Get the File Control Information (FCI).\n *\n * \\return The FCI array.\n */\n public byte[] getFileControlInformation() {\n return this.fci;\n }\n\n\n}\n"} +{"text": "#include \n\ntypedef struct sim_gain_noise {\n double mean;\n double range;\n} sim_gain_noise_t;\n\n\ngain_entry_t* connectivity[TOSSIM_MAX_NODES + 1];\nsim_gain_noise_t localNoise[TOSSIM_MAX_NODES + 1];\ndouble sensitivity = 4.0;\n\ngain_entry_t* sim_gain_allocate_link(int mote);\nvoid sim_gain_deallocate_link(gain_entry_t* linkToDelete);\n\ngain_entry_t* sim_gain_first(int src) __attribute__ ((C, spontaneous)) {\n if (src > TOSSIM_MAX_NODES) {\n return connectivity[TOSSIM_MAX_NODES];\n } \n return connectivity[src];\n}\n\ngain_entry_t* sim_gain_next(gain_entry_t* currentLink) __attribute__ ((C, spontaneous)) {\n return currentLink->next;\n}\n\nvoid sim_gain_add(int src, int dest, double gain) __attribute__ ((C, spontaneous)) {\n gain_entry_t* current;\n int temp = sim_node();\n if (src > TOSSIM_MAX_NODES) {\n src = TOSSIM_MAX_NODES;\n }\n sim_set_node(src);\n\n current = sim_gain_first(src);\n while (current != NULL) {\n if (current->mote == dest) {\n sim_set_node(temp);\n break;\n }\n current = current->next;\n }\n\n if (current == NULL) {\n current = sim_gain_allocate_link(dest);\n current->next = connectivity[src];\n connectivity[src] = current;\n }\n current->mote = dest;\n current->gain = gain;\n dbg(\"Gain\", \"Adding link from %i to %i with gain %f\\n\", src, dest, gain);\n sim_set_node(temp);\n}\n\ndouble sim_gain_value(int src, int dest) __attribute__ ((C, spontaneous)) {\n gain_entry_t* current;\n int temp = sim_node();\n sim_set_node(src);\n current = sim_gain_first(src);\n while (current != NULL) {\n if (current->mote == dest) {\n sim_set_node(temp);\n dbg(\"Gain\", \"Getting link from %i to %i with gain %f\\n\", src, dest, current->gain);\n return current->gain;\n }\n current = current->next;\n }\n sim_set_node(temp);\n dbg(\"Gain\", \"Getting default link from %i to %i with gain %f\\n\", src, dest, 1.0);\n return 1.0;\n}\n\nbool sim_gain_connected(int src, int dest) __attribute__ ((C, spontaneous)) {\n gain_entry_t* current;\n int temp = sim_node();\n sim_set_node(src);\n current = sim_gain_first(src);\n while (current != NULL) {\n if (current->mote == dest) {\n sim_set_node(temp);\n return TRUE;\n }\n current = current->next;\n }\n sim_set_node(temp);\n return FALSE;\n}\n \nvoid sim_gain_remove(int src, int dest) __attribute__ ((C, spontaneous)) {\n gain_entry_t* current;\n gain_entry_t* prevLink;\n int temp = sim_node();\n \n if (src > TOSSIM_MAX_NODES) {\n src = TOSSIM_MAX_NODES;\n }\n\n sim_set_node(src);\n \n current = sim_gain_first(src);\n prevLink = NULL;\n \n while (current != NULL) {\n gain_entry_t* tmp;\n if (current->mote == dest) {\n if (prevLink == NULL) {\n\tconnectivity[src] = current->next;\n }\n else {\n\tprevLink->next = current->next;\n }\n tmp = current->next;\n sim_gain_deallocate_link(current);\n current = tmp;\n }\n else {\n prevLink = current;\n current = current->next;\n }\n }\n sim_set_node(temp);\n}\n\nvoid sim_gain_set_noise_floor(int node, double mean, double range) __attribute__ ((C, spontaneous)) {\n if (node > TOSSIM_MAX_NODES) {\n node = TOSSIM_MAX_NODES;\n }\n localNoise[node].mean = mean;\n localNoise[node].range = range;\n}\n\ndouble sim_gain_noise_mean(int node) {\n if (node > TOSSIM_MAX_NODES) {\n node = TOSSIM_MAX_NODES;\n }\n return localNoise[node].mean;\n}\n\ndouble sim_gain_noise_range(int node) {\n if (node > TOSSIM_MAX_NODES) {\n node = TOSSIM_MAX_NODES;\n }\n return localNoise[node].range;\n}\n\n// Pick a number a number from the uniform distribution of\n// [mean-range, mean+range].\ndouble sim_gain_sample_noise(int node) __attribute__ ((C, spontaneous)) {\n double val, adjust;\n if (node > TOSSIM_MAX_NODES) {\n node = TOSSIM_MAX_NODES;\n } \n val = localNoise[node].mean;\n adjust = (sim_random() % 2000000);\n adjust /= 1000000.0;\n adjust -= 1.0;\n adjust *= localNoise[node].range;\n return val + adjust;\n}\n\ngain_entry_t* sim_gain_allocate_link(int mote) {\n gain_entry_t* newLink = (gain_entry_t*)malloc(sizeof(gain_entry_t));\n newLink->next = NULL;\n newLink->mote = mote;\n newLink->gain = -10000000.0;\n return newLink;\n}\n\nvoid sim_gain_deallocate_link(gain_entry_t* linkToDelete) __attribute__ ((C, spontaneous)) {\n free(linkToDelete);\n}\n\nvoid sim_gain_set_sensitivity(double s) __attribute__ ((C, spontaneous)) {\n sensitivity = s;\n}\n\ndouble sim_gain_sensitivity() __attribute__ ((C, spontaneous)) {\n return sensitivity;\n}\n"} +{"text": "\r\n\r\n\r\n\tLeaflet debug page\r\n\r\n\t\r\n\r\n\t\r\n\r\n\t\r\n\r\n\r\n\r\n\t
\r\n\r\n\t\r\n\r\n\r\n"} +{"text": "//====== Copyright 1996-2018, Valve Corporation, All rights reserved. =======\n//\n// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all \n// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers.\n//\t\t\tFor more info including a getting started guide for developers \n//\t\t\tplease visit: https://partner.steamgames.com/doc/features/steam_controller\n//\n//=============================================================================\n\n#ifndef ISTEAMINPUT_H\n#define ISTEAMINPUT_H\n#ifdef _WIN32\n#pragma once\t\n#endif\n\n#include \"steam_api_common.h\"\n\n#define STEAM_INPUT_MAX_COUNT 16\n\n#define STEAM_INPUT_MAX_ANALOG_ACTIONS 16\n\n#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 128\n\n#define STEAM_INPUT_MAX_ORIGINS 8\n\n// When sending an option to a specific controller handle, you can send to all devices via this command\n#define STEAM_INPUT_HANDLE_ALL_CONTROLLERS UINT64_MAX\n\n#define STEAM_INPUT_MIN_ANALOG_ACTION_DATA -1.0f\n#define STEAM_INPUT_MAX_ANALOG_ACTION_DATA 1.0f\n\nenum EInputSource\n{\n\tk_EInputSource_None,\n\tk_EInputSource_LeftTrackpad,\n\tk_EInputSource_RightTrackpad,\n\tk_EInputSource_Joystick,\n\tk_EInputSource_ABXY,\n\tk_EInputSource_Switch,\n\tk_EInputSource_LeftTrigger,\n\tk_EInputSource_RightTrigger,\n\tk_EInputSource_LeftBumper,\n\tk_EInputSource_RightBumper,\n\tk_EInputSource_Gyro,\n\tk_EInputSource_CenterTrackpad,\t\t// PS4\n\tk_EInputSource_RightJoystick,\t\t// Traditional Controllers\n\tk_EInputSource_DPad,\t\t\t\t// Traditional Controllers\n\tk_EInputSource_Key, // Keyboards with scan codes - Unused\n\tk_EInputSource_Mouse, // Traditional mouse - Unused\n\tk_EInputSource_LeftGyro,\t\t\t// Secondary Gyro - Switch - Unused\n\tk_EInputSource_Count\n};\n\nenum EInputSourceMode\n{\n\tk_EInputSourceMode_None,\n\tk_EInputSourceMode_Dpad,\n\tk_EInputSourceMode_Buttons,\n\tk_EInputSourceMode_FourButtons,\n\tk_EInputSourceMode_AbsoluteMouse,\n\tk_EInputSourceMode_RelativeMouse,\n\tk_EInputSourceMode_JoystickMove,\n\tk_EInputSourceMode_JoystickMouse,\n\tk_EInputSourceMode_JoystickCamera,\n\tk_EInputSourceMode_ScrollWheel,\n\tk_EInputSourceMode_Trigger,\n\tk_EInputSourceMode_TouchMenu,\n\tk_EInputSourceMode_MouseJoystick,\n\tk_EInputSourceMode_MouseRegion,\n\tk_EInputSourceMode_RadialMenu,\n\tk_EInputSourceMode_SingleButton,\n\tk_EInputSourceMode_Switches\n};\n\n// Note: Please do not use action origins as a way to identify controller types. There is no\n// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead.\n// Versions of Steam that add new controller types in the future will extend this enum so if you're\n// using a lookup table please check the bounds of any origins returned by Steam.\nenum EInputActionOrigin\n{\n\t// Steam Controller\n\tk_EInputActionOrigin_None,\n\tk_EInputActionOrigin_SteamController_A,\n\tk_EInputActionOrigin_SteamController_B,\n\tk_EInputActionOrigin_SteamController_X,\n\tk_EInputActionOrigin_SteamController_Y,\n\tk_EInputActionOrigin_SteamController_LeftBumper,\n\tk_EInputActionOrigin_SteamController_RightBumper,\n\tk_EInputActionOrigin_SteamController_LeftGrip,\n\tk_EInputActionOrigin_SteamController_RightGrip,\n\tk_EInputActionOrigin_SteamController_Start,\n\tk_EInputActionOrigin_SteamController_Back,\n\tk_EInputActionOrigin_SteamController_LeftPad_Touch,\n\tk_EInputActionOrigin_SteamController_LeftPad_Swipe,\n\tk_EInputActionOrigin_SteamController_LeftPad_Click,\n\tk_EInputActionOrigin_SteamController_LeftPad_DPadNorth,\n\tk_EInputActionOrigin_SteamController_LeftPad_DPadSouth,\n\tk_EInputActionOrigin_SteamController_LeftPad_DPadWest,\n\tk_EInputActionOrigin_SteamController_LeftPad_DPadEast,\n\tk_EInputActionOrigin_SteamController_RightPad_Touch,\n\tk_EInputActionOrigin_SteamController_RightPad_Swipe,\n\tk_EInputActionOrigin_SteamController_RightPad_Click,\n\tk_EInputActionOrigin_SteamController_RightPad_DPadNorth,\n\tk_EInputActionOrigin_SteamController_RightPad_DPadSouth,\n\tk_EInputActionOrigin_SteamController_RightPad_DPadWest,\n\tk_EInputActionOrigin_SteamController_RightPad_DPadEast,\n\tk_EInputActionOrigin_SteamController_LeftTrigger_Pull,\n\tk_EInputActionOrigin_SteamController_LeftTrigger_Click,\n\tk_EInputActionOrigin_SteamController_RightTrigger_Pull,\n\tk_EInputActionOrigin_SteamController_RightTrigger_Click,\n\tk_EInputActionOrigin_SteamController_LeftStick_Move,\n\tk_EInputActionOrigin_SteamController_LeftStick_Click,\n\tk_EInputActionOrigin_SteamController_LeftStick_DPadNorth,\n\tk_EInputActionOrigin_SteamController_LeftStick_DPadSouth,\n\tk_EInputActionOrigin_SteamController_LeftStick_DPadWest,\n\tk_EInputActionOrigin_SteamController_LeftStick_DPadEast,\n\tk_EInputActionOrigin_SteamController_Gyro_Move,\n\tk_EInputActionOrigin_SteamController_Gyro_Pitch,\n\tk_EInputActionOrigin_SteamController_Gyro_Yaw,\n\tk_EInputActionOrigin_SteamController_Gyro_Roll,\n\tk_EInputActionOrigin_SteamController_Reserved0,\n\tk_EInputActionOrigin_SteamController_Reserved1,\n\tk_EInputActionOrigin_SteamController_Reserved2,\n\tk_EInputActionOrigin_SteamController_Reserved3,\n\tk_EInputActionOrigin_SteamController_Reserved4,\n\tk_EInputActionOrigin_SteamController_Reserved5,\n\tk_EInputActionOrigin_SteamController_Reserved6,\n\tk_EInputActionOrigin_SteamController_Reserved7,\n\tk_EInputActionOrigin_SteamController_Reserved8,\n\tk_EInputActionOrigin_SteamController_Reserved9,\n\tk_EInputActionOrigin_SteamController_Reserved10,\n\t\n\t// PS4 Dual Shock\n\tk_EInputActionOrigin_PS4_X,\n\tk_EInputActionOrigin_PS4_Circle,\n\tk_EInputActionOrigin_PS4_Triangle,\n\tk_EInputActionOrigin_PS4_Square,\n\tk_EInputActionOrigin_PS4_LeftBumper,\n\tk_EInputActionOrigin_PS4_RightBumper,\n\tk_EInputActionOrigin_PS4_Options,\t//Start\n\tk_EInputActionOrigin_PS4_Share,\t\t//Back\n\tk_EInputActionOrigin_PS4_LeftPad_Touch,\n\tk_EInputActionOrigin_PS4_LeftPad_Swipe,\n\tk_EInputActionOrigin_PS4_LeftPad_Click,\n\tk_EInputActionOrigin_PS4_LeftPad_DPadNorth,\n\tk_EInputActionOrigin_PS4_LeftPad_DPadSouth,\n\tk_EInputActionOrigin_PS4_LeftPad_DPadWest,\n\tk_EInputActionOrigin_PS4_LeftPad_DPadEast,\n\tk_EInputActionOrigin_PS4_RightPad_Touch,\n\tk_EInputActionOrigin_PS4_RightPad_Swipe,\n\tk_EInputActionOrigin_PS4_RightPad_Click,\n\tk_EInputActionOrigin_PS4_RightPad_DPadNorth,\n\tk_EInputActionOrigin_PS4_RightPad_DPadSouth,\n\tk_EInputActionOrigin_PS4_RightPad_DPadWest,\n\tk_EInputActionOrigin_PS4_RightPad_DPadEast,\n\tk_EInputActionOrigin_PS4_CenterPad_Touch,\n\tk_EInputActionOrigin_PS4_CenterPad_Swipe,\n\tk_EInputActionOrigin_PS4_CenterPad_Click,\n\tk_EInputActionOrigin_PS4_CenterPad_DPadNorth,\n\tk_EInputActionOrigin_PS4_CenterPad_DPadSouth,\n\tk_EInputActionOrigin_PS4_CenterPad_DPadWest,\n\tk_EInputActionOrigin_PS4_CenterPad_DPadEast,\n\tk_EInputActionOrigin_PS4_LeftTrigger_Pull,\n\tk_EInputActionOrigin_PS4_LeftTrigger_Click,\n\tk_EInputActionOrigin_PS4_RightTrigger_Pull,\n\tk_EInputActionOrigin_PS4_RightTrigger_Click,\n\tk_EInputActionOrigin_PS4_LeftStick_Move,\n\tk_EInputActionOrigin_PS4_LeftStick_Click,\n\tk_EInputActionOrigin_PS4_LeftStick_DPadNorth,\n\tk_EInputActionOrigin_PS4_LeftStick_DPadSouth,\n\tk_EInputActionOrigin_PS4_LeftStick_DPadWest,\n\tk_EInputActionOrigin_PS4_LeftStick_DPadEast,\n\tk_EInputActionOrigin_PS4_RightStick_Move,\n\tk_EInputActionOrigin_PS4_RightStick_Click,\n\tk_EInputActionOrigin_PS4_RightStick_DPadNorth,\n\tk_EInputActionOrigin_PS4_RightStick_DPadSouth,\n\tk_EInputActionOrigin_PS4_RightStick_DPadWest,\n\tk_EInputActionOrigin_PS4_RightStick_DPadEast,\n\tk_EInputActionOrigin_PS4_DPad_North,\n\tk_EInputActionOrigin_PS4_DPad_South,\n\tk_EInputActionOrigin_PS4_DPad_West,\n\tk_EInputActionOrigin_PS4_DPad_East,\n\tk_EInputActionOrigin_PS4_Gyro_Move,\n\tk_EInputActionOrigin_PS4_Gyro_Pitch,\n\tk_EInputActionOrigin_PS4_Gyro_Yaw,\n\tk_EInputActionOrigin_PS4_Gyro_Roll,\n\tk_EInputActionOrigin_PS4_Reserved0,\n\tk_EInputActionOrigin_PS4_Reserved1,\n\tk_EInputActionOrigin_PS4_Reserved2,\n\tk_EInputActionOrigin_PS4_Reserved3,\n\tk_EInputActionOrigin_PS4_Reserved4,\n\tk_EInputActionOrigin_PS4_Reserved5,\n\tk_EInputActionOrigin_PS4_Reserved6,\n\tk_EInputActionOrigin_PS4_Reserved7,\n\tk_EInputActionOrigin_PS4_Reserved8,\n\tk_EInputActionOrigin_PS4_Reserved9,\n\tk_EInputActionOrigin_PS4_Reserved10,\n\n\t// XBox One\n\tk_EInputActionOrigin_XBoxOne_A,\n\tk_EInputActionOrigin_XBoxOne_B,\n\tk_EInputActionOrigin_XBoxOne_X,\n\tk_EInputActionOrigin_XBoxOne_Y,\n\tk_EInputActionOrigin_XBoxOne_LeftBumper,\n\tk_EInputActionOrigin_XBoxOne_RightBumper,\n\tk_EInputActionOrigin_XBoxOne_Menu, //Start\n\tk_EInputActionOrigin_XBoxOne_View, //Back\n\tk_EInputActionOrigin_XBoxOne_LeftTrigger_Pull,\n\tk_EInputActionOrigin_XBoxOne_LeftTrigger_Click,\n\tk_EInputActionOrigin_XBoxOne_RightTrigger_Pull,\n\tk_EInputActionOrigin_XBoxOne_RightTrigger_Click,\n\tk_EInputActionOrigin_XBoxOne_LeftStick_Move,\n\tk_EInputActionOrigin_XBoxOne_LeftStick_Click,\n\tk_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth,\n\tk_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth,\n\tk_EInputActionOrigin_XBoxOne_LeftStick_DPadWest,\n\tk_EInputActionOrigin_XBoxOne_LeftStick_DPadEast,\n\tk_EInputActionOrigin_XBoxOne_RightStick_Move,\n\tk_EInputActionOrigin_XBoxOne_RightStick_Click,\n\tk_EInputActionOrigin_XBoxOne_RightStick_DPadNorth,\n\tk_EInputActionOrigin_XBoxOne_RightStick_DPadSouth,\n\tk_EInputActionOrigin_XBoxOne_RightStick_DPadWest,\n\tk_EInputActionOrigin_XBoxOne_RightStick_DPadEast,\n\tk_EInputActionOrigin_XBoxOne_DPad_North,\n\tk_EInputActionOrigin_XBoxOne_DPad_South,\n\tk_EInputActionOrigin_XBoxOne_DPad_West,\n\tk_EInputActionOrigin_XBoxOne_DPad_East,\n\tk_EInputActionOrigin_XBoxOne_Reserved0,\n\tk_EInputActionOrigin_XBoxOne_Reserved1,\n\tk_EInputActionOrigin_XBoxOne_Reserved2,\n\tk_EInputActionOrigin_XBoxOne_Reserved3,\n\tk_EInputActionOrigin_XBoxOne_Reserved4,\n\tk_EInputActionOrigin_XBoxOne_Reserved5,\n\tk_EInputActionOrigin_XBoxOne_Reserved6,\n\tk_EInputActionOrigin_XBoxOne_Reserved7,\n\tk_EInputActionOrigin_XBoxOne_Reserved8,\n\tk_EInputActionOrigin_XBoxOne_Reserved9,\n\tk_EInputActionOrigin_XBoxOne_Reserved10,\n\n\t// XBox 360\n\tk_EInputActionOrigin_XBox360_A,\n\tk_EInputActionOrigin_XBox360_B,\n\tk_EInputActionOrigin_XBox360_X,\n\tk_EInputActionOrigin_XBox360_Y,\n\tk_EInputActionOrigin_XBox360_LeftBumper,\n\tk_EInputActionOrigin_XBox360_RightBumper,\n\tk_EInputActionOrigin_XBox360_Start,\t\t//Start\n\tk_EInputActionOrigin_XBox360_Back,\t\t//Back\n\tk_EInputActionOrigin_XBox360_LeftTrigger_Pull,\n\tk_EInputActionOrigin_XBox360_LeftTrigger_Click,\n\tk_EInputActionOrigin_XBox360_RightTrigger_Pull,\n\tk_EInputActionOrigin_XBox360_RightTrigger_Click,\n\tk_EInputActionOrigin_XBox360_LeftStick_Move,\n\tk_EInputActionOrigin_XBox360_LeftStick_Click,\n\tk_EInputActionOrigin_XBox360_LeftStick_DPadNorth,\n\tk_EInputActionOrigin_XBox360_LeftStick_DPadSouth,\n\tk_EInputActionOrigin_XBox360_LeftStick_DPadWest,\n\tk_EInputActionOrigin_XBox360_LeftStick_DPadEast,\n\tk_EInputActionOrigin_XBox360_RightStick_Move,\n\tk_EInputActionOrigin_XBox360_RightStick_Click,\n\tk_EInputActionOrigin_XBox360_RightStick_DPadNorth,\n\tk_EInputActionOrigin_XBox360_RightStick_DPadSouth,\n\tk_EInputActionOrigin_XBox360_RightStick_DPadWest,\n\tk_EInputActionOrigin_XBox360_RightStick_DPadEast,\n\tk_EInputActionOrigin_XBox360_DPad_North,\n\tk_EInputActionOrigin_XBox360_DPad_South,\n\tk_EInputActionOrigin_XBox360_DPad_West,\n\tk_EInputActionOrigin_XBox360_DPad_East,\t\n\tk_EInputActionOrigin_XBox360_Reserved0,\n\tk_EInputActionOrigin_XBox360_Reserved1,\n\tk_EInputActionOrigin_XBox360_Reserved2,\n\tk_EInputActionOrigin_XBox360_Reserved3,\n\tk_EInputActionOrigin_XBox360_Reserved4,\n\tk_EInputActionOrigin_XBox360_Reserved5,\n\tk_EInputActionOrigin_XBox360_Reserved6,\n\tk_EInputActionOrigin_XBox360_Reserved7,\n\tk_EInputActionOrigin_XBox360_Reserved8,\n\tk_EInputActionOrigin_XBox360_Reserved9,\n\tk_EInputActionOrigin_XBox360_Reserved10,\n\n\n\t// Switch - Pro or Joycons used as a single input device.\n\t// This does not apply to a single joycon\n\tk_EInputActionOrigin_Switch_A,\n\tk_EInputActionOrigin_Switch_B,\n\tk_EInputActionOrigin_Switch_X,\n\tk_EInputActionOrigin_Switch_Y,\n\tk_EInputActionOrigin_Switch_LeftBumper,\n\tk_EInputActionOrigin_Switch_RightBumper,\n\tk_EInputActionOrigin_Switch_Plus,\t//Start\n\tk_EInputActionOrigin_Switch_Minus,\t//Back\n\tk_EInputActionOrigin_Switch_Capture,\n\tk_EInputActionOrigin_Switch_LeftTrigger_Pull,\n\tk_EInputActionOrigin_Switch_LeftTrigger_Click,\n\tk_EInputActionOrigin_Switch_RightTrigger_Pull,\n\tk_EInputActionOrigin_Switch_RightTrigger_Click,\n\tk_EInputActionOrigin_Switch_LeftStick_Move,\n\tk_EInputActionOrigin_Switch_LeftStick_Click,\n\tk_EInputActionOrigin_Switch_LeftStick_DPadNorth,\n\tk_EInputActionOrigin_Switch_LeftStick_DPadSouth,\n\tk_EInputActionOrigin_Switch_LeftStick_DPadWest,\n\tk_EInputActionOrigin_Switch_LeftStick_DPadEast,\n\tk_EInputActionOrigin_Switch_RightStick_Move,\n\tk_EInputActionOrigin_Switch_RightStick_Click,\n\tk_EInputActionOrigin_Switch_RightStick_DPadNorth,\n\tk_EInputActionOrigin_Switch_RightStick_DPadSouth,\n\tk_EInputActionOrigin_Switch_RightStick_DPadWest,\n\tk_EInputActionOrigin_Switch_RightStick_DPadEast,\n\tk_EInputActionOrigin_Switch_DPad_North,\n\tk_EInputActionOrigin_Switch_DPad_South,\n\tk_EInputActionOrigin_Switch_DPad_West,\n\tk_EInputActionOrigin_Switch_DPad_East,\n\tk_EInputActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon\n\tk_EInputActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon\n\tk_EInputActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon\n\tk_EInputActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon\n\tk_EInputActionOrigin_Switch_Reserved0,\n\tk_EInputActionOrigin_Switch_Reserved1,\n\tk_EInputActionOrigin_Switch_Reserved2,\n\tk_EInputActionOrigin_Switch_Reserved3,\n\tk_EInputActionOrigin_Switch_Reserved4,\n\tk_EInputActionOrigin_Switch_Reserved5,\n\tk_EInputActionOrigin_Switch_Reserved6,\n\tk_EInputActionOrigin_Switch_Reserved7,\n\tk_EInputActionOrigin_Switch_Reserved8,\n\tk_EInputActionOrigin_Switch_Reserved9,\n\tk_EInputActionOrigin_Switch_Reserved10,\n\n\t// Switch JoyCon Specific\n\tk_EInputActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro\n\tk_EInputActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro\n\tk_EInputActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro\n\tk_EInputActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro\n\tk_EInputActionOrigin_Switch_LeftGyro_Move,\n\tk_EInputActionOrigin_Switch_LeftGyro_Pitch,\n\tk_EInputActionOrigin_Switch_LeftGyro_Yaw,\n\tk_EInputActionOrigin_Switch_LeftGyro_Roll,\n\tk_EInputActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button\n\tk_EInputActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button\n\tk_EInputActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button\n\tk_EInputActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button\n\tk_EInputActionOrigin_Switch_Reserved11,\n\tk_EInputActionOrigin_Switch_Reserved12,\n\tk_EInputActionOrigin_Switch_Reserved13,\n\tk_EInputActionOrigin_Switch_Reserved14,\n\tk_EInputActionOrigin_Switch_Reserved15,\n\tk_EInputActionOrigin_Switch_Reserved16,\n\tk_EInputActionOrigin_Switch_Reserved17,\n\tk_EInputActionOrigin_Switch_Reserved18,\n\tk_EInputActionOrigin_Switch_Reserved19,\n\tk_EInputActionOrigin_Switch_Reserved20,\n\n\tk_EInputActionOrigin_Count, // If Steam has added support for new controllers origins will go here.\n\tk_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.\n};\n\nenum EXboxOrigin\n{\n\tk_EXboxOrigin_A,\n\tk_EXboxOrigin_B,\n\tk_EXboxOrigin_X,\n\tk_EXboxOrigin_Y,\n\tk_EXboxOrigin_LeftBumper,\n\tk_EXboxOrigin_RightBumper,\n\tk_EXboxOrigin_Menu, //Start\n\tk_EXboxOrigin_View, //Back\n\tk_EXboxOrigin_LeftTrigger_Pull,\n\tk_EXboxOrigin_LeftTrigger_Click,\n\tk_EXboxOrigin_RightTrigger_Pull,\n\tk_EXboxOrigin_RightTrigger_Click,\n\tk_EXboxOrigin_LeftStick_Move,\n\tk_EXboxOrigin_LeftStick_Click,\n\tk_EXboxOrigin_LeftStick_DPadNorth,\n\tk_EXboxOrigin_LeftStick_DPadSouth,\n\tk_EXboxOrigin_LeftStick_DPadWest,\n\tk_EXboxOrigin_LeftStick_DPadEast,\n\tk_EXboxOrigin_RightStick_Move,\n\tk_EXboxOrigin_RightStick_Click,\n\tk_EXboxOrigin_RightStick_DPadNorth,\n\tk_EXboxOrigin_RightStick_DPadSouth,\n\tk_EXboxOrigin_RightStick_DPadWest,\n\tk_EXboxOrigin_RightStick_DPadEast,\n\tk_EXboxOrigin_DPad_North,\n\tk_EXboxOrigin_DPad_South,\n\tk_EXboxOrigin_DPad_West,\n\tk_EXboxOrigin_DPad_East,\n\tk_EXboxOrigin_Count,\n};\n\nenum ESteamControllerPad\n{\n\tk_ESteamControllerPad_Left,\n\tk_ESteamControllerPad_Right\n};\n\nenum ESteamInputType\n{\n\tk_ESteamInputType_Unknown,\n\tk_ESteamInputType_SteamController,\n\tk_ESteamInputType_XBox360Controller,\n\tk_ESteamInputType_XBoxOneController,\n\tk_ESteamInputType_GenericGamepad,\t\t// DirectInput controllers\n\tk_ESteamInputType_PS4Controller,\n\tk_ESteamInputType_AppleMFiController,\t// Unused\n\tk_ESteamInputType_AndroidController,\t// Unused\n\tk_ESteamInputType_SwitchJoyConPair,\t\t// Unused\n\tk_ESteamInputType_SwitchJoyConSingle,\t// Unused\n\tk_ESteamInputType_SwitchProController,\n\tk_ESteamInputType_MobileTouch,\t\t\t// Steam Link App On-screen Virtual Controller\n\tk_ESteamInputType_PS3Controller,\t\t// Currently uses PS4 Origins\n\tk_ESteamInputType_Count,\n\tk_ESteamInputType_MaximumPossibleValue = 255,\n};\n\n// These values are passed into SetLEDColor\nenum ESteamInputLEDFlag\n{\n\tk_ESteamInputLEDFlag_SetColor,\n\t// Restore the LED color to the user's preference setting as set in the controller personalization menu.\n\t// This also happens automatically on exit of your game. \n\tk_ESteamInputLEDFlag_RestoreUserDefault \n};\n\n// InputHandle_t is used to refer to a specific controller.\n// This handle will consistently identify a controller, even if it is disconnected and re-connected\ntypedef uint64 InputHandle_t;\n\n\n// These handles are used to refer to a specific in-game action or action set\n// All action handles should be queried during initialization for performance reasons\ntypedef uint64 InputActionSetHandle_t;\ntypedef uint64 InputDigitalActionHandle_t;\ntypedef uint64 InputAnalogActionHandle_t;\n\n#pragma pack( push, 1 )\n\nstruct InputAnalogActionData_t\n{\n\t// Type of data coming from this action, this will match what got specified in the action set\n\tEInputSourceMode eMode;\n\t\n\t// The current state of this action; will be delta updates for mouse actions\n\tfloat x, y;\n\t\n\t// Whether or not this action is currently available to be bound in the active action set\n\tbool bActive;\n};\n\nstruct InputDigitalActionData_t\n{\n\t// The current state of this action; will be true if currently pressed\n\tbool bState;\n\t\n\t// Whether or not this action is currently available to be bound in the active action set\n\tbool bActive;\n};\n\nstruct InputMotionData_t\n{\n\t// Sensor-fused absolute rotation; will drift in heading\n\tfloat rotQuatX;\n\tfloat rotQuatY;\n\tfloat rotQuatZ;\n\tfloat rotQuatW;\n\t\n\t// Positional acceleration\n\tfloat posAccelX;\n\tfloat posAccelY;\n\tfloat posAccelZ;\n\n\t// Angular velocity\n\tfloat rotVelX;\n\tfloat rotVelY;\n\tfloat rotVelZ;\n};\n\n#pragma pack( pop )\n\n\n//-----------------------------------------------------------------------------\n// Purpose: Steam Input API\n//-----------------------------------------------------------------------------\nclass ISteamInput\n{\npublic:\n\t\n\t// Init and Shutdown must be called when starting/ending use of this interface\n\tvirtual bool Init() = 0;\n\tvirtual bool Shutdown() = 0;\n\t\n\t// Synchronize API state with the latest Steam Controller inputs available. This\n\t// is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest\n\t// possible latency, you call this directly before reading controller state. This must\n\t// be called from somewhere before GetConnectedControllers will return any handles\n\tvirtual void RunFrame() = 0;\n\n\t// Enumerate currently connected Steam Input enabled devices - developers can opt in controller by type (ex: Xbox/Playstation/etc) via\n\t// the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam.\n\t// handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles\n\t// Returns the number of handles written to handlesOut\n\tvirtual int GetConnectedControllers( InputHandle_t *handlesOut ) = 0;\n\t\n\t//-----------------------------------------------------------------------------\n\t// ACTION SETS\n\t//-----------------------------------------------------------------------------\n\n\t// Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.\n\tvirtual InputActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0;\n\t\n\t// Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive')\n\t// This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in\n\t// your state loops, instead of trying to place it in all of your state transitions.\n\tvirtual void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) = 0;\n\tvirtual InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) = 0;\n\n\t// ACTION SET LAYERS\n\tvirtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;\n\tvirtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;\n\tvirtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0;\n\tvirtual int GetActiveActionSetLayers( InputHandle_t inputHandle, InputActionSetHandle_t *handlesOut ) = 0;\n\n\t//-----------------------------------------------------------------------------\n\t// ACTIONS\n\t//-----------------------------------------------------------------------------\n\n\t// Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls.\n\tvirtual InputDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0;\n\t\n\t// Returns the current state of the supplied digital game action\n\tvirtual InputDigitalActionData_t GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) = 0;\n\t\n\t// Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.\n\t// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to\n\t// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.\n\tvirtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin *originsOut ) = 0;\n\t\n\t// Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls.\n\tvirtual InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0;\n\t\n\t// Returns the current state of these supplied analog game action\n\tvirtual InputAnalogActionData_t GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) = 0;\n\n\t// Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.\n\t// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to\n\t// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.\n\tvirtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin *originsOut ) = 0;\n\t\n\t// Get a local path to art for on-screen glyph for a particular origin - this call is cheap\n\tvirtual const char *GetGlyphForActionOrigin( EInputActionOrigin eOrigin ) = 0;\n\t\n\t// Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized\n\tvirtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0;\n\n\t// Stop analog momentum for the action if it is a mouse action in trackball mode\n\tvirtual void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) = 0;\n\n\t// Returns raw motion data from the specified device\n\tvirtual InputMotionData_t GetMotionData( InputHandle_t inputHandle ) = 0;\n\n\t//-----------------------------------------------------------------------------\n\t// OUTPUTS\n\t//-----------------------------------------------------------------------------\n\n\t// Trigger a vibration event on supported controllers - Steam will translate these commands into haptic pulses for Steam Controllers\n\tvirtual void TriggerVibration( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0;\n\n\t// Set the controller LED color on supported controllers. nFlags is a bitmask of values from ESteamInputLEDFlag - 0 will default to setting a color. Steam will handle\n\t// the behavior on exit of your program so you don't need to try restore the default as you are shutting down\n\tvirtual void SetLEDColor( InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0;\n\n\t// Trigger a haptic pulse on a Steam Controller - if you are approximating rumble you may want to use TriggerVibration instead.\n\t// Good uses for Haptic pulses include chimes, noises, or directional gameplay feedback (taking damage, footstep locations, etc).\n\tvirtual void TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0;\n\n\t// Trigger a haptic pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. If you are approximating rumble you may want to use TriggerVibration instead.\n\t// nFlags is currently unused and reserved for future use.\n\tvirtual void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0;\n\n\t//-----------------------------------------------------------------------------\n\t// Utility functions available without using the rest of Steam Input API\n\t//-----------------------------------------------------------------------------\n\n\t// Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode\n\t// If the user is not in Big Picture Mode it will open up the binding in a new window\n\tvirtual bool ShowBindingPanel( InputHandle_t inputHandle ) = 0;\n\n\t// Returns the input type for a particular handle\n\tvirtual ESteamInputType GetInputTypeForHandle( InputHandle_t inputHandle ) = 0;\n\n\t// Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions\n\t// to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input\n\tvirtual InputHandle_t GetControllerForGamepadIndex( int nIndex ) = 0;\n\n\t// Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index\n\tvirtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0;\n\t\n\t// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap.\n\tvirtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0;\n\n\t// Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized.\n\tvirtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0;\n\n\t// Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for\n\t// non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration\n\tvirtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0;\n\n\t// Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None\n\t// When a new input type is added you will be able to pass in k_ESteamInputType_Unknown amd the closest origin that your version of the SDK recognized will be returned\n\t// ex: if a Playstation 5 controller was released this function would return Playstation 4 origins.\n\tvirtual EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ) = 0;\n};\n\n#define STEAMINPUT_INTERFACE_VERSION \"SteamInput001\"\n\n// Global interface accessor\ninline ISteamInput *SteamInput();\nSTEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInput *, SteamInput, STEAMINPUT_INTERFACE_VERSION );\n\n#endif // ISTEAMINPUT_H\n"} +{"text": "var test = require('tape');\nvar expand = require('..');\n\ntest('x and y of same type', function(t) {\n t.deepEqual(expand('{a..9}'), ['{a..9}']);\n t.end();\n});\n"} +{"text": "@border: #4d4d4d;\n//@light: #dddddd;\n\nmd-input-container {\n margin: 4px 0px;\n}\n\na {\n color: inherit;\n text-decoration: none;\n}\n\nmd-toast.md-dark-theme {\n .md-toast-content {\n background-color: #666;\n }\n}\n\nmd-card {\n border-radius: 0;\n}\n"} +{"text": "Getting Started With FOSRestBundle\n==================================\n\n.. toctree::\n :hidden:\n\n 1-setting_up_the_bundle\n 2-the-view-layer\n empty-content-status-code\n 3-listener-support\n view_response_listener\n body_listener\n request_body_converter_listener\n format_listener\n versioning\n param_fetcher_listener\n 4-exception-controller-support\n annotations-reference\n\nInstallation\n------------\n\nInstallation is a quick (I promise!) one-step process:\n\n1. :doc:`Setting up the bundle <1-setting_up_the_bundle>`\n\nBundle usage\n------------\n\nBefore you start using the bundle it is advised you run a quick look over the\nsix sections listed below. This bundle contains many features that are loosely\ncoupled so you may or may not need to use all of them. This bundle is just a\ntool to help you in the job of creating a REST API with Symfony.\n\nFOSRestBundle provides several tools to assist in building REST applications:\n\n- :doc:`The view layer <2-the-view-layer>`\n- :doc:`Listener support <3-listener-support>`\n- :doc:`ExceptionController support <4-exception-controller-support>`\n\nConfig reference\n----------------\n\n- Run ``bin/console config:dump-reference fos_rest`` for a reference of\n the available configuration options\n- :doc:`Annotations reference ` for a reference on\n the available configurations through annotations\n\nExample applications\n--------------------\n\nThe following bundles/applications use the FOSRestBundle and can be used as a\nguideline:\n\n- The `FOSCommentBundle`_ uses FOSRestBundle for its API.\n\n- The `Symfony2 Rest Edition`_ provides a complete example of how to build a\n controller that works for both HTML as well as JSON/XML.\n\n.. _`FOSCommentBundle`: https://github.com/FriendsOfSymfony/FOSCommentBundle\n.. _`Symfony2 Rest Edition`: https://github.com/gimler/symfony-rest-edition\n"} +{"text": "/*\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.\n * All rights reserved.\n */\n\n/** \\file\n * \\ingroup edtransform\n */\n\n#include \"DNA_mesh_types.h\"\n\n#include \"MEM_guardedalloc.h\"\n\n#include \"BLI_math.h\"\n\n#include \"BKE_context.h\"\n#include \"BKE_editmesh.h\"\n#include \"BKE_mesh.h\"\n\n#include \"transform.h\"\n#include \"transform_convert.h\"\n\n/* -------------------------------------------------------------------- */\n/** \\name Edge (for crease) Transform Creation\n *\n * \\{ */\n\nvoid createTransEdge(TransInfo *t)\n{\n FOREACH_TRANS_DATA_CONTAINER (t, tc) {\n\n BMEditMesh *em = BKE_editmesh_from_object(tc->obedit);\n TransData *td = NULL;\n BMEdge *eed;\n BMIter iter;\n float mtx[3][3], smtx[3][3];\n int count = 0, countsel = 0;\n const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0;\n const bool is_prop_connected = (t->flag & T_PROP_CONNECTED) != 0;\n int cd_edge_float_offset;\n\n BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {\n if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {\n if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {\n countsel++;\n }\n if (is_prop_edit) {\n count++;\n }\n }\n }\n\n if (((is_prop_edit && !is_prop_connected) ? count : countsel) == 0) {\n tc->data_len = 0;\n continue;\n }\n\n if (is_prop_edit) {\n tc->data_len = count;\n }\n else {\n tc->data_len = countsel;\n }\n\n td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), \"TransCrease\");\n\n copy_m3_m4(mtx, tc->obedit->obmat);\n pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON);\n\n /* create data we need */\n if (t->mode == TFM_BWEIGHT) {\n BM_mesh_cd_flag_ensure(em->bm, BKE_mesh_from_object(tc->obedit), ME_CDFLAG_EDGE_BWEIGHT);\n cd_edge_float_offset = CustomData_get_offset(&em->bm->edata, CD_BWEIGHT);\n }\n else { // if (t->mode == TFM_CREASE) {\n BLI_assert(t->mode == TFM_CREASE);\n BM_mesh_cd_flag_ensure(em->bm, BKE_mesh_from_object(tc->obedit), ME_CDFLAG_EDGE_CREASE);\n cd_edge_float_offset = CustomData_get_offset(&em->bm->edata, CD_CREASE);\n }\n\n BLI_assert(cd_edge_float_offset != -1);\n\n BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {\n if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) &&\n (BM_elem_flag_test(eed, BM_ELEM_SELECT) || is_prop_edit)) {\n float *fl_ptr;\n /* need to set center for center calculations */\n mid_v3_v3v3(td->center, eed->v1->co, eed->v2->co);\n\n td->loc = NULL;\n if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {\n td->flag = TD_SELECTED;\n }\n else {\n td->flag = 0;\n }\n\n copy_m3_m3(td->smtx, smtx);\n copy_m3_m3(td->mtx, mtx);\n\n td->ext = NULL;\n\n fl_ptr = BM_ELEM_CD_GET_VOID_P(eed, cd_edge_float_offset);\n td->val = fl_ptr;\n td->ival = *fl_ptr;\n\n td++;\n }\n }\n }\n}\n\n/** \\} */\n"} +{"text": "// Copyright 2015 Google Inc. All rights reserved.\n// Use of this source code is governed by the Apache 2.0\n// license that can be found in the LICENSE file.\n\npackage internal\n\nimport (\n\t\"github.com/golang/protobuf/proto\"\n\tnetcontext \"golang.org/x/net/context\"\n)\n\ntype CallOverrideFunc func(ctx netcontext.Context, service, method string, in, out proto.Message) error\n\nvar callOverrideKey = \"holds []CallOverrideFunc\"\n\nfunc WithCallOverride(ctx netcontext.Context, f CallOverrideFunc) netcontext.Context {\n\t// We avoid appending to any existing call override\n\t// so we don't risk overwriting a popped stack below.\n\tvar cofs []CallOverrideFunc\n\tif uf, ok := ctx.Value(&callOverrideKey).([]CallOverrideFunc); ok {\n\t\tcofs = append(cofs, uf...)\n\t}\n\tcofs = append(cofs, f)\n\treturn netcontext.WithValue(ctx, &callOverrideKey, cofs)\n}\n\nfunc callOverrideFromContext(ctx netcontext.Context) (CallOverrideFunc, netcontext.Context, bool) {\n\tcofs, _ := ctx.Value(&callOverrideKey).([]CallOverrideFunc)\n\tif len(cofs) == 0 {\n\t\treturn nil, nil, false\n\t}\n\t// We found a list of overrides; grab the last, and reconstitute a\n\t// context that will hide it.\n\tf := cofs[len(cofs)-1]\n\tctx = netcontext.WithValue(ctx, &callOverrideKey, cofs[:len(cofs)-1])\n\treturn f, ctx, true\n}\n\ntype logOverrideFunc func(level int64, format string, args ...interface{})\n\nvar logOverrideKey = \"holds a logOverrideFunc\"\n\nfunc WithLogOverride(ctx netcontext.Context, f logOverrideFunc) netcontext.Context {\n\treturn netcontext.WithValue(ctx, &logOverrideKey, f)\n}\n\nvar appIDOverrideKey = \"holds a string, being the full app ID\"\n\nfunc WithAppIDOverride(ctx netcontext.Context, appID string) netcontext.Context {\n\treturn netcontext.WithValue(ctx, &appIDOverrideKey, appID)\n}\n\nvar namespaceKey = \"holds the namespace string\"\n\nfunc withNamespace(ctx netcontext.Context, ns string) netcontext.Context {\n\treturn netcontext.WithValue(ctx, &namespaceKey, ns)\n}\n\nfunc NamespaceFromContext(ctx netcontext.Context) string {\n\t// If there's no namespace, return the empty string.\n\tns, _ := ctx.Value(&namespaceKey).(string)\n\treturn ns\n}\n\n// FullyQualifiedAppID returns the fully-qualified application ID.\n// This may contain a partition prefix (e.g. \"s~\" for High Replication apps),\n// or a domain prefix (e.g. \"example.com:\").\nfunc FullyQualifiedAppID(ctx netcontext.Context) string {\n\tif id, ok := ctx.Value(&appIDOverrideKey).(string); ok {\n\t\treturn id\n\t}\n\treturn fullyQualifiedAppID(ctx)\n}\n\nfunc Logf(ctx netcontext.Context, level int64, format string, args ...interface{}) {\n\tif f, ok := ctx.Value(&logOverrideKey).(logOverrideFunc); ok {\n\t\tf(level, format, args...)\n\t\treturn\n\t}\n\tlogf(fromContext(ctx), level, format, args...)\n}\n\n// NamespacedContext wraps a Context to support namespaces.\nfunc NamespacedContext(ctx netcontext.Context, namespace string) netcontext.Context {\n\treturn withNamespace(ctx, namespace)\n}\n"} +{"text": "# -*- coding: utf-8 -*-\n\nfrom amoco.arch.riscv.rv32i.asm import *\n\n# expose \"microarchitecture\" (instructions semantics)\nuarch = dict(filter(lambda kv: kv[0].startswith(\"i_\"), locals().items()))\n\n# import specifications:\nfrom amoco.arch.core import instruction, disassembler\n\ninstruction_riscv = type(\"instruction_riscv\", (instruction,), {})\ninstruction_riscv.set_uarch(uarch)\n\nfrom amoco.arch.riscv.rv32i.formats import RISCV_full\nfrom amoco.arch.riscv.rv32i.formats import RISCV_synthetic\n\ninstruction_riscv.set_formatter(RISCV_full)\n\n# define disassembler:\nfrom amoco.arch.riscv.rv32i import spec_rv32i\n\ndisassemble = disassembler([spec_rv32i], iclass=instruction_riscv)\n\n\ndef PC():\n return pc\n\n\ndef get_data_endian():\n return 1 # LE\n"} +{"text": "/* Copyright (c) 2018 Anakin Authors, Inc. All Rights Reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n#ifndef ANAKIN_SABER_FUNCS_IMPL_ARM_SABER_CONV_DIRECT_H\n#define ANAKIN_SABER_FUNCS_IMPL_ARM_SABER_CONV_DIRECT_H\n\n#include \"saber/funcs/impl/impl_conv.h\"\n\nnamespace anakin{\n\nnamespace saber{\n\ntemplate \nclass SaberDirectConv : public ImplBase<\n ARM, OpDtype, ConvParam > {\npublic:\n typedef typename DataTrait::Dtype OpDataType;\n typedef void (*conv_direct_impl)(const float* din, float* dout, \\\n int num, int chout, int hout, int wout, \\\n int chin, int hin, int win, \\\n const float* weights, const float* bias, \\\n ConvParam& param, Context* ctx);\n\n typedef void (*conv_direct_int8_impl)(const int8_t* din, int32_t* dout, \\\n int num, int chout, int hout, int wout, int chin, \\\n int hin, int win, const int8_t* weights, const int32_t* bias, \\\n ConvParam& param, Context* ctx, DataType out_type, const float* scale);\n SaberDirectConv() = default;\n ~SaberDirectConv() {}\n\n virtual SaberStatus init(const std::vector *>& inputs,\n std::vector *>& outputs,\n ConvParam& param, Context &ctx);\n\n virtual SaberStatus create(const std::vector *>& inputs,\n std::vector *>& outputs,\n ConvParam& param, Context& ctx);\n\n virtual SaberStatus dispatch(const std::vector*>& inputs,\n std::vector*>& outputs,\n ConvParam& param);\n\nprivate:\n conv_direct_impl _impl{nullptr};\n conv_direct_int8_impl _impl_int8{nullptr};\n bool _is_trans_weights{false};\n Tensor _weights_trans;\n std::vector _w_scale;\n Tensor _tmp_out;\n};\n}\n\n}\n\n\n#endif //ANAKIN_SABER_FUNCS_IMPL_ARM_SABER_CONV_DIRECT_H\n"} +{"text": "using System;\nusing System.Reflection;\n\npublic class App {\n\tconst string assemblyName = \"gactestlib\";\n\tconst string assemblyVersion = \"1.0.0.0\";\n\tconst string assemblyPublicKeyToken = \"537eab56aa911cb7\"; /* see testkey.snk */\n\tpublic static int Main (string[] args)\n\t{\n\t\tTestAssemblyLoad ();\n\n\t\tTestReflectionOnlyLoad ();\n\n\t\treturn 0;\n\t}\n\n\tpublic static void TestAssemblyLoad ()\n\t{\n\t\tvar expectedVersion = new Version (assemblyVersion);\n\n\t\tvar s = String.Format (\"{0}, Version={1}, Culture=\\\"\\\", PublicKeyToken={2}\",\n\t\t\t\t assemblyName, assemblyVersion, assemblyPublicKeyToken);\n\t\tvar n = new AssemblyName (s);\n\t\tvar a = AppDomain.CurrentDomain.Load (n);\n\n\t\tif (a == null)\n\t\t\tEnvironment.Exit (1);\n\t\tif (a.GetName ().Version != expectedVersion)\n\t\t\tEnvironment.Exit (2);\n\t}\n\n\tpublic static void TestReflectionOnlyLoad ()\n\t{\n\t\tvar expectedVersion = new Version (assemblyVersion);\n\n\t\tvar s = String.Format (\"{0}, Version={1}, Culture=\\\"\\\", PublicKeyToken={2}\",\n\t\t\t\t assemblyName, assemblyVersion, assemblyPublicKeyToken);\n\t\tvar a = Assembly.ReflectionOnlyLoad (s);\n\n\t\tif (a == null)\n\t\t\tEnvironment.Exit (3);\n\t\tif (a.GetName ().Version != expectedVersion)\n\t\t\tEnvironment.Exit (4);\n\t}\n}\n"} +{"text": "const findup = require('findup-sync');\n\nmodule.exports = function (search, paths) {\n var path;\n var len = paths.length;\n for (var i = 0; i < len; i++) {\n if (path) {\n break;\n } else {\n path = findup(search, {cwd: paths[i], nocase: true});\n }\n }\n return path;\n};\n"} +{"text": "/**\n * Copyright (C) 2010-2018 Gordon Fraser, Andrea Arcuri and EvoSuite\n * contributors\n *\n * This file is part of EvoSuite.\n *\n * EvoSuite is free software: you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published\n * by the Free Software Foundation, either version 3.0 of the License, or\n * (at your option) any later version.\n *\n * EvoSuite is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with EvoSuite. If not, see .\n */\npackage org.evosuite.runtime.mock.java.io;\n\nimport java.util.Scanner;\n\nimport org.evosuite.runtime.Runtime;\nimport org.evosuite.runtime.RuntimeSettings;\nimport org.evosuite.runtime.mock.java.io.MockFileInputStream;\nimport org.evosuite.runtime.mock.java.io.MockFileOutputStream;\nimport org.evosuite.runtime.mock.java.io.MockFileReader;\nimport org.evosuite.runtime.mock.java.io.MockFileWriter;\nimport org.evosuite.runtime.mock.java.io.MockPrintStream;\nimport org.evosuite.runtime.mock.java.io.MockPrintWriter;\nimport org.junit.After;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\n\npublic class CharByteReadWriteTest {\n\n\tprivate static final boolean VFS = RuntimeSettings.useVFS;\n\n\t@Before\n\tpublic void init(){\t\t\n\t\tRuntimeSettings.useVFS = true;\n\t\tRuntime.getInstance().resetRuntime();\t\t\n\t}\n\t\n\t@After\n\tpublic void restoreProperties(){\n\t\tRuntimeSettings.useVFS = VFS;\n\t}\n\n\t@Test\n\tpublic void testReadWriteByte() throws Throwable{\n\t\t\n\t\tString file = \"FileOutputStream_file.tmp\";\n\t\tString expected = \"testReadWriteByte\";\n\t\tbyte[] data = expected.getBytes();\n\t\t\n\t\tMockFileOutputStream out = new MockFileOutputStream(file);\n\t\tout.write(data, 0, data.length);\n\t\tout.flush();\n\t\tout.close();\n\t\t\n\t\tbyte[] buffer = new byte[1024];\n\t\tMockFileInputStream in = new MockFileInputStream(file);\n\t\tint read = in.read(buffer);\n\t\tin.close();\n\t\tString result = new String(buffer,0,read);\n\t\t\n\t\tAssert.assertEquals(expected, result);\n\t}\n\n\t@Test\n\tpublic void testReadWriteChar() throws Throwable{\n\t\t\n\t\tString file = \"FileWriter_file.tmp\";\n\t\tString expected = \"testReadWriteChar\";\n\t\tchar[] data = expected.toCharArray();\n\t\t\n\t\tMockFileWriter out = new MockFileWriter(file);\n\t\tout.write(data, 0, data.length);\n\t\tout.flush();\n\t\tout.close();\n\t\t\n\t\tchar[] buffer = new char[1024];\n\t\tMockFileReader in = new MockFileReader(file);\n\t\tint read = in.read(buffer);\n\t\tin.close();\n\t\tString result = new String(buffer,0,read);\n\t\t\n\t\tAssert.assertEquals(expected, result);\n\t}\n\n\t@Test\n\tpublic void testPrintWriter() throws Throwable{\n\t\t\n\t\tString file = \"PrintWriter_file.tmp\";\n\t\tString expected = \"testPrintWriter\";\n\n\t\tMockPrintWriter out = new MockPrintWriter(file);\n\t\tout.println(expected);\n\t\tout.close();\n\n\t\tScanner in = new Scanner(new MockFileInputStream(file));\n\t\tString result = in.nextLine();\n\t\tin.close();\n\t\t\n\t\tAssert.assertEquals(expected, result);\n\t}\n\n\t@Test\n\tpublic void testPrintStream() throws Throwable{\n\t\t\n\t\tString file = \"PrintStream_file.tmp\";\n\t\tString expected = \"testPrintStream\";\n\n\t\tMockPrintStream out = new MockPrintStream(file);\n\t\tout.println(expected);\n\t\tout.close();\n\n\t\tScanner in = new Scanner(new MockFileInputStream(file));\n\t\tString result = in.nextLine();\n\t\tin.close();\n\t\t\n\t\tAssert.assertEquals(expected, result);\n\t}\n\n\n}\n"} +{"text": "using System;\nusing SLua;\nusing System.Collections.Generic;\n[UnityEngine.Scripting.Preserve]\npublic class Lua_UnityEngine_Experimental_Animations_AnimationHumanStream : LuaObject {\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int constructor(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream o;\n\t\t\to=new UnityEngine.Experimental.Animations.AnimationHumanStream();\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,o);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetMuscle(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Experimental.Animations.MuscleHandle a1;\n\t\t\tcheckValueType(l,2,out a1);\n\t\t\tvar ret=self.GetMuscle(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetMuscle(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Experimental.Animations.MuscleHandle a1;\n\t\t\tcheckValueType(l,2,out a1);\n\t\t\tSystem.Single a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetMuscle(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int ResetToStancePose(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tself.ResetToStancePose();\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalPositionFromPose(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalPositionFromPose(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalRotationFromPose(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalRotationFromPose(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalLocalPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalLocalPosition(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetGoalLocalPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tUnityEngine.Vector3 a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetGoalLocalPosition(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalLocalRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalLocalRotation(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetGoalLocalRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tUnityEngine.Quaternion a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetGoalLocalRotation(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalPosition(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetGoalPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tUnityEngine.Vector3 a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetGoalPosition(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalRotation(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetGoalRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tUnityEngine.Quaternion a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetGoalRotation(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetGoalWeightPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tSystem.Single a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetGoalWeightPosition(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetGoalWeightRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tSystem.Single a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetGoalWeightRotation(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalWeightPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalWeightPosition(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetGoalWeightRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKGoal a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetGoalWeightRotation(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetHintPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKHint a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetHintPosition(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetHintPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKHint a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tUnityEngine.Vector3 a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetHintPosition(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetHintWeightPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKHint a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tSystem.Single a2;\n\t\t\tcheckType(l,3,out a2);\n\t\t\tself.SetHintWeightPosition(a1,a2);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int GetHintWeightPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.AvatarIKHint a1;\n\t\t\tcheckEnum(l,2,out a1);\n\t\t\tvar ret=self.GetHintWeightPosition(a1);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,ret);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetLookAtPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Vector3 a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.SetLookAtPosition(a1);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetLookAtClampWeight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tSystem.Single a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.SetLookAtClampWeight(a1);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetLookAtBodyWeight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tSystem.Single a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.SetLookAtBodyWeight(a1);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetLookAtHeadWeight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tSystem.Single a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.SetLookAtHeadWeight(a1);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SetLookAtEyesWeight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tSystem.Single a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.SetLookAtEyesWeight(a1);\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int SolveIK(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tself.SolveIK();\n\t\t\tpushValue(l,true);\n\t\t\tsetBack(l,self);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_isValid(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.isValid);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_humanScale(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.humanScale);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_leftFootHeight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.leftFootHeight);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_rightFootHeight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.rightFootHeight);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_bodyLocalPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.bodyLocalPosition);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int set_bodyLocalPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Vector3 v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.bodyLocalPosition=v;\n\t\t\tsetBack(l,self);\n\t\t\tpushValue(l,true);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_bodyLocalRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.bodyLocalRotation);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int set_bodyLocalRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Quaternion v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.bodyLocalRotation=v;\n\t\t\tsetBack(l,self);\n\t\t\tpushValue(l,true);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_bodyPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.bodyPosition);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int set_bodyPosition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Vector3 v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.bodyPosition=v;\n\t\t\tsetBack(l,self);\n\t\t\tpushValue(l,true);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_bodyRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.bodyRotation);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int set_bodyRotation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tUnityEngine.Quaternion v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.bodyRotation=v;\n\t\t\tsetBack(l,self);\n\t\t\tpushValue(l,true);\n\t\t\treturn 1;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_leftFootVelocity(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.leftFootVelocity);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int get_rightFootVelocity(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.Experimental.Animations.AnimationHumanStream self;\n\t\t\tcheckValueType(l,1,out self);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.rightFootVelocity);\n\t\t\treturn 2;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\treturn error(l,e);\n\t\t}\n\t}\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public void reg(IntPtr l) {\n\t\tgetTypeTable(l,\"UnityEngine.Experimental.Animations.AnimationHumanStream\");\n\t\taddMember(l,GetMuscle);\n\t\taddMember(l,SetMuscle);\n\t\taddMember(l,ResetToStancePose);\n\t\taddMember(l,GetGoalPositionFromPose);\n\t\taddMember(l,GetGoalRotationFromPose);\n\t\taddMember(l,GetGoalLocalPosition);\n\t\taddMember(l,SetGoalLocalPosition);\n\t\taddMember(l,GetGoalLocalRotation);\n\t\taddMember(l,SetGoalLocalRotation);\n\t\taddMember(l,GetGoalPosition);\n\t\taddMember(l,SetGoalPosition);\n\t\taddMember(l,GetGoalRotation);\n\t\taddMember(l,SetGoalRotation);\n\t\taddMember(l,SetGoalWeightPosition);\n\t\taddMember(l,SetGoalWeightRotation);\n\t\taddMember(l,GetGoalWeightPosition);\n\t\taddMember(l,GetGoalWeightRotation);\n\t\taddMember(l,GetHintPosition);\n\t\taddMember(l,SetHintPosition);\n\t\taddMember(l,SetHintWeightPosition);\n\t\taddMember(l,GetHintWeightPosition);\n\t\taddMember(l,SetLookAtPosition);\n\t\taddMember(l,SetLookAtClampWeight);\n\t\taddMember(l,SetLookAtBodyWeight);\n\t\taddMember(l,SetLookAtHeadWeight);\n\t\taddMember(l,SetLookAtEyesWeight);\n\t\taddMember(l,SolveIK);\n\t\taddMember(l,\"isValid\",get_isValid,null,true);\n\t\taddMember(l,\"humanScale\",get_humanScale,null,true);\n\t\taddMember(l,\"leftFootHeight\",get_leftFootHeight,null,true);\n\t\taddMember(l,\"rightFootHeight\",get_rightFootHeight,null,true);\n\t\taddMember(l,\"bodyLocalPosition\",get_bodyLocalPosition,set_bodyLocalPosition,true);\n\t\taddMember(l,\"bodyLocalRotation\",get_bodyLocalRotation,set_bodyLocalRotation,true);\n\t\taddMember(l,\"bodyPosition\",get_bodyPosition,set_bodyPosition,true);\n\t\taddMember(l,\"bodyRotation\",get_bodyRotation,set_bodyRotation,true);\n\t\taddMember(l,\"leftFootVelocity\",get_leftFootVelocity,null,true);\n\t\taddMember(l,\"rightFootVelocity\",get_rightFootVelocity,null,true);\n\t\tcreateTypeMetatable(l,constructor, typeof(UnityEngine.Experimental.Animations.AnimationHumanStream),typeof(System.ValueType));\n\t}\n}\n"} +{"text": "\n
\n 50-2209.02\n Liability for fines; notice of infraction; hearing.\n \n (a)\n Absent an intervening criminal or fraudulent act, the owner of a vehicle issued a notice of infraction shall be liable for payment of the fine assessed for the infraction.\n \n \n (b)\n When a violation is detected by an automated traffic enforcement system, the Mayor shall mail a summons and a notice of infraction to the name and address of the registered owner of the vehicle on file with the Department of Motor Vehicles or the appropriate state motor vehicle agency. The notice shall include the date, time, and location of the violation, the type of violation detected, the license plate number, and state of issuance of the vehicle detected, and a copy of the photo or digitized image of the violation.\n \n \n (c)\n An owner or operator who receives a citation may request a hearing which shall be adjudicated pursuant to subchapter I of Chapter 23 of this title.\n \n \n (d)\n The owner or operator of a vehicle shall not be presumed liable for violations in the vehicle recorded by an automated traffic enforcement system when yielding the right of way to an emergency vehicle, when the vehicle or tags have been reported stolen prior to the citation, when part of a funeral procession, or at the direction of a law enforcement officer.\n \n \n Apr. 9, 1997, D.C. Law 11-198, § 902, 43 DCR 4569\n Mar. 24, 1998, D.C. Law 12-81, § 51, 45 DCR 745\n Apr. 8, 2005, D.C. Law 15-307, § 206, 52 DCR 1700\n Oct. 23, 2012, D.C. Law 19-187, § 2(b), 59 DCR 10149\n For temporary amendment of section, see § 903 of the Fiscal Year 1997 Budget Support Emergency Act of 1996 (D.C. Act 11-302, July 25, 1996, 43 DCR 4181), § 903 of the Fiscal Year 1997 Budget Support Emergency Amendment Act of 1996 (D.C. Act 11-429, October 29, 1996, 43 DCR 6151), and § 903 of the Fiscal Year 1997 Budget Support Congressional Adjournment Emergency Amendment Act of 1997 (D.C. Act 12-2, February 19, 1997, 44 DCR 1590).\n For temporary (225 day) amendment of section, see § 902 of Fiscal Year 1997 Budget Support Temporary Amendment Act of 1996 (D.C. Law 11-226, April 9, 1997, law notification 44 DCR 2584).\n The 2012 amendment by D.C. Law 19-187 rewrote (a); and substituted “Department of Motor Vehicles” for “Bureau of Motor Vehicle Services” in (b).\n D.C. Law 15-307, in subsec. (a), substituted “the name, driver’s license number, and address of the person who leased, rented, or otherwise had care, custody, or control of the vehicle; except that if the vehicle was in the temporary care, custody, or control of a business, the owner need only provide the name and address of that business” for “the name and address of the person who leased, rented, or otherwise had care, custody, or control of the vehicle”.\n 1981 Ed., § 40-752.\n This section is referenced in § 1-629.05, § 50-331, and § 50-2201.03.\n \n
\n"} +{"text": "exports.x = 1;\n"} +{"text": "#pragma once\n\n// Including SDKDDKVer.h defines the highest available Windows platform.\n\n// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and\n// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.\n\n#include \n"} +{"text": "import * as React from \"react\";\n\nimport { maybe } from \"../core/utils\";\n\nconst useClickedOutside = () => {\n const [clickedOutside, setClickedOutside] = React.useState(false);\n const elementRef = React.useRef(null);\n\n const handleClickOutside = (e: MouseEvent) => {\n if (maybe(() => elementRef.current && e.target, null)) {\n setClickedOutside(!elementRef.current.contains(e.target as Node));\n }\n };\n\n const setElementRef = () => elementRef;\n\n React.useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n return {\n clickedOutside,\n setElementRef,\n };\n};\n\nexport default useClickedOutside;\n"} +{"text": "// export {DebounceQueue} from './debounce-queue';\n// export {DelayQueue} from './delay-queue';\n// export {DelayQueueExector} from './delay-queue-exector';\n// export {RxQueue} from './rx-queue';\n// export {ThrottleQueue} from './throttle-queue';\n"} +{"text": "/* iCheck plugin Line skin, purple\n----------------------------------- */\n.icheckbox_line-purple,\n.iradio_line-purple {\n position: relative;\n display: block;\n margin: 0;\n padding: 5px 15px 5px 38px;\n font-size: 13px;\n line-height: 17px;\n color: #fff;\n background: #6a5a8c;\n border: none;\n -webkit-border-radius: 3px;\n -moz-border-radius: 3px;\n border-radius: 3px;\n cursor: pointer;\n}\n .icheckbox_line-purple .icheck_line-icon,\n .iradio_line-purple .icheck_line-icon {\n position: absolute;\n top: 50%;\n left: 13px;\n width: 13px;\n height: 11px;\n margin: -5px 0 0 0;\n padding: 0;\n overflow: hidden;\n background: url(line.png) no-repeat;\n border: none;\n }\n .icheckbox_line-purple.hover,\n .icheckbox_line-purple.checked.hover,\n .iradio_line-purple.hover {\n background: #8677A7;\n }\n .icheckbox_line-purple.checked,\n .iradio_line-purple.checked {\n background: #6a5a8c;\n }\n .icheckbox_line-purple.checked .icheck_line-icon,\n .iradio_line-purple.checked .icheck_line-icon {\n background-position: -15px 0;\n }\n .icheckbox_line-purple.disabled,\n .iradio_line-purple.disabled {\n background: #D2CCDE;\n cursor: default;\n }\n .icheckbox_line-purple.disabled .icheck_line-icon,\n .iradio_line-purple.disabled .icheck_line-icon {\n background-position: -30px 0;\n }\n .icheckbox_line-purple.checked.disabled,\n .iradio_line-purple.checked.disabled {\n background: #D2CCDE;\n }\n .icheckbox_line-purple.checked.disabled .icheck_line-icon,\n .iradio_line-purple.checked.disabled .icheck_line-icon {\n background-position: -45px 0;\n }\n\n/* Retina support */\n@media only screen and (-webkit-min-device-pixel-ratio: 1.5),\n only screen and (-moz-min-device-pixel-ratio: 1.5),\n only screen and (-o-min-device-pixel-ratio: 3/2),\n only screen and (min-device-pixel-ratio: 1.5) {\n .icheckbox_line-purple .icheck_line-icon,\n .iradio_line-purple .icheck_line-icon {\n background-image: url(line@2x.png);\n -webkit-background-size: 60px 13px;\n background-size: 60px 13px;\n }\n}"} +{"text": "/*******************************************************************************\r\n * @license\r\n * Copyright (c) 2013 IBM Corporation and others.\r\n * All rights reserved. This program and the accompanying materials are made \r\n * available under the terms of the Eclipse Public License v1.0 \r\n * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution \r\n * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). \r\n *\r\n * Contributors:\r\n * IBM Corporation - initial API and implementation\r\n *******************************************************************************/\r\n \r\n/*eslint-env browser, amd*/\r\ndefine(\"orion/editor/keyModes\", [ //$NON-NLS-0$\r\n\t\t\"orion/keyBinding\", //$NON-NLS-0$\r\n\t\t\"orion/util\" //$NON-NLS-0$\r\n], function(mKeyBinding, util) {\r\n\r\n\tfunction KeyMode(view) {\r\n\t\tif (!view) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._view = view;\r\n\t\tthis._keyBindings = this.createKeyBindings();\r\n\t\tthis._keyBindingIndex = 0;\r\n\t}\r\n\tKeyMode.prototype = /** @lends orion.editor.KeyMode.prototype */ {\r\n\t\tcreateKeyBindings: function () {\r\n\t\t\treturn [];\r\n\t\t},\r\n\t\t/**\r\n\t\t * Returns all the key bindings associated to the given action ID.\r\n\t\t *\r\n\t\t * @param {String} actionID the action ID.\r\n\t\t * @returns {orion.KeyBinding[]} the array of key bindings associated to the given action ID.\r\n\t\t *\r\n\t\t * @see orion.editor.KeyModesetKeyBinding\r\n\t\t * @see orion.editor.KeyModesetAction\r\n\t\t */\r\n\t\tgetKeyBindings: function (actionID) {\r\n\t\t\tvar result = [];\r\n\t\t\tvar keyBindings = this._keyBindings;\r\n\t\t\tfor (var i = 0; i < keyBindings.length; i++) {\r\n\t\t\t\tif (keyBindings[i].actionID === actionID) {\r\n\t\t\t\t\tresult.push(keyBindings[i].keyBinding);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tgetView: function() {\r\n\t\t\treturn this._view;\r\n\t\t},\r\n\t\tisActive: function () {\r\n\t\t\treturn this._view.getKeyModes().indexOf(this) !== -1;\r\n\t\t},\r\n\t\tmatch: function(e) {\r\n\t\t\tif (e.type === \"keydown\") { //$NON-NLS-0$\r\n\t\t\t\tswitch (e.keyCode) {\r\n\t\t\t\t\tcase 16: /* Shift */\r\n\t\t\t\t\tcase 17: /* Control */\r\n\t\t\t\t\tcase 18: /* Alt */\r\n\t\t\t\t\tcase 91: /* Command */\r\n\t\t\t\t\t\treturn undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar keyBindingIndex = this._keyBindingIndex;\r\n\t\t\tvar keyBindings = this._matchingKeyBindings || this._keyBindings;\r\n\t\t\tvar matchingKeyBindings = [];\r\n\t\t\tfor (var i = 0; i < keyBindings.length; i++) {\r\n\t\t\t\tvar kb = keyBindings[i];\r\n\t\t\t\tvar keyBinding = kb.keyBinding;\r\n\t\t\t\tvar match = keyBinding.match(e, keyBindingIndex);\r\n\t\t\t\tif (match === true) {\r\n\t\t\t\t\tthis._keyBindingIndex = 0;\r\n\t\t\t\t\tthis._matchingKeyBindings = null;\r\n\t\t\t\t\treturn kb.actionID;\r\n\t\t\t\t} else if (typeof match === \"number\") { //$NON-NLS-0$\r\n\t\t\t\t\tmatchingKeyBindings.push(kb);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (matchingKeyBindings.length === 0) {\r\n\t\t\t\tthis._keyBindingIndex = 0;\r\n\t\t\t\tthis._matchingKeyBindings = null;\r\n\t\t\t} else {\r\n\t\t\t\tthis._keyBindingIndex++;\r\n\t\t\t\tthis._matchingKeyBindings = matchingKeyBindings;\r\n\t\t\t\treturn \"noop\"; //$NON-NLS-0$\r\n\t\t\t}\r\n\t\t\treturn undefined;\r\n\t\t},\r\n\t\t/**\r\n\t\t * Associates a key binding with the given action ID. Any previous\r\n\t\t * association with the specified key binding is overwriten. If the\r\n\t\t * action ID is null, the association is removed.\r\n\t\t * \r\n\t\t * @param {orion.KeyBinding} keyBinding the key binding\r\n\t\t * @param {String} actionID the action ID\r\n\t\t */\r\n\t\tsetKeyBinding: function(keyBinding, actionID) {\r\n\t\t\tvar keyBindings = this._keyBindings;\r\n\t\t\tfor (var i = 0; i < keyBindings.length; i++) {\r\n\t\t\t\tvar kb = keyBindings[i]; \r\n\t\t\t\tif (kb.keyBinding.equals(keyBinding)) {\r\n\t\t\t\t\tif (actionID) {\r\n\t\t\t\t\t\tkb.actionID = actionID;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (kb.predefined) {\r\n\t\t\t\t\t\t\tkb.actionID = \"noop\"; //$NON-NLS-0$\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tkeyBindings.splice(i, 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (actionID) {\r\n\t\t\t\tkeyBindings.push({keyBinding: keyBinding, actionID: actionID});\r\n\t\t\t}\r\n\t\t},\r\n\t\tsetView: function(view) {\r\n\t\t\tthis._view = view;\r\n\t\t}\r\n\t};\r\n\t\r\n\tfunction DefaultKeyMode(view) {\r\n\t\tKeyMode.call(this, view);\r\n\t}\r\n\tDefaultKeyMode.prototype = new KeyMode();\r\n\tDefaultKeyMode.prototype.createKeyBindings = function () {\r\n\t\tvar KeyBinding = mKeyBinding.KeyBinding;\r\n\t\t//no duplicate keybindings\r\n\t\tvar bindings = [];\r\n\r\n\t\t// Cursor Navigation\r\n\t\tbindings.push({actionID: \"lineUp\",\t\tkeyBinding: new KeyBinding(38), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"lineDown\",\tkeyBinding: new KeyBinding(40), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"charPrevious\",\tkeyBinding: new KeyBinding(37), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"charNext\",\tkeyBinding: new KeyBinding(39), predefined: true}); //$NON-NLS-0$\r\n\t\tif (util.isMac) {\r\n\t\t\tbindings.push({actionID: \"scrollPageUp\",\t\tkeyBinding: new KeyBinding(33), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"scrollPageDown\",\tkeyBinding: new KeyBinding(34), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"pageUp\",\t\tkeyBinding: new KeyBinding(33, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"pageDown\",\tkeyBinding: new KeyBinding(34, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineStart\",\tkeyBinding: new KeyBinding(37, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineEnd\",\t\tkeyBinding: new KeyBinding(39, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"wordPrevious\",\tkeyBinding: new KeyBinding(37, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"wordNext\",\tkeyBinding: new KeyBinding(39, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"scrollTextStart\",\tkeyBinding: new KeyBinding(36), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"scrollTextEnd\",\t\tkeyBinding: new KeyBinding(35), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"textStart\",\tkeyBinding: new KeyBinding(38, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"textEnd\",\t\tkeyBinding: new KeyBinding(40, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"scrollPageUp\",\tkeyBinding: new KeyBinding(38, null, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"scrollPageDown\",\t\tkeyBinding: new KeyBinding(40, null, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineStart\",\tkeyBinding: new KeyBinding(37, null, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineEnd\",\t\tkeyBinding: new KeyBinding(39, null, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\t//TODO These two actions should be changed to paragraph start and paragraph end when word wrap is implemented\r\n\t\t\tbindings.push({actionID: \"lineStart\",\tkeyBinding: new KeyBinding(38, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineEnd\",\t\tkeyBinding: new KeyBinding(40, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t} else {\r\n\t\t\tbindings.push({actionID: \"pageUp\",\t\tkeyBinding: new KeyBinding(33), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"pageDown\",\tkeyBinding: new KeyBinding(34), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineStart\",\tkeyBinding: new KeyBinding(36), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineEnd\",\t\tkeyBinding: new KeyBinding(35), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"wordPrevious\",\tkeyBinding: new KeyBinding(37, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"wordNext\",\tkeyBinding: new KeyBinding(39, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"textStart\",\tkeyBinding: new KeyBinding(36, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"textEnd\",\t\tkeyBinding: new KeyBinding(35, true), predefined: true}); //$NON-NLS-0$\r\n\t\t}\r\n\t\tif (util.isFirefox && util.isLinux) {\r\n\t\t\tbindings.push({actionID: \"lineUp\",\t\tkeyBinding: new KeyBinding(38, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineDown\",\tkeyBinding: new KeyBinding(40, true), predefined: true}); //$NON-NLS-0$\r\n\t\t}\r\n\t\tif (util.isWindows) {\r\n\t\t\tbindings.push({actionID: \"scrollLineUp\",\tkeyBinding: new KeyBinding(38, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"scrollLineDown\",\tkeyBinding: new KeyBinding(40, true), predefined: true}); //$NON-NLS-0$\r\n\t\t}\r\n\r\n\t\t// Select Cursor Navigation\r\n\t\tbindings.push({actionID: \"selectLineUp\",\t\tkeyBinding: new KeyBinding(38, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"selectLineDown\",\t\tkeyBinding: new KeyBinding(40, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"selectCharPrevious\",\tkeyBinding: new KeyBinding(37, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"selectCharNext\",\t\tkeyBinding: new KeyBinding(39, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"selectPageUp\",\t\tkeyBinding: new KeyBinding(33, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"selectPageDown\",\t\tkeyBinding: new KeyBinding(34, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tif (util.isMac) {\r\n\t\t\tbindings.push({actionID: \"selectLineStart\",\tkeyBinding: new KeyBinding(37, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectLineEnd\",\t\tkeyBinding: new KeyBinding(39, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectWordPrevious\",\tkeyBinding: new KeyBinding(37, null, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectWordNext\",\tkeyBinding: new KeyBinding(39, null, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectTextStart\",\tkeyBinding: new KeyBinding(36, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectTextEnd\",\t\tkeyBinding: new KeyBinding(35, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectTextStart\",\tkeyBinding: new KeyBinding(38, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectTextEnd\",\t\tkeyBinding: new KeyBinding(40, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectLineStart\",\tkeyBinding: new KeyBinding(37, null, true, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectLineEnd\",\t\tkeyBinding: new KeyBinding(39, null, true, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\t//TODO These two actions should be changed to select paragraph start and select paragraph end when word wrap is implemented\r\n\t\t\tbindings.push({actionID: \"selectLineStart\",\tkeyBinding: new KeyBinding(38, null, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectLineEnd\",\t\tkeyBinding: new KeyBinding(40, null, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t} else {\r\n\t\t\tif (util.isLinux) {\r\n\t\t\t\tbindings.push({actionID: \"selectWholeLineUp\",\t\tkeyBinding: new KeyBinding(38, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\t\tbindings.push({actionID: \"selectWholeLineDown\",\t\tkeyBinding: new KeyBinding(40, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\t}\r\n\t\t\tbindings.push({actionID: \"selectLineStart\",\t\tkeyBinding: new KeyBinding(36, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectLineEnd\",\t\tkeyBinding: new KeyBinding(35, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectWordPrevious\",\tkeyBinding: new KeyBinding(37, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectWordNext\",\t\tkeyBinding: new KeyBinding(39, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectTextStart\",\t\tkeyBinding: new KeyBinding(36, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"selectTextEnd\",\t\tkeyBinding: new KeyBinding(35, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\t}\r\n\t\t\r\n\t\t//Undo stack\r\n\t\tbindings.push({actionID: \"undo\", keyBinding: new mKeyBinding.KeyBinding('z', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\tif (util.isMac) {\r\n\t\t\tbindings.push({actionID: \"redo\", keyBinding: new mKeyBinding.KeyBinding('z', true, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t} else {\r\n\t\t\tbindings.push({actionID: \"redo\", keyBinding: new mKeyBinding.KeyBinding('y', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t}\r\n\r\n\t\t//Misc\r\n\t\tbindings.push({actionID: \"deletePrevious\",\t\tkeyBinding: new KeyBinding(8), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"deletePrevious\",\t\tkeyBinding: new KeyBinding(8, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"deleteNext\",\t\tkeyBinding: new KeyBinding(46), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"deleteWordPrevious\",\tkeyBinding: new KeyBinding(8, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"deleteWordPrevious\",\tkeyBinding: new KeyBinding(8, true, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"deleteWordNext\",\t\tkeyBinding: new KeyBinding(46, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"tab\",\t\t\tkeyBinding: new KeyBinding(9), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"shiftTab\",\t\t\tkeyBinding: new KeyBinding(9, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"enter\",\t\t\tkeyBinding: new KeyBinding(13), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"enter\",\t\t\tkeyBinding: new KeyBinding(13, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"escape\",\t\t\tkeyBinding: new KeyBinding(27), predefined: true}); //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"selectAll\",\t\tkeyBinding: new KeyBinding('a', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"toggleTabMode\",\tkeyBinding: new KeyBinding('m', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\tif (util.isMac) {\r\n\t\t\tbindings.push({actionID: \"deleteNext\",\t\tkeyBinding: new KeyBinding(46, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"deleteWordPrevious\",\tkeyBinding: new KeyBinding(8, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"deleteWordNext\",\t\tkeyBinding: new KeyBinding(46, null, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t}\r\n\t\t\r\n\t\tbindings.push({actionID: \"toggleWrapMode\",\t\tkeyBinding: new mKeyBinding.KeyBinding('w', true, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\tbindings.push({actionID: \"toggleOverwriteMode\",\t\tkeyBinding: new mKeyBinding.KeyBinding(45)}); //$NON-NLS-0$\r\n\t\t\r\n\t\t/*\r\n\t\t* Feature in IE/Chrome: prevent ctrl+'u', ctrl+'i', and ctrl+'b' from applying styles to the text.\r\n\t\t*\r\n\t\t* Note that Chrome applies the styles on the Mac with Ctrl instead of Cmd.\r\n\t\t*/\r\n\t\tif (!util.isFirefox) {\r\n\t\t\tvar isMacChrome = util.isMac && util.isChrome;\r\n\t\t\tbindings.push({actionID: \"noop\", keyBinding: new KeyBinding('u', !isMacChrome, false, false, isMacChrome), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"noop\", keyBinding: new KeyBinding('i', !isMacChrome, false, false, isMacChrome), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"noop\", keyBinding: new KeyBinding('b', !isMacChrome, false, false, isMacChrome), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t}\r\n\r\n\t\tif (util.isFirefox) {\r\n\t\t\tbindings.push({actionID: \"copy\", keyBinding: new KeyBinding(45, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"paste\", keyBinding: new KeyBinding(45, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"cut\", keyBinding: new KeyBinding(46, null, true), predefined: true}); //$NON-NLS-0$\r\n\t\t}\r\n\r\n\t\t// Add the emacs Control+ ... key bindings.\r\n\t\tif (util.isMac) {\r\n\t\t\tbindings.push({actionID: \"lineStart\", keyBinding: new KeyBinding(\"a\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineEnd\", keyBinding: new KeyBinding(\"e\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineUp\", keyBinding: new KeyBinding(\"p\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"lineDown\", keyBinding: new KeyBinding(\"n\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"charPrevious\", keyBinding: new KeyBinding(\"b\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"charNext\", keyBinding: new KeyBinding(\"f\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"deletePrevious\", keyBinding: new KeyBinding(\"h\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"deleteNext\", keyBinding: new KeyBinding(\"d\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tbindings.push({actionID: \"deleteLineEnd\", keyBinding: new KeyBinding(\"k\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\tif (util.isFirefox) {\r\n\t\t\t\tbindings.push({actionID: \"scrollPageDown\", keyBinding: new KeyBinding(\"v\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\t\tbindings.push({actionID: \"deleteLineStart\", keyBinding: new KeyBinding(\"u\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\t\tbindings.push({actionID: \"deleteWordPrevious\", keyBinding: new KeyBinding(\"w\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\t} else {\r\n\t\t\t\tbindings.push({actionID: \"pageDown\", keyBinding: new KeyBinding(\"v\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\t\tbindings.push({actionID: \"centerLine\", keyBinding: new KeyBinding(\"l\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\t\tbindings.push({actionID: \"enterNoCursor\", keyBinding: new KeyBinding(\"o\", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$\r\n\t\t\t\t//TODO implement: y (yank), t (transpose)\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn bindings;\r\n\t};\r\n\t\r\n\treturn {\r\n\t\tKeyMode: KeyMode,\r\n\t\tDefaultKeyMode: DefaultKeyMode\r\n\t};\r\n});"} +{"text": "// Proceess '\\n'\n\n'use strict';\n\nmodule.exports = function newline(state, silent) {\n var pmax, max, pos = state.pos;\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false; }\n\n pmax = state.pending.length - 1;\n max = state.posMax;\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n // Strip out all trailing spaces on this line.\n for (var i = pmax - 2; i >= 0; i--) {\n if (state.pending.charCodeAt(i) !== 0x20) {\n state.pending = state.pending.substring(0, i + 1);\n break;\n }\n }\n state.push({\n type: 'hardbreak',\n level: state.level\n });\n } else {\n state.pending = state.pending.slice(0, -1);\n state.push({\n type: 'softbreak',\n level: state.level\n });\n }\n\n } else {\n state.push({\n type: 'softbreak',\n level: state.level\n });\n }\n }\n\n pos++;\n\n // skip heading spaces for next line\n while (pos < max && state.src.charCodeAt(pos) === 0x20) { pos++; }\n\n state.pos = pos;\n return true;\n};\n"} +{"text": "{\n \"$schema\": \"http://json.schemastore.org/launchsettings.json\",\n \"iisSettings\": {\n \"windowsAuthentication\": false, \n \"anonymousAuthentication\": true, \n \"iisExpress\": {\n \"applicationUrl\": \"http://localhost:11350\",\n \"sslPort\": 44371\n }\n },\n \"profiles\": {\n \"IIS Express\": {\n \"commandName\": \"IISExpress\",\n \"launchBrowser\": true,\n \"launchUrl\": \"api/values\",\n \"environmentVariables\": {\n \"ASPNETCORE_ENVIRONMENT\": \"Development\"\n }\n },\n \"Xms.RibbonButton.Api\": {\n \"commandName\": \"Project\",\n \"launchBrowser\": true,\n \"launchUrl\": \"api/values\",\n \"applicationUrl\": \"https://localhost:5001;http://localhost:5000\",\n \"environmentVariables\": {\n \"ASPNETCORE_ENVIRONMENT\": \"Development\"\n }\n }\n }\n}"} +{"text": "\n\n\n\n\n \n \n\n \n\n \n\n\n \n \n\n \n \n\n\n"} +{"text": "// @file nnpooling_blas.hpp\n// @brief Pooling block CuDNN-based implementation.\n// @author Andrea Vedaldi\n\n/*\nCopyright (C) 2015-16 Andrea Vedaldi.\nAll rights reserved.\n\nThis file is part of the VLFeat library and is made available under\nthe terms of the BSD license (see the COPYING file).\n*/\n\n#ifndef __vl__nnpooling_cudnn__\n#define __vl__nnpooling_cudnn__\n\n#include \"../nnpooling.hpp\"\n#include \"../data.hpp\"\n#include \"cudnn.h\"\n\n\nnamespace vl { namespace impl {\n\n // todo: data type should be handled internally?\n\n template\n struct nnpooling_cudnn\n {\n static vl::Error\n forward(Context& context,\n Tensor output,\n Tensor data,\n vl::PoolingMethod method,\n int poolHeight, int poolWidth,\n int strideY, int strideX,\n int padTop, int padBottom,\n int padLeft, int padRight) ;\n\n static vl::Error\n backward(Context& context,\n Tensor derData,\n Tensor data,\n Tensor output,\n Tensor derOutput,\n vl::PoolingMethod method,\n int poolHeight, int poolWidth,\n int strideY, int strideX,\n int padTop, int padBottom,\n int padLeft, int padRight) ;\n };\n\n} }\n\n#endif /* defined(__vl__nnpooling_cudnn__) */\n"} +{"text": "// Code generated by protoc-gen-gogo. DO NOT EDIT.\n// source: github.com/containerd/containerd/runtime/v2/runc/options/oci.proto\n\npackage options\n\nimport (\n\tfmt \"fmt\"\n\tproto \"github.com/gogo/protobuf/proto\"\n\tio \"io\"\n\tmath \"math\"\n\treflect \"reflect\"\n\tstrings \"strings\"\n)\n\n// Reference imports to suppress errors if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = fmt.Errorf\nvar _ = math.Inf\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the proto package it is being compiled against.\n// A compilation error at this line likely means your copy of the\n// proto package needs to be updated.\nconst _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package\n\ntype Options struct {\n\t// disable pivot root when creating a container\n\tNoPivotRoot bool `protobuf:\"varint,1,opt,name=no_pivot_root,json=noPivotRoot,proto3\" json:\"no_pivot_root,omitempty\"`\n\t// create a new keyring for the container\n\tNoNewKeyring bool `protobuf:\"varint,2,opt,name=no_new_keyring,json=noNewKeyring,proto3\" json:\"no_new_keyring,omitempty\"`\n\t// place the shim in a cgroup\n\tShimCgroup string `protobuf:\"bytes,3,opt,name=shim_cgroup,json=shimCgroup,proto3\" json:\"shim_cgroup,omitempty\"`\n\t// set the I/O's pipes uid\n\tIoUid uint32 `protobuf:\"varint,4,opt,name=io_uid,json=ioUid,proto3\" json:\"io_uid,omitempty\"`\n\t// set the I/O's pipes gid\n\tIoGid uint32 `protobuf:\"varint,5,opt,name=io_gid,json=ioGid,proto3\" json:\"io_gid,omitempty\"`\n\t// binary name of the runc binary\n\tBinaryName string `protobuf:\"bytes,6,opt,name=binary_name,json=binaryName,proto3\" json:\"binary_name,omitempty\"`\n\t// runc root directory\n\tRoot string `protobuf:\"bytes,7,opt,name=root,proto3\" json:\"root,omitempty\"`\n\t// criu binary path\n\tCriuPath string `protobuf:\"bytes,8,opt,name=criu_path,json=criuPath,proto3\" json:\"criu_path,omitempty\"`\n\t// enable systemd cgroups\n\tSystemdCgroup bool `protobuf:\"varint,9,opt,name=systemd_cgroup,json=systemdCgroup,proto3\" json:\"systemd_cgroup,omitempty\"`\n\t// criu image path\n\tCriuImagePath string `protobuf:\"bytes,10,opt,name=criu_image_path,json=criuImagePath,proto3\" json:\"criu_image_path,omitempty\"`\n\t// criu work path\n\tCriuWorkPath string `protobuf:\"bytes,11,opt,name=criu_work_path,json=criuWorkPath,proto3\" json:\"criu_work_path,omitempty\"`\n\tXXX_NoUnkeyedLiteral struct{} `json:\"-\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n\tXXX_sizecache int32 `json:\"-\"`\n}\n\nfunc (m *Options) Reset() { *m = Options{} }\nfunc (*Options) ProtoMessage() {}\nfunc (*Options) Descriptor() ([]byte, []int) {\n\treturn fileDescriptor_4e5440d739e9a863, []int{0}\n}\nfunc (m *Options) XXX_Unmarshal(b []byte) error {\n\treturn m.Unmarshal(b)\n}\nfunc (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {\n\tif deterministic {\n\t\treturn xxx_messageInfo_Options.Marshal(b, m, deterministic)\n\t} else {\n\t\tb = b[:cap(b)]\n\t\tn, err := m.MarshalTo(b)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn b[:n], nil\n\t}\n}\nfunc (m *Options) XXX_Merge(src proto.Message) {\n\txxx_messageInfo_Options.Merge(m, src)\n}\nfunc (m *Options) XXX_Size() int {\n\treturn m.Size()\n}\nfunc (m *Options) XXX_DiscardUnknown() {\n\txxx_messageInfo_Options.DiscardUnknown(m)\n}\n\nvar xxx_messageInfo_Options proto.InternalMessageInfo\n\ntype CheckpointOptions struct {\n\t// exit the container after a checkpoint\n\tExit bool `protobuf:\"varint,1,opt,name=exit,proto3\" json:\"exit,omitempty\"`\n\t// checkpoint open tcp connections\n\tOpenTcp bool `protobuf:\"varint,2,opt,name=open_tcp,json=openTcp,proto3\" json:\"open_tcp,omitempty\"`\n\t// checkpoint external unix sockets\n\tExternalUnixSockets bool `protobuf:\"varint,3,opt,name=external_unix_sockets,json=externalUnixSockets,proto3\" json:\"external_unix_sockets,omitempty\"`\n\t// checkpoint terminals (ptys)\n\tTerminal bool `protobuf:\"varint,4,opt,name=terminal,proto3\" json:\"terminal,omitempty\"`\n\t// allow checkpointing of file locks\n\tFileLocks bool `protobuf:\"varint,5,opt,name=file_locks,json=fileLocks,proto3\" json:\"file_locks,omitempty\"`\n\t// restore provided namespaces as empty namespaces\n\tEmptyNamespaces []string `protobuf:\"bytes,6,rep,name=empty_namespaces,json=emptyNamespaces,proto3\" json:\"empty_namespaces,omitempty\"`\n\t// set the cgroups mode, soft, full, strict\n\tCgroupsMode string `protobuf:\"bytes,7,opt,name=cgroups_mode,json=cgroupsMode,proto3\" json:\"cgroups_mode,omitempty\"`\n\t// checkpoint image path\n\tImagePath string `protobuf:\"bytes,8,opt,name=image_path,json=imagePath,proto3\" json:\"image_path,omitempty\"`\n\t// checkpoint work path\n\tWorkPath string `protobuf:\"bytes,9,opt,name=work_path,json=workPath,proto3\" json:\"work_path,omitempty\"`\n\tXXX_NoUnkeyedLiteral struct{} `json:\"-\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n\tXXX_sizecache int32 `json:\"-\"`\n}\n\nfunc (m *CheckpointOptions) Reset() { *m = CheckpointOptions{} }\nfunc (*CheckpointOptions) ProtoMessage() {}\nfunc (*CheckpointOptions) Descriptor() ([]byte, []int) {\n\treturn fileDescriptor_4e5440d739e9a863, []int{1}\n}\nfunc (m *CheckpointOptions) XXX_Unmarshal(b []byte) error {\n\treturn m.Unmarshal(b)\n}\nfunc (m *CheckpointOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {\n\tif deterministic {\n\t\treturn xxx_messageInfo_CheckpointOptions.Marshal(b, m, deterministic)\n\t} else {\n\t\tb = b[:cap(b)]\n\t\tn, err := m.MarshalTo(b)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn b[:n], nil\n\t}\n}\nfunc (m *CheckpointOptions) XXX_Merge(src proto.Message) {\n\txxx_messageInfo_CheckpointOptions.Merge(m, src)\n}\nfunc (m *CheckpointOptions) XXX_Size() int {\n\treturn m.Size()\n}\nfunc (m *CheckpointOptions) XXX_DiscardUnknown() {\n\txxx_messageInfo_CheckpointOptions.DiscardUnknown(m)\n}\n\nvar xxx_messageInfo_CheckpointOptions proto.InternalMessageInfo\n\ntype ProcessDetails struct {\n\t// exec process id if the process is managed by a shim\n\tExecID string `protobuf:\"bytes,1,opt,name=exec_id,json=execId,proto3\" json:\"exec_id,omitempty\"`\n\tXXX_NoUnkeyedLiteral struct{} `json:\"-\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n\tXXX_sizecache int32 `json:\"-\"`\n}\n\nfunc (m *ProcessDetails) Reset() { *m = ProcessDetails{} }\nfunc (*ProcessDetails) ProtoMessage() {}\nfunc (*ProcessDetails) Descriptor() ([]byte, []int) {\n\treturn fileDescriptor_4e5440d739e9a863, []int{2}\n}\nfunc (m *ProcessDetails) XXX_Unmarshal(b []byte) error {\n\treturn m.Unmarshal(b)\n}\nfunc (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {\n\tif deterministic {\n\t\treturn xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic)\n\t} else {\n\t\tb = b[:cap(b)]\n\t\tn, err := m.MarshalTo(b)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn b[:n], nil\n\t}\n}\nfunc (m *ProcessDetails) XXX_Merge(src proto.Message) {\n\txxx_messageInfo_ProcessDetails.Merge(m, src)\n}\nfunc (m *ProcessDetails) XXX_Size() int {\n\treturn m.Size()\n}\nfunc (m *ProcessDetails) XXX_DiscardUnknown() {\n\txxx_messageInfo_ProcessDetails.DiscardUnknown(m)\n}\n\nvar xxx_messageInfo_ProcessDetails proto.InternalMessageInfo\n\nfunc init() {\n\tproto.RegisterType((*Options)(nil), \"containerd.runc.v1.Options\")\n\tproto.RegisterType((*CheckpointOptions)(nil), \"containerd.runc.v1.CheckpointOptions\")\n\tproto.RegisterType((*ProcessDetails)(nil), \"containerd.runc.v1.ProcessDetails\")\n}\n\nfunc init() {\n\tproto.RegisterFile(\"github.com/containerd/containerd/runtime/v2/runc/options/oci.proto\", fileDescriptor_4e5440d739e9a863)\n}\n\nvar fileDescriptor_4e5440d739e9a863 = []byte{\n\t// 587 bytes of a gzipped FileDescriptorProto\n\t0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd3, 0x40,\n\t0x10, 0x87, 0xeb, 0xfe, 0x49, 0xec, 0x4d, 0x93, 0xc2, 0x42, 0x25, 0xd3, 0x8a, 0x34, 0x94, 0x82,\n\t0xc2, 0x25, 0x11, 0x45, 0x9c, 0xb8, 0xa0, 0xb6, 0x08, 0x55, 0x40, 0xa9, 0x0c, 0x15, 0xa8, 0x97,\n\t0x95, 0xbb, 0x1e, 0x9c, 0x51, 0xe2, 0x1d, 0xcb, 0xbb, 0x69, 0xd2, 0x1b, 0xef, 0xc5, 0x0b, 0xf4,\n\t0xc8, 0x91, 0x13, 0xa2, 0xb9, 0xf1, 0x16, 0x68, 0xd7, 0x4e, 0xdb, 0x33, 0x27, 0xcf, 0x7e, 0xf3,\n\t0xf3, 0x78, 0xfd, 0xad, 0x96, 0xed, 0xa5, 0x68, 0x06, 0xe3, 0xb3, 0x9e, 0xa4, 0xac, 0x2f, 0x49,\n\t0x99, 0x18, 0x15, 0x14, 0xc9, 0xed, 0xb2, 0x18, 0x2b, 0x83, 0x19, 0xf4, 0xcf, 0x77, 0x6d, 0x29,\n\t0xfb, 0x94, 0x1b, 0x24, 0xa5, 0xfb, 0x24, 0xb1, 0x97, 0x17, 0x64, 0x88, 0xf3, 0x9b, 0x74, 0xcf,\n\t0x46, 0x7a, 0xe7, 0xcf, 0x37, 0xee, 0xa7, 0x94, 0x92, 0x6b, 0xf7, 0x6d, 0x55, 0x26, 0xb7, 0xff,\n\t0x2e, 0xb2, 0xfa, 0xc7, 0xf2, 0x7d, 0xbe, 0xcd, 0x9a, 0x8a, 0x44, 0x8e, 0xe7, 0x64, 0x44, 0x41,\n\t0x64, 0x42, 0xaf, 0xe3, 0x75, 0xfd, 0xa8, 0xa1, 0xe8, 0xd8, 0xb2, 0x88, 0xc8, 0xf0, 0x1d, 0xd6,\n\t0x52, 0x24, 0x14, 0x4c, 0xc4, 0x10, 0x2e, 0x0a, 0x54, 0x69, 0xb8, 0xe8, 0x42, 0xab, 0x8a, 0x8e,\n\t0x60, 0xf2, 0xae, 0x64, 0x7c, 0x8b, 0x35, 0xf4, 0x00, 0x33, 0x21, 0xd3, 0x82, 0xc6, 0x79, 0xb8,\n\t0xd4, 0xf1, 0xba, 0x41, 0xc4, 0x2c, 0xda, 0x77, 0x84, 0xaf, 0xb3, 0x1a, 0x92, 0x18, 0x63, 0x12,\n\t0x2e, 0x77, 0xbc, 0x6e, 0x33, 0x5a, 0x41, 0x3a, 0xc1, 0xa4, 0xc2, 0x29, 0x26, 0xe1, 0xca, 0x1c,\n\t0xbf, 0xc5, 0xc4, 0x8e, 0x3b, 0x43, 0x15, 0x17, 0x17, 0x42, 0xc5, 0x19, 0x84, 0xb5, 0x72, 0x5c,\n\t0x89, 0x8e, 0xe2, 0x0c, 0x38, 0x67, 0xcb, 0x6e, 0xc3, 0x75, 0xd7, 0x71, 0x35, 0xdf, 0x64, 0x81,\n\t0x2c, 0x70, 0x2c, 0xf2, 0xd8, 0x0c, 0x42, 0xdf, 0x35, 0x7c, 0x0b, 0x8e, 0x63, 0x33, 0xe0, 0x4f,\n\t0x58, 0x4b, 0x5f, 0x68, 0x03, 0x59, 0x32, 0xdf, 0x63, 0xe0, 0x7e, 0xa3, 0x59, 0xd1, 0x6a, 0x9b,\n\t0x4f, 0xd9, 0x9a, 0x9b, 0x81, 0x59, 0x9c, 0x42, 0x39, 0x89, 0xb9, 0x49, 0x4d, 0x8b, 0x0f, 0x2d,\n\t0x75, 0xe3, 0x76, 0x58, 0xcb, 0xe5, 0x26, 0x54, 0x0c, 0xcb, 0x58, 0xc3, 0xc5, 0x56, 0x2d, 0xfd,\n\t0x42, 0xc5, 0xd0, 0xa6, 0xb6, 0x7f, 0x2c, 0xb2, 0xbb, 0xfb, 0x03, 0x90, 0xc3, 0x9c, 0x50, 0x99,\n\t0xb9, 0x75, 0xce, 0x96, 0x61, 0x8a, 0x73, 0xd9, 0xae, 0xe6, 0x0f, 0x98, 0x4f, 0x39, 0x28, 0x61,\n\t0x64, 0x5e, 0xf9, 0xad, 0xdb, 0xf5, 0x67, 0x99, 0xf3, 0x5d, 0xb6, 0x0e, 0x53, 0x03, 0x85, 0x8a,\n\t0x47, 0x62, 0xac, 0x70, 0x2a, 0x34, 0xc9, 0x21, 0x18, 0xed, 0x24, 0xfb, 0xd1, 0xbd, 0x79, 0xf3,\n\t0x44, 0xe1, 0xf4, 0x53, 0xd9, 0xe2, 0x1b, 0xcc, 0x37, 0x50, 0x64, 0xa8, 0xe2, 0x91, 0xf3, 0xed,\n\t0x47, 0xd7, 0x6b, 0xfe, 0x90, 0xb1, 0x6f, 0x38, 0x02, 0x31, 0x22, 0x39, 0xd4, 0x4e, 0xbb, 0x1f,\n\t0x05, 0x96, 0xbc, 0xb7, 0x80, 0x3f, 0x63, 0x77, 0x20, 0xcb, 0x4d, 0x69, 0x5e, 0xe7, 0xb1, 0x04,\n\t0x1d, 0xd6, 0x3a, 0x4b, 0xdd, 0x20, 0x5a, 0x73, 0xfc, 0xe8, 0x1a, 0xf3, 0x47, 0x6c, 0xb5, 0x74,\n\t0xa9, 0x45, 0x46, 0x09, 0x54, 0x87, 0xd1, 0xa8, 0xd8, 0x07, 0x4a, 0xc0, 0x7e, 0xec, 0x96, 0xca,\n\t0xf2, 0x50, 0x02, 0xbc, 0xd6, 0xb8, 0xc9, 0x82, 0x1b, 0x83, 0x41, 0x79, 0x64, 0x93, 0xb9, 0xbd,\n\t0x97, 0xac, 0x75, 0x5c, 0x90, 0x04, 0xad, 0x0f, 0xc0, 0xc4, 0x38, 0xd2, 0xfc, 0x31, 0xab, 0xc3,\n\t0x14, 0xa4, 0xc0, 0xc4, 0xc9, 0x0b, 0xf6, 0xd8, 0xec, 0xf7, 0x56, 0xed, 0xcd, 0x14, 0xe4, 0xe1,\n\t0x41, 0x54, 0xb3, 0xad, 0xc3, 0x64, 0xef, 0xf4, 0xf2, 0xaa, 0xbd, 0xf0, 0xeb, 0xaa, 0xbd, 0xf0,\n\t0x7d, 0xd6, 0xf6, 0x2e, 0x67, 0x6d, 0xef, 0xe7, 0xac, 0xed, 0xfd, 0x99, 0xb5, 0xbd, 0xd3, 0xd7,\n\t0xff, 0x7b, 0xd1, 0x5e, 0x55, 0xcf, 0xaf, 0x0b, 0x67, 0x35, 0x77, 0x8b, 0x5e, 0xfc, 0x0b, 0x00,\n\t0x00, 0xff, 0xff, 0x90, 0x50, 0x79, 0xf2, 0xb5, 0x03, 0x00, 0x00,\n}\n\nfunc (m *Options) Marshal() (dAtA []byte, err error) {\n\tsize := m.Size()\n\tdAtA = make([]byte, size)\n\tn, err := m.MarshalTo(dAtA)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dAtA[:n], nil\n}\n\nfunc (m *Options) MarshalTo(dAtA []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.NoPivotRoot {\n\t\tdAtA[i] = 0x8\n\t\ti++\n\t\tif m.NoPivotRoot {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif m.NoNewKeyring {\n\t\tdAtA[i] = 0x10\n\t\ti++\n\t\tif m.NoNewKeyring {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif len(m.ShimCgroup) > 0 {\n\t\tdAtA[i] = 0x1a\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.ShimCgroup)))\n\t\ti += copy(dAtA[i:], m.ShimCgroup)\n\t}\n\tif m.IoUid != 0 {\n\t\tdAtA[i] = 0x20\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(m.IoUid))\n\t}\n\tif m.IoGid != 0 {\n\t\tdAtA[i] = 0x28\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(m.IoGid))\n\t}\n\tif len(m.BinaryName) > 0 {\n\t\tdAtA[i] = 0x32\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.BinaryName)))\n\t\ti += copy(dAtA[i:], m.BinaryName)\n\t}\n\tif len(m.Root) > 0 {\n\t\tdAtA[i] = 0x3a\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.Root)))\n\t\ti += copy(dAtA[i:], m.Root)\n\t}\n\tif len(m.CriuPath) > 0 {\n\t\tdAtA[i] = 0x42\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.CriuPath)))\n\t\ti += copy(dAtA[i:], m.CriuPath)\n\t}\n\tif m.SystemdCgroup {\n\t\tdAtA[i] = 0x48\n\t\ti++\n\t\tif m.SystemdCgroup {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif len(m.CriuImagePath) > 0 {\n\t\tdAtA[i] = 0x52\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.CriuImagePath)))\n\t\ti += copy(dAtA[i:], m.CriuImagePath)\n\t}\n\tif len(m.CriuWorkPath) > 0 {\n\t\tdAtA[i] = 0x5a\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.CriuWorkPath)))\n\t\ti += copy(dAtA[i:], m.CriuWorkPath)\n\t}\n\tif m.XXX_unrecognized != nil {\n\t\ti += copy(dAtA[i:], m.XXX_unrecognized)\n\t}\n\treturn i, nil\n}\n\nfunc (m *CheckpointOptions) Marshal() (dAtA []byte, err error) {\n\tsize := m.Size()\n\tdAtA = make([]byte, size)\n\tn, err := m.MarshalTo(dAtA)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dAtA[:n], nil\n}\n\nfunc (m *CheckpointOptions) MarshalTo(dAtA []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.Exit {\n\t\tdAtA[i] = 0x8\n\t\ti++\n\t\tif m.Exit {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif m.OpenTcp {\n\t\tdAtA[i] = 0x10\n\t\ti++\n\t\tif m.OpenTcp {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif m.ExternalUnixSockets {\n\t\tdAtA[i] = 0x18\n\t\ti++\n\t\tif m.ExternalUnixSockets {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif m.Terminal {\n\t\tdAtA[i] = 0x20\n\t\ti++\n\t\tif m.Terminal {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif m.FileLocks {\n\t\tdAtA[i] = 0x28\n\t\ti++\n\t\tif m.FileLocks {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif len(m.EmptyNamespaces) > 0 {\n\t\tfor _, s := range m.EmptyNamespaces {\n\t\t\tdAtA[i] = 0x32\n\t\t\ti++\n\t\t\tl = len(s)\n\t\t\tfor l >= 1<<7 {\n\t\t\t\tdAtA[i] = uint8(uint64(l)&0x7f | 0x80)\n\t\t\t\tl >>= 7\n\t\t\t\ti++\n\t\t\t}\n\t\t\tdAtA[i] = uint8(l)\n\t\t\ti++\n\t\t\ti += copy(dAtA[i:], s)\n\t\t}\n\t}\n\tif len(m.CgroupsMode) > 0 {\n\t\tdAtA[i] = 0x3a\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.CgroupsMode)))\n\t\ti += copy(dAtA[i:], m.CgroupsMode)\n\t}\n\tif len(m.ImagePath) > 0 {\n\t\tdAtA[i] = 0x42\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.ImagePath)))\n\t\ti += copy(dAtA[i:], m.ImagePath)\n\t}\n\tif len(m.WorkPath) > 0 {\n\t\tdAtA[i] = 0x4a\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.WorkPath)))\n\t\ti += copy(dAtA[i:], m.WorkPath)\n\t}\n\tif m.XXX_unrecognized != nil {\n\t\ti += copy(dAtA[i:], m.XXX_unrecognized)\n\t}\n\treturn i, nil\n}\n\nfunc (m *ProcessDetails) Marshal() (dAtA []byte, err error) {\n\tsize := m.Size()\n\tdAtA = make([]byte, size)\n\tn, err := m.MarshalTo(dAtA)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dAtA[:n], nil\n}\n\nfunc (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif len(m.ExecID) > 0 {\n\t\tdAtA[i] = 0xa\n\t\ti++\n\t\ti = encodeVarintOci(dAtA, i, uint64(len(m.ExecID)))\n\t\ti += copy(dAtA[i:], m.ExecID)\n\t}\n\tif m.XXX_unrecognized != nil {\n\t\ti += copy(dAtA[i:], m.XXX_unrecognized)\n\t}\n\treturn i, nil\n}\n\nfunc encodeVarintOci(dAtA []byte, offset int, v uint64) int {\n\tfor v >= 1<<7 {\n\t\tdAtA[offset] = uint8(v&0x7f | 0x80)\n\t\tv >>= 7\n\t\toffset++\n\t}\n\tdAtA[offset] = uint8(v)\n\treturn offset + 1\n}\nfunc (m *Options) Size() (n int) {\n\tif m == nil {\n\t\treturn 0\n\t}\n\tvar l int\n\t_ = l\n\tif m.NoPivotRoot {\n\t\tn += 2\n\t}\n\tif m.NoNewKeyring {\n\t\tn += 2\n\t}\n\tl = len(m.ShimCgroup)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tif m.IoUid != 0 {\n\t\tn += 1 + sovOci(uint64(m.IoUid))\n\t}\n\tif m.IoGid != 0 {\n\t\tn += 1 + sovOci(uint64(m.IoGid))\n\t}\n\tl = len(m.BinaryName)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tl = len(m.Root)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tl = len(m.CriuPath)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tif m.SystemdCgroup {\n\t\tn += 2\n\t}\n\tl = len(m.CriuImagePath)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tl = len(m.CriuWorkPath)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tif m.XXX_unrecognized != nil {\n\t\tn += len(m.XXX_unrecognized)\n\t}\n\treturn n\n}\n\nfunc (m *CheckpointOptions) Size() (n int) {\n\tif m == nil {\n\t\treturn 0\n\t}\n\tvar l int\n\t_ = l\n\tif m.Exit {\n\t\tn += 2\n\t}\n\tif m.OpenTcp {\n\t\tn += 2\n\t}\n\tif m.ExternalUnixSockets {\n\t\tn += 2\n\t}\n\tif m.Terminal {\n\t\tn += 2\n\t}\n\tif m.FileLocks {\n\t\tn += 2\n\t}\n\tif len(m.EmptyNamespaces) > 0 {\n\t\tfor _, s := range m.EmptyNamespaces {\n\t\t\tl = len(s)\n\t\t\tn += 1 + l + sovOci(uint64(l))\n\t\t}\n\t}\n\tl = len(m.CgroupsMode)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tl = len(m.ImagePath)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tl = len(m.WorkPath)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tif m.XXX_unrecognized != nil {\n\t\tn += len(m.XXX_unrecognized)\n\t}\n\treturn n\n}\n\nfunc (m *ProcessDetails) Size() (n int) {\n\tif m == nil {\n\t\treturn 0\n\t}\n\tvar l int\n\t_ = l\n\tl = len(m.ExecID)\n\tif l > 0 {\n\t\tn += 1 + l + sovOci(uint64(l))\n\t}\n\tif m.XXX_unrecognized != nil {\n\t\tn += len(m.XXX_unrecognized)\n\t}\n\treturn n\n}\n\nfunc sovOci(x uint64) (n int) {\n\tfor {\n\t\tn++\n\t\tx >>= 7\n\t\tif x == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn n\n}\nfunc sozOci(x uint64) (n int) {\n\treturn sovOci(uint64((x << 1) ^ uint64((int64(x) >> 63))))\n}\nfunc (this *Options) String() string {\n\tif this == nil {\n\t\treturn \"nil\"\n\t}\n\ts := strings.Join([]string{`&Options{`,\n\t\t`NoPivotRoot:` + fmt.Sprintf(\"%v\", this.NoPivotRoot) + `,`,\n\t\t`NoNewKeyring:` + fmt.Sprintf(\"%v\", this.NoNewKeyring) + `,`,\n\t\t`ShimCgroup:` + fmt.Sprintf(\"%v\", this.ShimCgroup) + `,`,\n\t\t`IoUid:` + fmt.Sprintf(\"%v\", this.IoUid) + `,`,\n\t\t`IoGid:` + fmt.Sprintf(\"%v\", this.IoGid) + `,`,\n\t\t`BinaryName:` + fmt.Sprintf(\"%v\", this.BinaryName) + `,`,\n\t\t`Root:` + fmt.Sprintf(\"%v\", this.Root) + `,`,\n\t\t`CriuPath:` + fmt.Sprintf(\"%v\", this.CriuPath) + `,`,\n\t\t`SystemdCgroup:` + fmt.Sprintf(\"%v\", this.SystemdCgroup) + `,`,\n\t\t`CriuImagePath:` + fmt.Sprintf(\"%v\", this.CriuImagePath) + `,`,\n\t\t`CriuWorkPath:` + fmt.Sprintf(\"%v\", this.CriuWorkPath) + `,`,\n\t\t`XXX_unrecognized:` + fmt.Sprintf(\"%v\", this.XXX_unrecognized) + `,`,\n\t\t`}`,\n\t}, \"\")\n\treturn s\n}\nfunc (this *CheckpointOptions) String() string {\n\tif this == nil {\n\t\treturn \"nil\"\n\t}\n\ts := strings.Join([]string{`&CheckpointOptions{`,\n\t\t`Exit:` + fmt.Sprintf(\"%v\", this.Exit) + `,`,\n\t\t`OpenTcp:` + fmt.Sprintf(\"%v\", this.OpenTcp) + `,`,\n\t\t`ExternalUnixSockets:` + fmt.Sprintf(\"%v\", this.ExternalUnixSockets) + `,`,\n\t\t`Terminal:` + fmt.Sprintf(\"%v\", this.Terminal) + `,`,\n\t\t`FileLocks:` + fmt.Sprintf(\"%v\", this.FileLocks) + `,`,\n\t\t`EmptyNamespaces:` + fmt.Sprintf(\"%v\", this.EmptyNamespaces) + `,`,\n\t\t`CgroupsMode:` + fmt.Sprintf(\"%v\", this.CgroupsMode) + `,`,\n\t\t`ImagePath:` + fmt.Sprintf(\"%v\", this.ImagePath) + `,`,\n\t\t`WorkPath:` + fmt.Sprintf(\"%v\", this.WorkPath) + `,`,\n\t\t`XXX_unrecognized:` + fmt.Sprintf(\"%v\", this.XXX_unrecognized) + `,`,\n\t\t`}`,\n\t}, \"\")\n\treturn s\n}\nfunc (this *ProcessDetails) String() string {\n\tif this == nil {\n\t\treturn \"nil\"\n\t}\n\ts := strings.Join([]string{`&ProcessDetails{`,\n\t\t`ExecID:` + fmt.Sprintf(\"%v\", this.ExecID) + `,`,\n\t\t`XXX_unrecognized:` + fmt.Sprintf(\"%v\", this.XXX_unrecognized) + `,`,\n\t\t`}`,\n\t}, \"\")\n\treturn s\n}\nfunc valueToStringOci(v interface{}) string {\n\trv := reflect.ValueOf(v)\n\tif rv.IsNil() {\n\t\treturn \"nil\"\n\t}\n\tpv := reflect.Indirect(rv).Interface()\n\treturn fmt.Sprintf(\"*%v\", pv)\n}\nfunc (m *Options) Unmarshal(dAtA []byte) error {\n\tl := len(dAtA)\n\tiNdEx := 0\n\tfor iNdEx < l {\n\t\tpreIndex := iNdEx\n\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn ErrIntOverflowOci\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= uint64(b&0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfieldNum := int32(wire >> 3)\n\t\twireType := int(wire & 0x7)\n\t\tif wireType == 4 {\n\t\t\treturn fmt.Errorf(\"proto: Options: wiretype end group for non-group\")\n\t\t}\n\t\tif fieldNum <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: Options: illegal tag %d (wire type %d)\", fieldNum, wire)\n\t\t}\n\t\tswitch fieldNum {\n\t\tcase 1:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field NoPivotRoot\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.NoPivotRoot = bool(v != 0)\n\t\tcase 2:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field NoNewKeyring\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.NoNewKeyring = bool(v != 0)\n\t\tcase 3:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field ShimCgroup\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.ShimCgroup = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 4:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field IoUid\", wireType)\n\t\t\t}\n\t\t\tm.IoUid = 0\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tm.IoUid |= uint32(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tcase 5:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field IoGid\", wireType)\n\t\t\t}\n\t\t\tm.IoGid = 0\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tm.IoGid |= uint32(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tcase 6:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field BinaryName\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.BinaryName = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 7:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Root\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.Root = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 8:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field CriuPath\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.CriuPath = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 9:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field SystemdCgroup\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.SystemdCgroup = bool(v != 0)\n\t\tcase 10:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field CriuImagePath\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.CriuImagePath = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 11:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field CriuWorkPath\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.CriuWorkPath = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tdefault:\n\t\t\tiNdEx = preIndex\n\t\t\tskippy, err := skipOci(dAtA[iNdEx:])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif skippy < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif (iNdEx + skippy) < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif (iNdEx + skippy) > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)\n\t\t\tiNdEx += skippy\n\t\t}\n\t}\n\n\tif iNdEx > l {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\treturn nil\n}\nfunc (m *CheckpointOptions) Unmarshal(dAtA []byte) error {\n\tl := len(dAtA)\n\tiNdEx := 0\n\tfor iNdEx < l {\n\t\tpreIndex := iNdEx\n\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn ErrIntOverflowOci\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= uint64(b&0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfieldNum := int32(wire >> 3)\n\t\twireType := int(wire & 0x7)\n\t\tif wireType == 4 {\n\t\t\treturn fmt.Errorf(\"proto: CheckpointOptions: wiretype end group for non-group\")\n\t\t}\n\t\tif fieldNum <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: CheckpointOptions: illegal tag %d (wire type %d)\", fieldNum, wire)\n\t\t}\n\t\tswitch fieldNum {\n\t\tcase 1:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Exit\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.Exit = bool(v != 0)\n\t\tcase 2:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field OpenTcp\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.OpenTcp = bool(v != 0)\n\t\tcase 3:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field ExternalUnixSockets\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.ExternalUnixSockets = bool(v != 0)\n\t\tcase 4:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Terminal\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.Terminal = bool(v != 0)\n\t\tcase 5:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field FileLocks\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.FileLocks = bool(v != 0)\n\t\tcase 6:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field EmptyNamespaces\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.EmptyNamespaces = append(m.EmptyNamespaces, string(dAtA[iNdEx:postIndex]))\n\t\t\tiNdEx = postIndex\n\t\tcase 7:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field CgroupsMode\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.CgroupsMode = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 8:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field ImagePath\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.ImagePath = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 9:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field WorkPath\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.WorkPath = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tdefault:\n\t\t\tiNdEx = preIndex\n\t\t\tskippy, err := skipOci(dAtA[iNdEx:])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif skippy < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif (iNdEx + skippy) < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif (iNdEx + skippy) > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)\n\t\t\tiNdEx += skippy\n\t\t}\n\t}\n\n\tif iNdEx > l {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\treturn nil\n}\nfunc (m *ProcessDetails) Unmarshal(dAtA []byte) error {\n\tl := len(dAtA)\n\tiNdEx := 0\n\tfor iNdEx < l {\n\t\tpreIndex := iNdEx\n\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn ErrIntOverflowOci\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= uint64(b&0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfieldNum := int32(wire >> 3)\n\t\twireType := int(wire & 0x7)\n\t\tif wireType == 4 {\n\t\t\treturn fmt.Errorf(\"proto: ProcessDetails: wiretype end group for non-group\")\n\t\t}\n\t\tif fieldNum <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: ProcessDetails: illegal tag %d (wire type %d)\", fieldNum, wire)\n\t\t}\n\t\tswitch fieldNum {\n\t\tcase 1:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field ExecID\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.ExecID = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tdefault:\n\t\t\tiNdEx = preIndex\n\t\t\tskippy, err := skipOci(dAtA[iNdEx:])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif skippy < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif (iNdEx + skippy) < 0 {\n\t\t\t\treturn ErrInvalidLengthOci\n\t\t\t}\n\t\t\tif (iNdEx + skippy) > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)\n\t\t\tiNdEx += skippy\n\t\t}\n\t}\n\n\tif iNdEx > l {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\treturn nil\n}\nfunc skipOci(dAtA []byte) (n int, err error) {\n\tl := len(dAtA)\n\tiNdEx := 0\n\tfor iNdEx < l {\n\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn 0, ErrIntOverflowOci\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= (uint64(b) & 0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\twireType := int(wire & 0x7)\n\t\tswitch wireType {\n\t\tcase 0:\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn 0, ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tiNdEx++\n\t\t\t\tif dAtA[iNdEx-1] < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn iNdEx, nil\n\t\tcase 1:\n\t\t\tiNdEx += 8\n\t\t\treturn iNdEx, nil\n\t\tcase 2:\n\t\t\tvar length int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn 0, ErrIntOverflowOci\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tlength |= (int(b) & 0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif length < 0 {\n\t\t\t\treturn 0, ErrInvalidLengthOci\n\t\t\t}\n\t\t\tiNdEx += length\n\t\t\tif iNdEx < 0 {\n\t\t\t\treturn 0, ErrInvalidLengthOci\n\t\t\t}\n\t\t\treturn iNdEx, nil\n\t\tcase 3:\n\t\t\tfor {\n\t\t\t\tvar innerWire uint64\n\t\t\t\tvar start int = iNdEx\n\t\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\t\tif shift >= 64 {\n\t\t\t\t\t\treturn 0, ErrIntOverflowOci\n\t\t\t\t\t}\n\t\t\t\t\tif iNdEx >= l {\n\t\t\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t\t\t}\n\t\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\t\tiNdEx++\n\t\t\t\t\tinnerWire |= (uint64(b) & 0x7F) << shift\n\t\t\t\t\tif b < 0x80 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinnerWireType := int(innerWire & 0x7)\n\t\t\t\tif innerWireType == 4 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tnext, err := skipOci(dAtA[start:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\tiNdEx = start + next\n\t\t\t\tif iNdEx < 0 {\n\t\t\t\t\treturn 0, ErrInvalidLengthOci\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn iNdEx, nil\n\t\tcase 4:\n\t\t\treturn iNdEx, nil\n\t\tcase 5:\n\t\t\tiNdEx += 4\n\t\t\treturn iNdEx, nil\n\t\tdefault:\n\t\t\treturn 0, fmt.Errorf(\"proto: illegal wireType %d\", wireType)\n\t\t}\n\t}\n\tpanic(\"unreachable\")\n}\n\nvar (\n\tErrInvalidLengthOci = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowOci = fmt.Errorf(\"proto: integer overflow\")\n)\n"} +{"text": "info face=\"Curse Casual JVE\" size=100 bold=0 italic=0 charset=\"\" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=0,0\ncommon lineHeight=58 base=38 scaleW=512 scaleH=512 pages=1 packed=0\npage id=0 file=\"Curse-hd.png\"\nchars count=95\nchar id=32 x=70 y=96 width=0 height=0 xoffset=0 yoffset=82 xadvance=10 page=0 chnl=0\nchar id=33 x=64 y=172 width=16 height=68 xoffset=2 yoffset=17 xadvance=17 page=0 chnl=0\nchar id=34 x=452 y=54 width=30 height=26 xoffset=2 yoffset=13 xadvance=31 page=0 chnl=0\nchar id=35 x=322 y=212 width=36 height=56 xoffset=2 yoffset=23 xadvance=36 page=0 chnl=0\nchar id=36 x=2 y=398 width=34 height=86 xoffset=2 yoffset=8 xadvance=35 page=0 chnl=0\nchar id=37 x=2 y=96 width=66 height=74 xoffset=2 yoffset=13 xadvance=67 page=0 chnl=0\nchar id=38 x=388 y=2 width=36 height=70 xoffset=2 yoffset=15 xadvance=36 page=0 chnl=0\nchar id=39 x=258 y=454 width=16 height=26 xoffset=2 yoffset=13 xadvance=17 page=0 chnl=0\nchar id=40 x=192 y=374 width=24 height=88 xoffset=2 yoffset=6 xadvance=26 page=0 chnl=0\nchar id=41 x=192 y=284 width=24 height=88 xoffset=2 yoffset=6 xadvance=26 page=0 chnl=0\nchar id=42 x=484 y=54 width=24 height=26 xoffset=2 yoffset=15 xadvance=24 page=0 chnl=0\nchar id=43 x=38 y=470 width=36 height=36 xoffset=2 yoffset=29 xadvance=37 page=0 chnl=0\nchar id=44 x=192 y=464 width=16 height=26 xoffset=2 yoffset=67 xadvance=17 page=0 chnl=0\nchar id=45 x=2 y=486 width=24 height=14 xoffset=2 yoffset=45 xadvance=24 page=0 chnl=0\nchar id=46 x=150 y=72 width=16 height=16 xoffset=2 yoffset=68 xadvance=17 page=0 chnl=0\nchar id=47 x=116 y=2 width=32 height=86 xoffset=2 yoffset=8 xadvance=33 page=0 chnl=0\nchar id=48 x=272 y=2 width=38 height=68 xoffset=2 yoffset=17 xadvance=39 page=0 chnl=0\nchar id=49 x=280 y=424 width=22 height=68 xoffset=2 yoffset=17 xadvance=23 page=0 chnl=0\nchar id=50 x=192 y=142 width=34 height=68 xoffset=2 yoffset=16 xadvance=35 page=0 chnl=0\nchar id=51 x=120 y=358 width=34 height=70 xoffset=2 yoffset=15 xadvance=35 page=0 chnl=0\nchar id=52 x=82 y=440 width=36 height=68 xoffset=2 yoffset=16 xadvance=37 page=0 chnl=0\nchar id=53 x=156 y=422 width=34 height=68 xoffset=3 yoffset=17 xadvance=35 page=0 chnl=0\nchar id=54 x=120 y=286 width=34 height=70 xoffset=2 yoffset=16 xadvance=37 page=0 chnl=0\nchar id=55 x=192 y=212 width=32 height=70 xoffset=2 yoffset=16 xadvance=32 page=0 chnl=0\nchar id=56 x=156 y=352 width=34 height=68 xoffset=2 yoffset=17 xadvance=35 page=0 chnl=0\nchar id=57 x=120 y=214 width=34 height=70 xoffset=3 yoffset=16 xadvance=37 page=0 chnl=0\nchar id=58 x=226 y=460 width=16 height=48 xoffset=2 yoffset=36 xadvance=17 page=0 chnl=0\nchar id=59 x=346 y=282 width=16 height=56 xoffset=2 yoffset=37 xadvance=17 page=0 chnl=0\nchar id=60 x=440 y=90 width=30 height=44 xoffset=2 yoffset=28 xadvance=31 page=0 chnl=0\nchar id=61 x=426 y=54 width=24 height=34 xoffset=2 yoffset=33 xadvance=24 page=0 chnl=0\nchar id=62 x=408 y=90 width=30 height=44 xoffset=2 yoffset=28 xadvance=31 page=0 chnl=0\nchar id=63 x=398 y=142 width=32 height=68 xoffset=3 yoffset=16 xadvance=34 page=0 chnl=0\nchar id=64 x=2 y=2 width=78 height=92 xoffset=2 yoffset=7 xadvance=79 page=0 chnl=0\nchar id=65 x=150 y=2 width=40 height=68 xoffset=2 yoffset=17 xadvance=40 page=0 chnl=0\nchar id=66 x=156 y=282 width=34 height=68 xoffset=2 yoffset=16 xadvance=36 page=0 chnl=0\nchar id=67 x=82 y=370 width=36 height=68 xoffset=2 yoffset=16 xadvance=37 page=0 chnl=0\nchar id=68 x=82 y=300 width=36 height=68 xoffset=2 yoffset=16 xadvance=36 page=0 chnl=0\nchar id=69 x=360 y=212 width=28 height=68 xoffset=2 yoffset=16 xadvance=28 page=0 chnl=0\nchar id=70 x=52 y=244 width=28 height=68 xoffset=2 yoffset=16 xadvance=28 page=0 chnl=0\nchar id=71 x=82 y=230 width=36 height=68 xoffset=2 yoffset=17 xadvance=37 page=0 chnl=0\nchar id=72 x=364 y=142 width=32 height=68 xoffset=2 yoffset=16 xadvance=33 page=0 chnl=0\nchar id=73 x=330 y=282 width=14 height=68 xoffset=2 yoffset=17 xadvance=14 page=0 chnl=0\nchar id=74 x=390 y=212 width=26 height=68 xoffset=2 yoffset=16 xadvance=26 page=0 chnl=0\nchar id=75 x=350 y=2 width=36 height=70 xoffset=2 yoffset=16 xadvance=37 page=0 chnl=0\nchar id=76 x=290 y=212 width=30 height=68 xoffset=2 yoffset=16 xadvance=30 page=0 chnl=0\nchar id=77 x=2 y=244 width=48 height=68 xoffset=2 yoffset=16 xadvance=48 page=0 chnl=0\nchar id=78 x=82 y=160 width=36 height=68 xoffset=2 yoffset=17 xadvance=36 page=0 chnl=0\nchar id=79 x=232 y=2 width=38 height=68 xoffset=2 yoffset=17 xadvance=39 page=0 chnl=0\nchar id=80 x=156 y=212 width=34 height=68 xoffset=2 yoffset=16 xadvance=36 page=0 chnl=0\nchar id=81 x=2 y=314 width=38 height=82 xoffset=2 yoffset=16 xadvance=39 page=0 chnl=0\nchar id=82 x=312 y=2 width=36 height=70 xoffset=2 yoffset=16 xadvance=37 page=0 chnl=0\nchar id=83 x=156 y=142 width=34 height=68 xoffset=2 yoffset=16 xadvance=35 page=0 chnl=0\nchar id=84 x=120 y=430 width=34 height=68 xoffset=2 yoffset=16 xadvance=34 page=0 chnl=0\nchar id=85 x=82 y=90 width=36 height=68 xoffset=2 yoffset=16 xadvance=36 page=0 chnl=0\nchar id=86 x=192 y=2 width=38 height=68 xoffset=2 yoffset=16 xadvance=39 page=0 chnl=0\nchar id=87 x=2 y=172 width=60 height=70 xoffset=2 yoffset=15 xadvance=60 page=0 chnl=0\nchar id=88 x=38 y=398 width=40 height=70 xoffset=2 yoffset=15 xadvance=40 page=0 chnl=0\nchar id=89 x=42 y=314 width=38 height=70 xoffset=2 yoffset=14 xadvance=38 page=0 chnl=0\nchar id=90 x=258 y=212 width=30 height=68 xoffset=2 yoffset=17 xadvance=31 page=0 chnl=0\nchar id=91 x=280 y=336 width=18 height=86 xoffset=2 yoffset=8 xadvance=19 page=0 chnl=0\nchar id=92 x=82 y=2 width=32 height=86 xoffset=2 yoffset=8 xadvance=33 page=0 chnl=0\nchar id=93 x=258 y=366 width=18 height=86 xoffset=2 yoffset=8 xadvance=19 page=0 chnl=0\nchar id=94 x=63 y=84 width=26 height=24 xoffset=4 yoffset=5 xadvance=26 page=0 chnl=0\nchar id=95 x=57 y=94 width=34 height=8 xoffset=-3 yoffset=47 xadvance=30 page=0 chnl=0\nchar id=96 x=258 y=482 width=16 height=18 xoffset=2 yoffset=16 xadvance=16 page=0 chnl=0\nchar id=97 x=240 y=90 width=32 height=50 xoffset=2 yoffset=37 xadvance=34 page=0 chnl=0\nchar id=98 x=330 y=142 width=32 height=68 xoffset=2 yoffset=17 xadvance=33 page=0 chnl=0\nchar id=99 x=342 y=90 width=32 height=48 xoffset=2 yoffset=37 xadvance=33 page=0 chnl=0\nchar id=100 x=296 y=142 width=32 height=68 xoffset=2 yoffset=17 xadvance=33 page=0 chnl=0\nchar id=101 x=308 y=90 width=32 height=48 xoffset=3 yoffset=37 xadvance=33 page=0 chnl=0\nchar id=102 x=444 y=212 width=24 height=68 xoffset=2 yoffset=17 xadvance=25 page=0 chnl=0\nchar id=103 x=262 y=142 width=32 height=68 xoffset=2 yoffset=34 xadvance=34 page=0 chnl=0\nchar id=104 x=226 y=212 width=30 height=70 xoffset=2 yoffset=16 xadvance=32 page=0 chnl=0\nchar id=105 x=312 y=282 width=16 height=66 xoffset=2 yoffset=19 xadvance=17 page=0 chnl=0\nchar id=106 x=258 y=282 width=20 height=82 xoffset=2 yoffset=19 xadvance=21 page=0 chnl=0\nchar id=107 x=120 y=142 width=34 height=70 xoffset=2 yoffset=15 xadvance=34 page=0 chnl=0\nchar id=108 x=312 y=438 width=14 height=68 xoffset=2 yoffset=17 xadvance=14 page=0 chnl=0\nchar id=109 x=120 y=90 width=48 height=50 xoffset=2 yoffset=34 xadvance=48 page=0 chnl=0\nchar id=110 x=280 y=282 width=30 height=52 xoffset=2 yoffset=34 xadvance=31 page=0 chnl=0\nchar id=111 x=274 y=90 width=32 height=48 xoffset=2 yoffset=36 xadvance=33 page=0 chnl=0\nchar id=112 x=432 y=142 width=32 height=66 xoffset=2 yoffset=35 xadvance=33 page=0 chnl=0\nchar id=113 x=228 y=142 width=32 height=68 xoffset=2 yoffset=33 xadvance=33 page=0 chnl=0\nchar id=114 x=472 y=90 width=24 height=50 xoffset=2 yoffset=34 xadvance=25 page=0 chnl=0\nchar id=115 x=376 y=90 width=30 height=48 xoffset=2 yoffset=37 xadvance=30 page=0 chnl=0\nchar id=116 x=418 y=212 width=24 height=68 xoffset=2 yoffset=16 xadvance=24 page=0 chnl=0\nchar id=117 x=470 y=212 width=30 height=52 xoffset=2 yoffset=34 xadvance=31 page=0 chnl=0\nchar id=118 x=170 y=90 width=34 height=48 xoffset=2 yoffset=36 xadvance=34 page=0 chnl=0\nchar id=119 x=426 y=2 width=50 height=50 xoffset=2 yoffset=35 xadvance=50 page=0 chnl=0\nchar id=120 x=206 y=90 width=32 height=50 xoffset=2 yoffset=35 xadvance=33 page=0 chnl=0\nchar id=121 x=466 y=142 width=30 height=68 xoffset=2 yoffset=34 xadvance=31 page=0 chnl=0\nchar id=122 x=478 y=2 width=30 height=50 xoffset=2 yoffset=35 xadvance=29 page=0 chnl=0\nchar id=123 x=226 y=372 width=24 height=86 xoffset=2 yoffset=8 xadvance=25 page=0 chnl=0\nchar id=124 x=312 y=350 width=12 height=86 xoffset=2 yoffset=7 xadvance=13 page=0 chnl=0\nchar id=125 x=226 y=284 width=24 height=86 xoffset=2 yoffset=8 xadvance=25 page=0 chnl=0\nchar id=126 x=59 y=89 width=30 height=14 xoffset=5 yoffset=18 xadvance=32 page=0 chnl=0\n"} +{"text": "[0]\nUnitful = \"1986cc42-f94f-5a68-af5c-568840ba703d\"\n"} +{"text": "//\n// Generated by Microsoft (R) D3D Shader Disassembler\n//\n//\n// Input signature:\n//\n// Name Index Mask Register SysValue Format Used\n// -------------------- ----- ------ -------- -------- ------- ------\n// SV_POSITION 0 xyzw 0 POS float \n// TEXCOORD 0 xy 1 NONE float xy \n//\n//\n// Output signature:\n//\n// Name Index Mask Register SysValue Format Used\n// -------------------- ----- ------ -------- -------- ------- ------\n// SV_Target 0 xyzw 0 TARGET float xyzw\n//\nps_5_0\ndcl_globalFlags refactoringAllowed\ndcl_constantbuffer cb0[1], immediateIndexed\ndcl_sampler s0, mode_default\ndcl_resource_texture2d (float,float,float,float) t0\ndcl_input_ps linear v1.xy\ndcl_output o0.xyzw\ndcl_temps 2\nsample_indexable(texture2d)(float,float,float,float) r0.xy, v1.xyxx, t0.xyzw, s0\nmov r1.x, l(0)\nmov r0.zw, r0.xxxy\nmov r1.z, cb0[0].z\nloop \n ilt r1.w, cb0[0].w, r1.z\n breakc_nz r1.w\n itof r1.w, r1.z\n mul r1.y, r1.w, cb0[0].y\n add r1.yw, r1.xxxy, v1.xxxy\n sample_indexable(texture2d)(float,float,float,float) r1.yw, r1.ywyy, t0.zxwy, s0\n max r0.zw, r0.zzzw, r1.yyyw\n iadd r1.z, r1.z, l(1)\nendloop \nmov o0.xy, r0.zwzz\nmov o0.zw, l(0,0,0,0)\nret \n// Approximately 0 instruction slots used\n"} +{"text": "/********************************************************************\\\n * This program is free software; you can redistribute it and/or *\n * modify it under the terms of the GNU General Public License as *\n * published by the Free Software Foundation; either version 2 of *\n * the License, or (at your option) any later version. *\n * *\n * This program is distributed in the hope that it will be useful, *\n * but WITHOUT ANY WARRANTY; without even the implied warranty of *\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n * GNU General Public License for more details. *\n * *\n * You should have received a copy of the GNU General Public License*\n * along with this program; if not, contact: *\n * *\n * Free Software Foundation Voice: +1-617-542-5942 *\n * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *\n * Boston, MA 02110-1301, USA gnu@gnu.org *\n * *\n\\********************************************************************/\n\n#if defined(SWIGGUILE)\n%{\n/* Disable -Waddress. GCC 4.2 warns (and fails to compile with -Werror) when\n * passing the address of a guid on the stack to QOF_BOOK_LOOKUP_ENTITY via\n * gncInvoiceLookup and friends. When the macro gets inlined, the compiler\n * emits a warning that the guid null pointer test is always true.\n */\n#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)\n# pragma GCC diagnostic warning \"-Waddress\"\n#endif\n%}\n#endif\n\n%rename(gncOwnerReturnGUID) gncOwnerRetGUID;\n\n%inline %{\nstatic GncGUID gncTaxTableReturnGUID(GncTaxTable *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncGUID gncInvoiceReturnGUID(GncInvoice *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncGUID gncJobReturnGUID(GncJob *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncGUID gncVendorReturnGUID(GncVendor *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncGUID gncCustomerReturnGUID(GncCustomer *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncGUID gncEmployeeReturnGUID(GncEmployee *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncGUID gncLotReturnGUID(GNCLot *x)\n{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }\n\nstatic GncTaxTable * gncTaxTableLookupFlip(GncGUID g, QofBook *b)\n{ return gncTaxTableLookup(b, &g); }\n\nstatic GncInvoice * gncInvoiceLookupFlip(GncGUID g, QofBook *b)\n{ return gncInvoiceLookup(b, &g); }\n\nstatic GncJob * gncJobLookupFlip(GncGUID g, QofBook *b)\n{ return gncJobLookup(b, &g); }\n\nstatic GncVendor * gncVendorLookupFlip(GncGUID g, QofBook *b)\n{ return gncVendorLookup(b, &g); }\n\nstatic GncCustomer * gncCustomerLookupFlip(GncGUID g, QofBook *b)\n{ return gncCustomerLookup(b, &g); }\n\nstatic GncEmployee * gncEmployeeLookupFlip(GncGUID g, QofBook *b)\n{ return gncEmployeeLookup(b, &g); }\n\n%}\n\nGLIST_HELPER_INOUT(GncInvoiceList, SWIGTYPE_p__gncInvoice);\nGLIST_HELPER_INOUT(EntryList, SWIGTYPE_p__gncEntry);\nGLIST_HELPER_INOUT(GncTaxTableGetTables, SWIGTYPE_p__gncTaxTable);\nGLIST_HELPER_INOUT(GncTaxTableEntryList, SWIGTYPE_p__gncTaxTableEntry);\nGLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);\n\n#if defined(SWIGGUILE)\n%typemap(in) GncAccountValue * \"$1 = gnc_scm_to_account_value_ptr($input);\"\n%typemap(out) GncAccountValue * \"$result = gnc_account_value_ptr_to_scm($1);\"\n%typemap(in) AccountValueList * {\n SCM list = $input;\n GList *c_list = NULL;\n\n while (!scm_is_null(list)) {\n GncAccountValue *p;\n\n SCM p_scm = SCM_CAR(list);\n if (scm_is_false(p_scm) || scm_is_null(p_scm))\n p = NULL;\n else\n p = gnc_scm_to_account_value_ptr(p_scm);\n\n c_list = g_list_prepend(c_list, p);\n list = SCM_CDR(list);\n }\n\n $1 = g_list_reverse(c_list);\n}\n%typemap(out) AccountValueList * {\n SCM list = SCM_EOL;\n GList *node;\n\n for (node = $1; node; node = node->next)\n list = scm_cons(gnc_account_value_ptr_to_scm(node->data), list);\n\n $result = scm_reverse(list);\n}\n#endif\n\n\n/* Parse the header files to generate wrappers */\n%include \n%include \n%include \n%include \n%include \n%include \n%include \n%include \n%include \n%include \n%include \n%include \n#if defined(SWIGGUILE)\n%include \n#endif\n/* Import query bindings for the below invoice query functions (but\n * don't generate bindings for them). */\n%import \n\n#define URL_TYPE_CUSTOMER GNC_ID_CUSTOMER\n#define URL_TYPE_VENDOR GNC_ID_VENDOR\n#define URL_TYPE_EMPLOYEE GNC_ID_EMPLOYEE\n#define URL_TYPE_JOB GNC_ID_JOB\n#define URL_TYPE_INVOICE GNC_ID_INVOICE\n// not exactly clean\n#define URL_TYPE_OWNERREPORT \"owner-report\"\n\n%inline %{\nstatic QofQuery * qof_query_create_for_invoices(void) {\n return qof_query_create_for(GNC_ID_INVOICE);\n}\n\nstatic GncInvoiceList * qof_query_run_for_invoices(QofQuery *q) {\n return qof_query_run(q);\n}\n%}\n\n#if defined(SWIGGUILE)\n%init {\n {\n char tmp[100];\n\n#define SET_ENUM(e) snprintf(tmp, 100, \"(set! %s (%s))\", (e), (e)); \\\n scm_c_eval_string(tmp);\n\n SET_ENUM(\"GNC-OWNER-CUSTOMER\");\n SET_ENUM(\"GNC-OWNER-VENDOR\");\n SET_ENUM(\"GNC-OWNER-EMPLOYEE\");\n SET_ENUM(\"GNC-OWNER-JOB\");\n SET_ENUM(\"GNC-AMT-TYPE-VALUE\");\n SET_ENUM(\"GNC-AMT-TYPE-PERCENT\");\n\n SET_ENUM(\"URL-TYPE-CUSTOMER\");\n SET_ENUM(\"URL-TYPE-VENDOR\");\n SET_ENUM(\"URL-TYPE-EMPLOYEE\");\n SET_ENUM(\"URL-TYPE-JOB\");\n SET_ENUM(\"URL-TYPE-INVOICE\");\n SET_ENUM(\"URL-TYPE-OWNERREPORT\");\n\n SET_ENUM(\"INVOICE-FROM-TXN\");\n SET_ENUM(\"INVOICE-FROM-LOT\");\n SET_ENUM(\"INVOICE-OWNER\");\n SET_ENUM(\"INVOICE-BILLTO\");\n SET_ENUM(\"OWNER-PARENTG\");\n SET_ENUM(\"OWNER-FROM-LOT\");\n\n SET_ENUM(\"GNC-INVOICE-UNDEFINED\");\n SET_ENUM(\"GNC-INVOICE-CUST-INVOICE\");\n SET_ENUM(\"GNC-INVOICE-VEND-INVOICE\");\n SET_ENUM(\"GNC-INVOICE-EMPL-INVOICE\");\n SET_ENUM(\"GNC-INVOICE-CUST-CREDIT-NOTE\");\n SET_ENUM(\"GNC-INVOICE-VEND-CREDIT-NOTE\");\n SET_ENUM(\"GNC-INVOICE-EMPL-CREDIT-NOTE\");\n\n#undef SET_ENUM\n }\n\n}\n#endif\n"} +{"text": "package flare.tests\r\n{\r\n\timport flare.util.Strings;\r\n\timport unitest.TestCase;\r\n\t\r\n\tpublic class StringFormatTests extends TestCase\r\n\t{\r\n\t\tpublic function StringFormatTests() {\r\n\t\t\taddTest(\"testNumberFormatting\");\r\n\t\t\taddTest(\"testDateTimeFormatting\");\r\n\t\t}\r\n\t\t\r\n\t\tprivate function run_tests(tests:Array):void {\r\n\t\t\tvar pass:int, fail:int, i:int, s:String, t:Object, b:Boolean;\r\n\t\t\tfor (pass=fail=i=0; i\r\n#endif\r\n\r\n/* WATCHOUT: for c++ you may have to #define __STDC_LIMIT_MACROS 1 real early\r\n * before #including this file, otherwise SIZE_MAX might not be defined\r\n */\r\n\r\n// JUCE: removed as JUCE already includes standard headers and including\r\n// these in FlacNamespace will cause problems\r\n\r\n//#include /* for SIZE_MAX */\r\n//#if HAVE_STDINT_H\r\n//#include /* for SIZE_MAX in case limits.h didn't get it */\r\n//#endif\r\n//#include /* for size_t, malloc(), etc */\r\n#include \"compat.h\"\r\n\r\n#ifndef SIZE_MAX\r\n# ifndef SIZE_T_MAX\r\n# ifdef _MSC_VER\r\n# ifdef _WIN64\r\n# define SIZE_T_MAX 0xffffffffffffffffui64\r\n# else\r\n# define SIZE_T_MAX 0xffffffff\r\n# endif\r\n# else\r\n# error\r\n# endif\r\n# endif\r\n# define SIZE_MAX SIZE_T_MAX\r\n#endif\r\n\r\n/* avoid malloc()ing 0 bytes, see:\r\n * https://www.securecoding.cert.org/confluence/display/seccode/MEM04-A.+Do+not+make+assumptions+about+the+result+of+allocating+0+bytes?focusedCommentId=5407003\r\n*/\r\nstatic inline void *safe_malloc_(size_t size)\r\n{\r\n\t/* malloc(0) is undefined; FLAC src convention is to always allocate */\r\n\tif(!size)\r\n\t\tsize++;\r\n\treturn malloc(size);\r\n}\r\n\r\nstatic inline void *safe_calloc_(size_t nmemb, size_t size)\r\n{\r\n\tif(!nmemb || !size)\r\n\t\treturn malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */\r\n\treturn calloc(nmemb, size);\r\n}\r\n\r\n/*@@@@ there's probably a better way to prevent overflows when allocating untrusted sums but this works for now */\r\n\r\nstatic inline void *safe_malloc_add_2op_(size_t size1, size_t size2)\r\n{\r\n\tsize2 += size1;\r\n\tif(size2 < size1)\r\n\t\treturn 0;\r\n\treturn safe_malloc_(size2);\r\n}\r\n\r\nstatic inline void *safe_malloc_add_3op_(size_t size1, size_t size2, size_t size3)\r\n{\r\n\tsize2 += size1;\r\n\tif(size2 < size1)\r\n\t\treturn 0;\r\n\tsize3 += size2;\r\n\tif(size3 < size2)\r\n\t\treturn 0;\r\n\treturn safe_malloc_(size3);\r\n}\r\n\r\nstatic inline void *safe_malloc_add_4op_(size_t size1, size_t size2, size_t size3, size_t size4)\r\n{\r\n\tsize2 += size1;\r\n\tif(size2 < size1)\r\n\t\treturn 0;\r\n\tsize3 += size2;\r\n\tif(size3 < size2)\r\n\t\treturn 0;\r\n\tsize4 += size3;\r\n\tif(size4 < size3)\r\n\t\treturn 0;\r\n\treturn safe_malloc_(size4);\r\n}\r\n\r\nvoid *safe_malloc_mul_2op_(size_t size1, size_t size2) ;\r\n\r\nstatic inline void *safe_malloc_mul_3op_(size_t size1, size_t size2, size_t size3)\r\n{\r\n\tif(!size1 || !size2 || !size3)\r\n\t\treturn malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */\r\n\tif(size1 > SIZE_MAX / size2)\r\n\t\treturn 0;\r\n\tsize1 *= size2;\r\n\tif(size1 > SIZE_MAX / size3)\r\n\t\treturn 0;\r\n\treturn malloc(size1*size3);\r\n}\r\n\r\n/* size1*size2 + size3 */\r\nstatic inline void *safe_malloc_mul2add_(size_t size1, size_t size2, size_t size3)\r\n{\r\n\tif(!size1 || !size2)\r\n\t\treturn safe_malloc_(size3);\r\n\tif(size1 > SIZE_MAX / size2)\r\n\t\treturn 0;\r\n\treturn safe_malloc_add_2op_(size1*size2, size3);\r\n}\r\n\r\n/* size1 * (size2 + size3) */\r\nstatic inline void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size3)\r\n{\r\n\tif(!size1 || (!size2 && !size3))\r\n\t\treturn malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */\r\n\tsize2 += size3;\r\n\tif(size2 < size3)\r\n\t\treturn 0;\r\n\tif(size1 > SIZE_MAX / size2)\r\n\t\treturn 0;\r\n\treturn malloc(size1*size2);\r\n}\r\n\r\nstatic inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)\r\n{\r\n\tsize2 += size1;\r\n\tif(size2 < size1)\r\n\t\treturn 0;\r\n\treturn realloc(ptr, size2);\r\n}\r\n\r\nstatic inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)\r\n{\r\n\tsize2 += size1;\r\n\tif(size2 < size1)\r\n\t\treturn 0;\r\n\tsize3 += size2;\r\n\tif(size3 < size2)\r\n\t\treturn 0;\r\n\treturn realloc(ptr, size3);\r\n}\r\n\r\nstatic inline void *safe_realloc_add_4op_(void *ptr, size_t size1, size_t size2, size_t size3, size_t size4)\r\n{\r\n\tsize2 += size1;\r\n\tif(size2 < size1)\r\n\t\treturn 0;\r\n\tsize3 += size2;\r\n\tif(size3 < size2)\r\n\t\treturn 0;\r\n\tsize4 += size3;\r\n\tif(size4 < size3)\r\n\t\treturn 0;\r\n\treturn realloc(ptr, size4);\r\n}\r\n\r\nstatic inline void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t size2)\r\n{\r\n\tif(!size1 || !size2)\r\n\t\treturn realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */\r\n\tif(size1 > SIZE_MAX / size2)\r\n\t\treturn 0;\r\n\treturn realloc(ptr, size1*size2);\r\n}\r\n\r\n/* size1 * (size2 + size3) */\r\nstatic inline void *safe_realloc_muladd2_(void *ptr, size_t size1, size_t size2, size_t size3)\r\n{\r\n\tif(!size1 || (!size2 && !size3))\r\n\t\treturn realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */\r\n\tsize2 += size3;\r\n\tif(size2 < size3)\r\n\t\treturn 0;\r\n\treturn safe_realloc_mul_2op_(ptr, size1, size2);\r\n}\r\n\r\n#endif\r\n"} +{"text": "# Deploying Rails From Scratch\n\nIn this tutorial we will use tomo to deploy a [sample Rails project](https://github.com/mattbrictson/rails-new) to a virtual private server (VPS). These instructions use [DigitalOcean](https://www.digitalocean.com) as the hosting provider, but any provider that offers an Ubuntu 18.04 or 20.04 LTS VPS should work in a similar way. Here are the steps involved (step 1 is the only part that is DigitalOcean-specific):\n\n1. [Create an Ubuntu VPS](#create-an-ubuntu-vps)\n2. [Install necessary apt packages](#install-necessary-apt-packages)\n3. [Set up a deployer user](#set-up-a-deployer-user)\n4. [Configure tomo](#configure-tomo)\n5. [Run tomo setup](#run-tomo-setup)\n6. [Run tomo deploy](#run-tomo-deploy)\n\nThis is a basic tutorial that skips over DNS, TLS, load balancing, PostgreSQL, etc. If you have suggestions for expanding this guide, consider [opening an issue or pull request on GitHub](https://github.com/mattbrictson/tomo). Thanks for reading!\n\n## Create an Ubuntu VPS\n\nLog into [DigitalOcean](https://www.digitalocean.com) and create a \"Droplet\" (aka a VPS). If this is your first time using DigitalOcean, check out their [Droplet QuickStart](https://www.digitalocean.com/docs/droplets/quickstart/) guide for an introduction to the service.\n\nWhen creating the Droplet, make sure to choose **Ubuntu 18.04 or 20.04 (LTS) x64**:\n\n![Ubuntu 20.04 LTS](./ubuntu-20-lts@2x.png)\n\nAnd use **SSH keys** for authentication (tomo does not work with password authentication):\n\n![SSH Authentication](./ssh-auth@2x.png)\n\nOnce the Droplet is created, confirm that you are able to connect to it (substitute `IPADDR` with the IP address provided in the DigitalOcean control panel for the new Droplet):\n\n```sh\n# Run on your local machine\n$ ssh -o PasswordAuthentication=no root@IPADDR echo \"authenticated as root!\"\nauthenticated as root!\n```\n\nYou may need to type `yes` when prompted to trust the host fingerprint.\n\n## Install necessary apt packages\n\nRails requires certain operating system packages in order to build Ruby and install various gems that have native extensions. Connect to the VPS as root and install the following:\n\n```sh\n# Run these commands as root on the VPS\napt-get -y update\napt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev \\\n git-core curl locales libsqlite3-dev tzdata\nlocale-gen en_US.UTF-8\n```\n\nIt may take a minute or two for all the packages to install.\n\n## Set up a deployer user\n\nRunning a Rails app as `root` is a security risk; we need to create a non-privileged user for this purpose. Run the following script to create a\n`deployer` user that:\n\n- has access to write to a `/var/www` directory, which is the default location where tomo will deploy our app; and\n- can \"linger\", i.e. run long-running processes like the puma web server\n\n```sh\n# Run these commands as root on the VPS\nadduser --disabled-password deployer < /dev/null\nmkdir -p /home/deployer/.ssh\ncp /root/.ssh/authorized_keys /home/deployer/.ssh\nchown -R deployer:deployer /home/deployer/.ssh\nchmod 600 /home/deployer/.ssh/authorized_keys\nmkdir -p /var/www\nchown deployer:deployer /var/www\nloginctl enable-linger deployer\n```\n\nFor convenience, the `deployer` user will accept the same SSH key that you are already using to authenticate when connecting as `root`. Test that it works:\n\n```sh\n# Run on your local machine\n$ ssh -o PasswordAuthentication=no deployer@IPADDR echo \"authenticated as deployer!\"\nauthenticated as deployer!\n```\n\n## Configure tomo\n\nWe will be deploying [this basic Rails app](https://github.com/mattbrictson/rails-new). Clone the repository to get started:\n\n```sh\n# Run on your local machine\n$ git clone https://github.com/mattbrictson/rails-new\n```\n\nRails requires Node and Yarn, so make sure they are working:\n\n```sh\n# Run on your local machine\n$ rails-new/bin/yarn -v\n1.16.0\n```\n\nIf you get an error, install Node and Yarn before continuing.\n\nNow it is time to configure tomo to deploy this Rails app. Inside the `rails-new` directory, install tomo and run `tomo init`. This will set up a deploy configuration with a good set of defaults:\n\n```sh\n# Run on your local machine\n$ cd rails-new\n\n$ gem install tomo\nFetching tomo-1.0.0.gem\nSuccessfully installed tomo-1.0.0\n1 gem installed\n\n$ tomo init\n✔ Created .tomo/config.rb\n```\n\nThe `.tomo/config.rb` configuration is ready right out of the box. All you will need to change is the `host` line, and be sure to replace `IPADDR` with the IP address of your VPS:\n\n```ruby\n# Modify the 'host' line of .tomo/config.rb\nhost \"deployer@IPADDR\"\n```\n\n## Run tomo setup\n\nTomo comes with a `setup` command that will prepare your VPS for its first deployment. This does things like install Node, Yarn, and Ruby. It also sets up some important environment variables. Just run:\n\n```sh\n# Run on your local machine\n$ tomo setup\n```\n\nYou will be asked for two environment variables. Tomo will store these values on the VPS so that you only have to provide them once:\n\n- **DATABASE_URL** is needed to tell Rails how to connect to the database. The basic app we are deploying uses sqlite. Provide this value when prompted: `sqlite3:/var/www/rails-new/shared/production.sqlite3`. This will store the database in a shared location so that it doesn't change from release to release.\n- **SECRET_KEY_BASE** is needed by all Rails apps to securely encrypt session cookies and other important data. Run `ruby -rsecurerandom -e \"puts SecureRandom.hex(64)\"` to generate an appropriate value.\n\nNote that `tomo setup` compiles Ruby from source, which will take several minutes.\n\n## Run tomo deploy\n\nOnce `setup` completes, your VPS is ready to go. Deploying is now just a matter of running `tomo deploy`:\n\n```sh\n# Run on your local machine\n$ tomo deploy\n```\n\nWhen the deploy completes, the Rails app will be accessible on port 3000 of your VPS: `http://IPADDR:3000`.\n\nCongratulations!\n"} +{"text": "{\n'jStorage:tests/tests.js':[\n99,\n101,\n],\n}\n"} +{"text": "\n\n
\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n"} +{"text": "o1 = new person\n\no1.name = \"Mahmoud\"\nsee o1.name + nl\n\nsee \"Test : \" + nl\n\no1 {\n\tname = \"Ahmed\"\n\tsee name\n}\n\n\nClass Person\n\n\tname\n\n\tfunc setname value\n\t\tsee \"Message from SetName() Function!\" + nl\n\t\tname = value + \" Fayed\"\n\n\tfunc getname\n\t\tsee \"Message from GetName() Function!\" + nl\n\t\treturn \"Mr. \" + name\n\n"} +{"text": "${PODS_ROOT}/Target Support Files/Pods-MetalFilters/Pods-MetalFilters-frameworks.sh\n${BUILT_PRODUCTS_DIR}/MetalPetal/MetalPetal.framework"} +{"text": "/*\n** 2001 September 22\n**\n** The author disclaims copyright to this source code. In place of\n** a legal notice, here is a blessing:\n**\n** May you do good and not evil.\n** May you find forgiveness for yourself and forgive others.\n** May you share freely, never taking more than you give.\n**\n*************************************************************************\n** This is the implementation of generic hash-tables\n** used in SQLite.\n*/\n#include \"sqliteInt.h\"\n#include \n\n/* Turn bulk memory into a hash table object by initializing the\n** fields of the Hash structure.\n**\n** \"pNew\" is a pointer to the hash table that is to be initialized.\n*/\nvoid sqlite3HashInit(Hash *pNew){\n assert( pNew!=0 );\n pNew->first = 0;\n pNew->count = 0;\n pNew->htsize = 0;\n pNew->ht = 0;\n}\n\n/* Remove all entries from a hash table. Reclaim all memory.\n** Call this routine to delete a hash table or to reset a hash table\n** to the empty state.\n*/\nvoid sqlite3HashClear(Hash *pH){\n HashElem *elem; /* For looping over all elements of the table */\n\n assert( pH!=0 );\n elem = pH->first;\n pH->first = 0;\n sqlite3_free(pH->ht);\n pH->ht = 0;\n pH->htsize = 0;\n while( elem ){\n HashElem *next_elem = elem->next;\n sqlite3_free(elem);\n elem = next_elem;\n }\n pH->count = 0;\n}\n\n/*\n** The hashing function.\n*/\nstatic unsigned int strHash(const char *z, int nKey){\n int h = 0;\n assert( nKey>=0 );\n while( nKey > 0 ){\n h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++];\n nKey--;\n }\n return h;\n}\n\n\n/* Link pNew element into the hash table pH. If pEntry!=0 then also\n** insert pNew into the pEntry hash bucket.\n*/\nstatic void insertElement(\n Hash *pH, /* The complete hash table */\n struct _ht *pEntry, /* The entry into which pNew is inserted */\n HashElem *pNew /* The element to be inserted */\n){\n HashElem *pHead; /* First element already in pEntry */\n if( pEntry ){\n pHead = pEntry->count ? pEntry->chain : 0;\n pEntry->count++;\n pEntry->chain = pNew;\n }else{\n pHead = 0;\n }\n if( pHead ){\n pNew->next = pHead;\n pNew->prev = pHead->prev;\n if( pHead->prev ){ pHead->prev->next = pNew; }\n else { pH->first = pNew; }\n pHead->prev = pNew;\n }else{\n pNew->next = pH->first;\n if( pH->first ){ pH->first->prev = pNew; }\n pNew->prev = 0;\n pH->first = pNew;\n }\n}\n\n\n/* Resize the hash table so that it cantains \"new_size\" buckets.\n**\n** The hash table might fail to resize if sqlite3_malloc() fails or\n** if the new size is the same as the prior size.\n** Return TRUE if the resize occurs and false if not.\n*/\nstatic int rehash(Hash *pH, unsigned int new_size){\n struct _ht *new_ht; /* The new hash table */\n HashElem *elem, *next_elem; /* For looping over existing elements */\n\n#if SQLITE_MALLOC_SOFT_LIMIT>0\n if( new_size*sizeof(struct _ht)>SQLITE_MALLOC_SOFT_LIMIT ){\n new_size = SQLITE_MALLOC_SOFT_LIMIT/sizeof(struct _ht);\n }\n if( new_size==pH->htsize ) return 0;\n#endif\n\n /* The inability to allocates space for a larger hash table is\n ** a performance hit but it is not a fatal error. So mark the\n ** allocation as a benign. Use sqlite3Malloc()/memset(0) instead of \n ** sqlite3MallocZero() to make the allocation, as sqlite3MallocZero()\n ** only zeroes the requested number of bytes whereas this module will\n ** use the actual amount of space allocated for the hash table (which\n ** may be larger than the requested amount).\n */\n sqlite3BeginBenignMalloc();\n new_ht = (struct _ht *)sqlite3Malloc( new_size*sizeof(struct _ht) );\n sqlite3EndBenignMalloc();\n\n if( new_ht==0 ) return 0;\n sqlite3_free(pH->ht);\n pH->ht = new_ht;\n pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht);\n memset(new_ht, 0, new_size*sizeof(struct _ht));\n for(elem=pH->first, pH->first=0; elem; elem = next_elem){\n unsigned int h = strHash(elem->pKey, elem->nKey) % new_size;\n next_elem = elem->next;\n insertElement(pH, &new_ht[h], elem);\n }\n return 1;\n}\n\n/* This function (for internal use only) locates an element in an\n** hash table that matches the given key. The hash for this key has\n** already been computed and is passed as the 4th parameter.\n*/\nstatic HashElem *findElementGivenHash(\n const Hash *pH, /* The pH to be searched */\n const char *pKey, /* The key we are searching for */\n int nKey, /* Bytes in key (not counting zero terminator) */\n unsigned int h /* The hash for this key. */\n){\n HashElem *elem; /* Used to loop thru the element list */\n int count; /* Number of elements left to test */\n\n if( pH->ht ){\n struct _ht *pEntry = &pH->ht[h];\n elem = pEntry->chain;\n count = pEntry->count;\n }else{\n elem = pH->first;\n count = pH->count;\n }\n while( count-- && ALWAYS(elem) ){\n if( elem->nKey==nKey && sqlite3StrNICmp(elem->pKey,pKey,nKey)==0 ){ \n return elem;\n }\n elem = elem->next;\n }\n return 0;\n}\n\n/* Remove a single entry from the hash table given a pointer to that\n** element and a hash on the element's key.\n*/\nstatic void removeElementGivenHash(\n Hash *pH, /* The pH containing \"elem\" */\n HashElem* elem, /* The element to be removed from the pH */\n unsigned int h /* Hash value for the element */\n){\n struct _ht *pEntry;\n if( elem->prev ){\n elem->prev->next = elem->next; \n }else{\n pH->first = elem->next;\n }\n if( elem->next ){\n elem->next->prev = elem->prev;\n }\n if( pH->ht ){\n pEntry = &pH->ht[h];\n if( pEntry->chain==elem ){\n pEntry->chain = elem->next;\n }\n pEntry->count--;\n assert( pEntry->count>=0 );\n }\n sqlite3_free( elem );\n pH->count--;\n if( pH->count==0 ){\n assert( pH->first==0 );\n assert( pH->count==0 );\n sqlite3HashClear(pH);\n }\n}\n\n/* Attempt to locate an element of the hash table pH with a key\n** that matches pKey,nKey. Return the data for this element if it is\n** found, or NULL if there is no match.\n*/\nvoid *sqlite3HashFind(const Hash *pH, const char *pKey, int nKey){\n HashElem *elem; /* The element that matches key */\n unsigned int h; /* A hash on key */\n\n assert( pH!=0 );\n assert( pKey!=0 );\n assert( nKey>=0 );\n if( pH->ht ){\n h = strHash(pKey, nKey) % pH->htsize;\n }else{\n h = 0;\n }\n elem = findElementGivenHash(pH, pKey, nKey, h);\n return elem ? elem->data : 0;\n}\n\n/* Insert an element into the hash table pH. The key is pKey,nKey\n** and the data is \"data\".\n**\n** If no element exists with a matching key, then a new\n** element is created and NULL is returned.\n**\n** If another element already exists with the same key, then the\n** new data replaces the old data and the old data is returned.\n** The key is not copied in this instance. If a malloc fails, then\n** the new data is returned and the hash table is unchanged.\n**\n** If the \"data\" parameter to this function is NULL, then the\n** element corresponding to \"key\" is removed from the hash table.\n*/\nvoid *sqlite3HashInsert(Hash *pH, const char *pKey, int nKey, void *data){\n unsigned int h; /* the hash of the key modulo hash table size */\n HashElem *elem; /* Used to loop thru the element list */\n HashElem *new_elem; /* New element added to the pH */\n\n assert( pH!=0 );\n assert( pKey!=0 );\n assert( nKey>=0 );\n if( pH->htsize ){\n h = strHash(pKey, nKey) % pH->htsize;\n }else{\n h = 0;\n }\n elem = findElementGivenHash(pH,pKey,nKey,h);\n if( elem ){\n void *old_data = elem->data;\n if( data==0 ){\n removeElementGivenHash(pH,elem,h);\n }else{\n elem->data = data;\n elem->pKey = pKey;\n assert(nKey==elem->nKey);\n }\n return old_data;\n }\n if( data==0 ) return 0;\n new_elem = (HashElem*)sqlite3Malloc( sizeof(HashElem) );\n if( new_elem==0 ) return data;\n new_elem->pKey = pKey;\n new_elem->nKey = nKey;\n new_elem->data = data;\n pH->count++;\n if( pH->count>=10 && pH->count > 2*pH->htsize ){\n if( rehash(pH, pH->count*2) ){\n assert( pH->htsize>0 );\n h = strHash(pKey, nKey) % pH->htsize;\n }\n }\n if( pH->ht ){\n insertElement(pH, &pH->ht[h], new_elem);\n }else{\n insertElement(pH, 0, new_elem);\n }\n return 0;\n}\n"} +{"text": "# NoSQLAttack\r\n\r\n# 介绍\r\nNoSQLAttack 是一个用python编写的开源的攻击工具,用来暴露网络中默认配置mongoDB的IP并且下载目标mongoDB的数据,同时还可以针对以mongoDB为后台存储的应用进行注入攻击,使用这个工具就可以发现有成千上万的mongoDB裸奔在互联网上,并且数据可以随意下载。\r\n\r\n攻击的数据是来自于以下论文给予的启发\r\n* [Diglossia: Detecting Code Injection Attacks with Precision and Efficiency](http://www.cs.cornell.edu/~shmat/shmat_ccs13.pdf)\r\n* [No SQL, No Injection?](https://www.research.ibm.com/haifa/Workshops/security2015/present/Aviv_NoSQL-NoInjection.pdf)\r\n* [Several thousand MongoDBs without access control on the Internet](https://cispa.saarland/wp-content/uploads/2015/02/MongoDB_documentation.pdf).\r\n\r\n\r\nNoSQL注入攻击测试系统[NoSQLInjectionAttackDemo](https://github.com/youngyangyang04/NoSQLInjectionAttackDemo),这里面有两个系统用来测试注入攻击。\r\n# 背景介绍\r\n在NoSQL注入攻击中有PHP数组注入,js注入和mongo shell拼接注入等多种方法可以攻击mongoDB,并且现在有成千上万的mongoDB暴露在互联网上,只要知道目标mongoDB的ip和端口号就可以把裸露的mongoDB中的数据都下载下来。\r\n# 运行环境\r\n项目运行在linux系统上,NoSQLAttack的依赖包已经写在setup.py文件里,并且已经在ubantu和MAC OX上都测试了,只需要执行这个脚本就可以自动配置好安装环境\r\n开发这个项目使用时使用的是Pycharm COMMUNITY 2016.1,python的版本为2.7.10,使用者需要在本地电脑安装[mongoDB](http://jingyan.baidu.com/article/fd8044faf4f3a95030137a79.html)。\r\n\r\n# 安装\r\n在linux系统下可以直接将下载的项目解压,然后执行以下两个命令\r\n```bash\r\ncd NoSQLAttack\r\npython setup.py install\r\n```\r\n# 使用方法\r\n安装完毕后,执行一下命令就可以启动该项目\r\n```bash\r\nNoSQLAttack\r\n```\r\n启动该项目后将会展现如下的界面,然后就可以开启黑客之旅了\r\n```bash\r\n================================================\r\n _ _ _____ _____ _ \r\n | \\ | | / ___|| _ | | \r\n | \\| | ___ \\ `--. | | | | | \r\n | . ` |/ _ \\ `--. \\| | | | | \r\n | |\\ | (_) /\\__/ /\\ \\/' / |____ \r\n \\_| \\_/\\___/\\____/ \\_/\\_\\_____/ \r\n _ \r\n /\\ _ _ | | _ \r\n / \\ _| |_ _| | _____ ___ | | / / \r\n / /\\ \\ |_ _||_ _| / __ \\ / __| | |/ / \r\n / /--\\ \\ | |_ | |_ | |_| | | |__ | |\\ \\ \r\n/ / -- \\ \\ \\___\\ \\___\\ \\______\\ \\___| | | \\_\\ \r\n================================================ \r\nNoSQLAttack-v0.2\r\nsunxiuyang04@gmail.com\r\n\r\n\r\n1-Scan attacked IP\r\n2-Configurate parameters\r\n3-MongoDB Access Attacks\r\n4-Injection Attacks\r\nx-Exit\r\n```\r\n# 选项1扫描可攻击IP演示 \r\n```bash\r\n===============================================\r\n _ _ _____ _____ _ \r\n | \\ | | / ___|| _ | | \r\n | \\| | ___ \\ `--. | | | | | \r\n | . ` |/ _ \\ `--. \\| | | | | \r\n | |\\ | (_) /\\__/ /\\ \\/' / |____ \r\n \\_| \\_/\\___/\\____/ \\_/\\_\\_____/ \r\n _ \r\n /\\ _ _ | | _ \r\n / \\ _| |_ _| |_ _____ ___ | | / / \r\n / /\\ \\ |_ _||_ _| / __ \\ / __| | |/ / \r\n / /--\\ \\ | | | |_ | |_| | ||__ | |\\ \\ \r\n/ / -- \\ \\ \\___\\ \\___\\ \\______\\ \\___| | | \\_\\ \r\n=============================================== \r\nNoSQLAttack-v0.2\r\nsunxiuyang04@gmail.com\r\n\r\n\r\n1-Scan attacked IP\r\n2-Configurate parameters\r\n3-MongoDB Access Attacks\r\n4-Injection Attacks\r\nx-Exit\r\nSelect an option:1\r\nStart Scanning.....\r\nResults found:28793\r\n1_Attacked IP : 149.202.88.135\r\n2_Attacked IP : 49.212.186.80\r\n3_Attacked IP : 85.9.62.231\r\n4_Attacked IP : 121.78.239.11\r\n5_Attacked IP : 54.226.207.112\r\n6_Attacked IP : 119.254.66.44\r\n7_Attacked IP : 121.46.0.83\r\n8_Attacked IP : 162.243.21.180\r\n9_Attacked IP : 210.23.29.75\r\nSelect IP to attack:2\r\nStart Default Configuration Attack(y/n)?y\r\nDB access attacks(mongoDB)\r\n=========================\r\nChecking to see if crendentials are need\r\n49.212.186.80\r\n\r\n27017\r\nSuccessful access with no credentials!\r\n\r\n\r\n1-Get Server Version and Platform\r\n2-Enumerate Databases/Collections/Users\r\n3-Clone a Database\r\n4-Return to Main Menu\r\nSelect an attack: 2\r\nList of databases:\r\nMultiCopyService_UserData\r\nSmartNFC_UserData\r\nSmartShop_UserData\r\nKioskPointMng2_UserData\r\nadmin\r\ndb\r\nlocal\r\n\r\n1-Get Server Version and Platform\r\n2-Enumerate Databases/Collections/Users\r\n3-Clone a Database\r\n4-Return to Main Menu\r\nSelect an attack: 3\r\n\r\n\r\n(1)MultiCopyService_UserData\r\n(2)SmartNFC_UserData\r\n(3)SmartShop_UserData\r\n(4)KioskPointMng2_UserData\r\n(5)admin\r\n(6)db\r\n(7)dbItem\r\n(8)local\r\nSelect a database to steal:6\r\nDoes this Database require credentials.(y/n)?n\r\nDatabase cloned. Copy another (y/n)?\r\n\r\n```\r\n# 选项2系统配置信息演示 \r\n这里以这个攻击地址为例(219.223.240.36/NoSQLInjectionAttackDemo/demo_2.html),这里的IP:219.223.240.36 下部署了web服务器在我本地的电脑,所以外网是访问不了的,这个用于测试的web站点的源码在这个项目里[NoSQLInjectionAttackDemo](https://github.com/youngyangyang04/NoSQLInjectionAttackDemo). 使用者可以自己搭建一个web服务器然后将这个项目[NoSQLInjectionAttackDemo](https://github.com/youngyangyang04/NoSQLInjectionAttackDemo)的代码放上去就可以运行了,然后将这个IP219.223.240.36换成搭建好的web服务器的IP。\r\n```bash\r\n===============================================\r\n _ _ _____ _____ _ \r\n | \\ | | / ___|| _ | | \r\n | \\| | ___ \\ `--. | | | | | \r\n | . ` |/ _ \\ `--. \\| | | | | \r\n | |\\ | (_) /\\__/ /\\ \\/' / |____ \r\n \\_| \\_/\\___/\\____/ \\_/\\_\\_____/ \r\n _ \r\n /\\ _ _ | | _ \r\n / \\ _| |_ _| |_ _____ ___ | | / / \r\n / /\\ \\ |_ _||_ _| / __ \\ / __| | |/ / \r\n / /--\\ \\ | | | |_ | |_| | ||__ | |\\ \\ \r\n/ / -- \\ \\ \\___\\ \\___\\ \\______\\ \\___| | | \\_\\ \r\n=============================================== \r\nNoSQLAttack-v0.2\r\nsunxiuyang04@gmail.com\r\n\r\n\r\n1-Scan attacked IP\r\n2-Configurate parameters\r\n3-MongoDB Access Attacks\r\n4-Injection Attacks\r\nx-Exit\r\nSelect an option:2\r\n\r\nOptions\r\n1-Set target host/IP (Current: Not Set)\r\n2-Set web app port (Current: 80)\r\n3-Set App Path (Current: Not Set)\r\n4-Toggle HTTPS (Current: OFF)\r\n5-Set Not Set Port (Current : 27017)\r\n6-Set HTTP Request Method (GET/POST) (Current: GET)\r\n7-Set my local Not Set/Shell IP (Current: Not Set)\r\n8-Set shell listener port (Current: Not Set)\r\n9-Toggle Verbose Mode: (Current: OFF)\r\nx-Back to main menu\r\nSet an option:1\r\nEnter host or IP/DNS name:219.223.240.36\r\n\r\nTarget set to:219.223.240.36\r\n\r\n\r\n\r\n\r\nOptions\r\n1-Set target host/IP (Current: 219.223.240.36)\r\n2-Set web app port (Current: 80)\r\n3-Set App Path (Current: Not Set)\r\n4-Toggle HTTPS (Current: OFF)\r\n5-Set Not Set Port (Current : 27017)\r\n6-Set HTTP Request Method (GET/POST) (Current: GET)\r\n7-Set my local Not Set/Shell IP (Current: Not Set)\r\n8-Set shell listener port (Current: Not Set)\r\n9-Toggle Verbose Mode: (Current: OFF)\r\nx-Back to main menu\r\nSet an option:3\r\nEnter URL path(Press enter for no URL):/NoSQLInjectionAttackDemo/login/demo_2.php?password=2\r\n\r\nHTTP port set to 80\r\n\r\n\r\n\r\n\r\nOptions\r\n1-Set target host/IP (Current: 219.223.240.36)\r\n2-Set web app port (Current: 80)\r\n3-Set App Path (Current: /NoSQLInjectionAttackDemo/login/demo_2.php?password=2)\r\n4-Toggle HTTPS (Current: OFF)\r\n5-Set Not Set Port (Current : 27017)\r\n6-Set HTTP Request Method (GET/POST) (Current: GET)\r\n7-Set my local Not Set/Shell IP (Current: Not Set)\r\n8-Set shell listener port (Current: Not Set)\r\n9-Toggle Verbose Mode: (Current: OFF)\r\nx-Back to main menu\r\nSet an option:7\r\nEnter host IP for my Not Set/Shells:127.0.0.1\r\n\r\nShell/DB listener set to 127.0.0.1\r\n\r\n\r\n\r\n\r\nOptions\r\n1-Set target host/IP (Current: 219.223.240.36)\r\n2-Set web app port (Current: 80)\r\n3-Set App Path (Current: /NoSQLInjectionAttackDemo/login/demo_2.php?password=2)\r\n4-Toggle HTTPS (Current: OFF)\r\n5-Set Not Set Port (Current : 27017)\r\n6-Set HTTP Request Method (GET/POST) (Current: GET)\r\n7-Set my local Not Set/Shell IP (Current: 127.0.0.1)\r\n8-Set shell listener port (Current: Not Set)\r\n9-Toggle Verbose Mode: (Current: OFF)\r\nx-Back to main menu\r\nSet an option:x\r\n===============================================\r\n _ _ _____ _____ _ \r\n | \\ | | / ___|| _ | | \r\n | \\| | ___ \\ `--. | | | | | \r\n | . ` |/ _ \\ `--. \\| | | | | \r\n | |\\ | (_) /\\__/ /\\ \\/' / |____ \r\n \\_| \\_/\\___/\\____/ \\_/\\_\\_____/ \r\n _ \r\n /\\ _ _ | | _ \r\n / \\ _| |_ _| |_ _____ ___ | | / / \r\n / /\\ \\ |_ _||_ _| / __ \\ / __| | |/ / \r\n / /--\\ \\ | | | |_ | |_| | ||__ | |\\ \\ \r\n/ / -- \\ \\ \\___\\ \\___\\ \\______\\ \\___| | | \\_\\ \r\n=============================================== \r\nNoSQLAttack-v0.2\r\nsunxiuyang04@gmail.com\r\n\r\n\r\n1-Scan attacked IP\r\n2-Configurate parameters\r\n3-MongoDB Access Attacks\r\n4-Injection Attacks\r\nx-Exit\r\nSelect an option:4\r\nWeb App Attacks (GET)\r\n=====================\r\nchecking to see if site at219.223.240.36:80/NoSQLInjectionAttackDemo/login/demo_2.php?password=2 is up...\r\n\r\n\r\n```\r\n"} +{"text": "/*\n * Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage flash.accessibility {\nimport flash.display.DisplayObject;\n\n[native(cls='AccessibilityClass')]\npublic final class Accessibility {\n public static native function get active():Boolean;\n public static native function sendEvent(source:DisplayObject, childID:uint, eventType:uint,\n nonHTML:Boolean = false):void;\n public static native function updateProperties():void;\n}\n}\n"} +{"text": "/*!\n * vue-datepicker v0.1.2\n * https://github.com/weifeiyue/vue-datepicker\n * (c) 2016 weifeiyue\n * Released under the MIT License.\n */\n(function(factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n define(['vue'], factory);\n } else if (typeof exports === 'object') {\n factory(require('vue'));\n } else {\n factory(Vue);\n }\n}(function(Vue) {\n Vue.component('mz-datepicker', {\n template: '
' +\n '' +\n '
' +\n '
' +\n '' +\n '
' +\n '
' +\n '' +\n '
' +\n '' +\n '
' +\n '
',\n props: {\n //是否显示范围\n range: {\n type: Boolean,\n default: false\n },\n //显示宽度\n width: {\n default: 214\n },\n //输入的时间\n time: {\n twoWay: true\n },\n //输入的开始时间\n startTime: {\n twoWay: true\n },\n //输入的结束时间\n endTime: {\n twoWay: true\n },\n //选择最大范围限制,以天为单位(只有range为true的时候才起作用)\n maxRange: {\n coerce: function(val) {\n return +val;\n }\n },\n //是否可以清除\n clearable: {\n type: Boolean,\n default: false\n },\n //显示格式\n format: {\n type: String,\n default: 'yyyy-MM-dd'\n },\n //禁用\n disabled: {\n type: Boolean,\n default: false\n },\n //是否需要点击确认\n confirm: {\n type: Boolean,\n default: false\n },\n //英文显示\n en: {\n type: Boolean,\n default: false\n },\n //点击确认触发事件\n onConfirm: Function\n },\n data: function() {\n return {\n show: false,\n showYear1: false,\n showYear2: false,\n showMonth1: false,\n showMonth2: false,\n prevYearTitle: this.en ? 'last year' : '上一年',\n prevMonthTitle: this.en ? 'last month' : '上个月',\n selectYearTitle: this.en ? 'select year' : '选择年份',\n selectMonthTitle: this.en ? 'select month' : '选择月份',\n nextMonthTitle: this.en ? 'next month' : '下个月',\n nextYearTitle: this.en ? 'next year' : '下一年',\n toTitle: this.en ? 'TO' : '至',\n okTitle: this.en ? 'OK' : '确定',\n left: false,\n ranges: [], //选择范围\n days: this.en ? ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'] : ['一', '二', '三', '四', '五', '六', '日'],\n months: this.en ? ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] : ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n years1: [],\n years2: [],\n months1: [],\n months2: [],\n date1: null,\n date2: null,\n time1: this.parse(this.startTime, false) || this.parse(this.time, false),\n time2: this.parse(this.endTime, true),\n now1: this.parse(new Date(), false),\n now2: this.parse(new Date(), true),\n count: this.range ? 2 : 1 //日历数量\n };\n },\n computed: {\n value: function() {\n if (this.range) {\n if (this.startTime && this.endTime) {\n return this.stringify(this.parse(this.startTime, false)) + ' ~ ' + this.stringify(this.parse(this.endTime, false));\n } else {\n return '';\n }\n } else {\n return this.stringify(this.parse(this.time, false));\n }\n }\n },\n watch: {\n show: function(val) {\n this.hidePanel();\n val && this.$els.popup.focus();\n },\n now1: function() {\n this.updateAll();\n },\n now2: function() {\n this.updateAll();\n }\n },\n methods: {\n //转换输入的时间\n parse: function(time, isLast) {\n if (time) {\n var tmpTime = new Date(time);\n if (isLast === undefined) {\n return tmpTime;\n } else if (isLast) {\n return new Date(tmpTime.getFullYear(), tmpTime.getMonth(), tmpTime.getDate(), 23, 59, 59, 999);\n } else {\n return new Date(tmpTime.getFullYear(), tmpTime.getMonth(), tmpTime.getDate());\n }\n }\n return null;\n },\n //初始化时间范围\n initRanges: function() {\n var time = new Date(),\n ranges = [];\n ranges.push({\n name: '今天',\n start: this.parse(time, false),\n end: this.parse(time, true)\n });\n time.setDate(time.getDate() - 1);\n ranges.push({\n name: '昨天',\n start: this.parse(time, false),\n end: this.parse(time, true)\n });\n time = new Date();\n time.setDate(time.getDate() - 6);\n ranges.push({\n name: '最近7天',\n start: this.parse(time, false),\n end: this.parse(new Date(), true)\n });\n time = new Date();\n time.setMonth(time.getMonth() + 1, 0);\n ranges.push({\n name: '本月',\n start: new Date(time.getFullYear(), time.getMonth(), 1),\n end: this.parse(time, true)\n });\n time = new Date();\n time.setMonth(time.getMonth(), 0);\n ranges.push({\n name: '上个月',\n start: new Date(time.getFullYear(), time.getMonth(), 1),\n end: this.parse(time, true)\n });\n time = new Date();\n time.setDate(time.getDate() - 29);\n ranges.push({\n name: '最近一个月',\n start: this.parse(time, false),\n end: this.parse(new Date(), true)\n });\n time = new Date();\n time.setDate(time.getDate() - 365);\n ranges.push({\n name: '最近一年',\n start: this.parse(time, false),\n end: this.parse(new Date(), true)\n });\n this.ranges = ranges;\n },\n //更新所有的日历\n updateAll: function() {\n this.update(new Date(this.now1), 1);\n this.range && this.update(new Date(this.now2), 2);\n },\n //点击时间输入框的时候触发\n click: function() {\n var self = this;\n self.time1 = self.parse(self.startTime) || self.parse(self.time);\n self.now1 = self.parse(self.startTime) || new Date();\n if (self.range) {\n self.initRanges();\n self.time2 = self.parse(self.endTime);\n self.now2 = self.parse(self.endTime) || new Date();\n }\n var rect = this.$el.getBoundingClientRect(),\n right = document.documentElement.clientWidth - rect.left;\n (right < (self.range ? 441 : 214) && right < rect.left) ? (self.left = true) : (self.left = false);\n self.show = !self.show;\n },\n //选择时间\n select: function(item, no) {\n var self = this;\n self.hidePanel();\n if (item.status.indexOf('mz-calendar-disabled') !== -1) {\n return;\n }\n self['now' + no] = new Date(item.time);\n self['time' + no] = new Date(item.time);\n if (!self.range) {\n self.time = self.getOutTime(item.time);\n self.show = false;\n } else if (!self.confirm) {\n self[no === 1 ? 'startTime' : 'endTime'] = self.getOutTime(item.time);\n }\n },\n //确认\n ok: function() {\n var self = this;\n self.show = false;\n if (self.range && self.confirm) {\n self.startTime = self.getOutTime(self.time1);\n self.endTime = self.getOutTime(self.time2);\n self.onConfirm && self.onConfirm(self.startTime, self.endTime);\n }\n },\n //选择范围\n selectRange: function(item) {\n var self = this;\n self.now1 = new Date(item.start);\n self.now2 = new Date(item.end);\n self.time1 = new Date(item.start);\n self.time2 = new Date(item.end);\n self.startTime = self.getOutTime(item.start);\n self.endTime = self.getOutTime(item.end);\n self.hidePanel();\n },\n //根据输出类型,获取输出的时间\n getOutTime: function(time) {\n var type = this.time ? typeof(this.time) : typeof(this.startTime);\n if (type === 'number') {\n return time.getTime();\n } else if (type === 'object') {\n return new Date(time);\n } else {\n return this.stringify(time);\n }\n },\n //更新时间\n update: function(time, no) {\n var i, tmpTime, curFirstDay, lastDay, curDay, day, arr = [];\n time.setDate(0); //切换到上个月最后一天\n curFirstDay = time.getDay(); //星期几\n lastDay = time.getDate(); //上个月的最后一天\n for (i = curFirstDay; i > 0; i--) {\n day = lastDay - i + 1;\n tmpTime = new Date(time.getFullYear(), time.getMonth(), day);\n tmpTime = this.parse(tmpTime, no === 2);\n arr.push({\n status: this.getTimeStatus(tmpTime, no) || 'mz-calendar-lastmonth',\n title: this.stringify(tmpTime),\n text: day,\n time: tmpTime\n });\n }\n time.setMonth(time.getMonth() + 2, 0); //切换到当前月的最后一天\n curDay = time.getDate(); //当前月的最后一天\n time.setDate(1);\n for (i = 1; i <= curDay; i++) {\n tmpTime = new Date(time.getFullYear(), time.getMonth(), i);\n tmpTime = this.parse(tmpTime, no === 2);\n arr.push({\n status: this.getTimeStatus(tmpTime, no),\n title: this.stringify(tmpTime),\n text: i,\n time: tmpTime\n });\n }\n //下个月的前几天\n for (i = 1; arr.length < 42; i++) {\n tmpTime = new Date(time.getFullYear(), time.getMonth() + 1, i);\n tmpTime = this.parse(tmpTime, no === 2);\n arr.push({\n status: this.getTimeStatus(tmpTime, no) || 'mz-calendar-nextmonth',\n title: this.stringify(tmpTime),\n text: i,\n time: tmpTime\n });\n }\n this['date' + no] = arr;\n },\n //获取时间状态\n getTimeStatus: function(time, no, format) {\n var status = '',\n curTime = new Date(),\n selTime = this['time' + no],\n tmpTimeVal = this.stringify(time, format || 'yyyy-MM-dd'), //需要查询状态的时间字符串值\n curTimeVal = this.stringify(curTime, format || 'yyyy-MM-dd'), //当前时间字符串值\n selTimeVal = this.stringify(selTime, format || 'yyyy-MM-dd'); //选中时间字符串值\n if (tmpTimeVal === selTimeVal) {\n status = 'mz-calendar-selected';\n } else if (tmpTimeVal === curTimeVal) {\n status = 'mz-calendar-today';\n }\n if (this.time1 && this.time2 && time >= this.time1 && time <= this.time2) {\n status += ' mz-calendar-inrange';\n }\n if (no == 1 && this.time2) {\n var minTime = new Date(this.time2);\n if (this.maxRange) {\n minTime.setDate(minTime.getDate() - this.maxRange);\n if (format === 'yyyy') {\n minTime = new Date(minTime.getFullYear(), 0, 1);\n }\n if (format === 'yyyy-MM') {\n minTime = new Date(minTime.getFullYear(), 0, 1);\n }\n if (time < minTime || time > this.time2) {\n status += ' mz-calendar-disabled';\n }\n } else if (time > this.time2) {\n status += ' mz-calendar-disabled';\n }\n if (time > this.time2) {\n status += ' mz-calendar-disabled';\n }\n }\n if (no == 2 && this.time1) {\n var maxTime = new Date(this.time1);\n if (this.maxRange) {\n maxTime.setDate(maxTime.getDate() + this.maxRange);\n if (format === 'yyyy') {\n maxTime = new Date(maxTime.getFullYear(), 11, 1);\n }\n if (format === 'yyyy-MM') {\n maxTime = new Date(maxTime.getFullYear(), maxTime.getMonth() + 1, 1);\n }\n if (time > maxTime || time < this.time1) {\n status += ' mz-calendar-disabled';\n }\n } else if (time < this.time1) {\n status += ' mz-calendar-disabled';\n }\n }\n return status;\n },\n //将Date转化为指定格式的String\n stringify: function(time, format) {\n if (!time) {\n return '';\n }\n format = format || this.format;\n var year = time.getFullYear(), //年份\n month = time.getMonth() + 1, //月份\n day = time.getDate(), //日\n hours24 = time.getHours(), //小时\n hours = hours24 % 12 === 0 ? 12 : hours24 % 12,\n minutes = time.getMinutes(), //分\n seconds = time.getSeconds(), //秒\n milliseconds = time.getMilliseconds(); //毫秒\n var map = {\n yyyy: year,\n MM: ('0' + month).slice(-2),\n M: month,\n dd: ('0' + day).slice(-2),\n d: day,\n HH: ('0' + hours24).slice(-2),\n H: hours24,\n hh: ('0' + hours).slice(-2),\n h: hours,\n mm: ('0' + minutes).slice(-2),\n m: minutes,\n ss: ('0' + seconds).slice(-2),\n s: seconds,\n S: milliseconds\n };\n return format.replace(/y+|M+|d+|H+|h+|m+|s+|S+/g, function(str) {\n return map[str];\n });\n },\n //显示年份选择器\n showYear: function(no) {\n var name = 'showYear' + no;\n this.hidePanel(name);\n this[name] = !this[name];\n var time = new Date(this['now' + no] || new Date()),\n num = Math.floor(time.getFullYear() % 10), //获取当前时间个位数\n arr = [];\n time.setDate(1); //先设置为第一天,因为月份天数不一样,要不存在bug\n time.setFullYear(time.getFullYear() - num);\n while (arr.length < 10) {\n no === 2 && time.setMonth(time.getMonth() + 1, 0);\n arr.push({\n year: time.getFullYear(),\n status: this.getTimeStatus(time, no, 'yyyy'),\n });\n time.setDate(1);\n time.setFullYear(time.getFullYear() + 1);\n }\n this['years' + no] = arr;\n },\n //显示月份选择器\n showMonth: function(no) {\n var name = 'showMonth' + no;\n this.hidePanel(name);\n this[name] = !this[name];\n var time = new Date(this['now' + no] || new Date()),\n arr = [];\n while (arr.length < 12) {\n time.setDate(1); //先设置为第一天,因为月份天数不一样,要不存在bug\n time.setMonth(arr.length);\n no === 2 && time.setMonth(time.getMonth() + 1, 0);\n arr.push({\n month: arr.length + 1,\n status: this.getTimeStatus(time, no, 'yyyy-MM'),\n });\n }\n this['months' + no] = arr;\n },\n //切换年份选择器\n changeYearRange: function(no, flag) {\n var arr = this['years' + no],\n time = new Date(this['time' + no] || new Date());\n for (var i in arr) {\n var item = arr[i],\n year = item.year + 10 * flag;\n time.setDate(1); //先设置为第一天,因为月份天数不一样,要不存在bug\n time.setFullYear(year);\n no === 2 && time.setMonth(time.getMonth() + 1, 0);\n item.year = year;\n item.status = this.getTimeStatus(time, no);\n }\n },\n //改变年份\n changeYear: function(flag, no) {\n var now = this['now' + no];\n now.setDate(1); //先设置为第一天,因为月份天数不一样,要不存在bug\n now.setFullYear(now.getFullYear() + flag);\n no === 2 && now.setMonth(now.getMonth() + 1, 0);\n this['now' + no] = new Date(now);\n this.hidePanel();\n },\n //改变月份\n changeMonth: function(flag, no) {\n var now = this['now' + no];\n now.setDate(1); //先设置为第一天,因为月份天数不一样,要不存在bug\n now.setMonth(now.getMonth() + flag);\n no === 2 && now.setMonth(now.getMonth() + 1, 0);\n this['now' + no] = new Date(now);\n this.hidePanel();\n },\n //选择年份\n selectYear: function(item, no) {\n if (item.status.indexOf('mz-calendar-disabled') !== -1) {\n return;\n }\n var now = this['now' + no];\n now.setFullYear(item.year);\n this['now' + no] = new Date(now);\n this.hidePanel();\n },\n //选择月份\n selectMonth: function(item, no) {\n if (item.status.indexOf('mz-calendar-disabled') !== -1) {\n return;\n }\n var now = this['now' + no];\n now.setMonth(item.month - 1);\n this['now' + no] = new Date(now);\n this.hidePanel();\n },\n //隐藏所有面板\n hidePanel: function(name) {\n ['showYear1', 'showYear2', 'showMonth1', 'showMonth2'].map(function(item) {\n if (item !== name) {\n this[item] = false;\n }\n }.bind(this));\n },\n //清除时间\n clear: function() {\n var self = this;\n self.time1 = self.time2 = self.startTime = self.endTime = self.time = null;\n self.now1 = new Date();\n self.now2 = new Date();\n }\n }\n });\n}));"} +{"text": "# -*- coding: utf-8 -*-\n# Copyright 2010-present Basho Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport copy\nimport os\nimport sys\nimport unittest\n\nfrom six import string_types, PY2, PY3\nfrom time import sleep\nfrom riak import ConflictError, RiakError, ListError\nfrom riak import RiakClient, RiakBucket, BucketType\nfrom riak.resolver import default_resolver, last_written_resolver\nfrom riak.tests import RUN_KV, RUN_RESOLVE, PROTOCOL\nfrom riak.tests.base import IntegrationTestBase\nfrom riak.tests.comparison import Comparison\n\ntry:\n import simplejson as json\nexcept ImportError:\n import json\n\nif PY2:\n import cPickle\n test_pickle_dumps = cPickle.dumps\n test_pickle_loads = cPickle.loads\nelse:\n import pickle\n test_pickle_dumps = pickle.dumps\n test_pickle_loads = pickle.loads\n\n\ntestrun_sibs_bucket = 'sibsbucket'\ntestrun_props_bucket = 'propsbucket'\n\n\ndef setUpModule():\n if not RUN_KV:\n return\n c = IntegrationTestBase.create_client()\n c.bucket(testrun_sibs_bucket).allow_mult = True\n c.close()\n\n\ndef tearDownModule():\n if not RUN_KV:\n return\n c = IntegrationTestBase.create_client()\n c.bucket(testrun_sibs_bucket).clear_properties()\n c.bucket(testrun_props_bucket).clear_properties()\n c.close()\n\n\nclass NotJsonSerializable(object):\n def __init__(self, *args, **kwargs):\n self.args = list(args)\n self.kwargs = kwargs\n\n def __eq__(self, other):\n if len(self.args) != len(other.args):\n return False\n if len(self.kwargs) != len(other.kwargs):\n return False\n for name, value in self.kwargs.items():\n if other.kwargs[name] != value:\n return False\n value1_args = copy.copy(self.args)\n value2_args = copy.copy(other.args)\n value1_args.sort()\n value2_args.sort()\n for i in range(len(value1_args)):\n if value1_args[i] != value2_args[i]:\n return False\n return True\n\n\nclass KVUnitTests(unittest.TestCase):\n def test_list_keys_exception(self):\n c = RiakClient()\n bt = BucketType(c, 'test')\n b = RiakBucket(c, 'test', bt)\n with self.assertRaises(ListError):\n b.get_keys()\n\n def test_stream_buckets_exception(self):\n c = RiakClient()\n with self.assertRaises(ListError):\n bs = []\n for bl in c.stream_buckets():\n bs.extend(bl)\n\n def test_stream_keys_exception(self):\n c = RiakClient()\n with self.assertRaises(ListError):\n ks = []\n for kl in c.stream_keys('test'):\n ks.extend(kl)\n\n def test_ts_stream_keys_exception(self):\n c = RiakClient()\n with self.assertRaises(ListError):\n ks = []\n for kl in c.ts_stream_keys('test'):\n ks.extend(kl)\n\n\n@unittest.skipUnless(RUN_KV, 'RUN_KV is 0')\nclass BasicKVTests(IntegrationTestBase, unittest.TestCase, Comparison):\n def test_no_returnbody(self):\n bucket = self.client.bucket(self.bucket_name)\n o = bucket.new(self.key_name, \"bar\").store(return_body=False)\n self.assertEqual(o.vclock, None)\n\n @unittest.skipUnless(PROTOCOL == 'pbc', 'Only available on pbc')\n def test_get_no_returnbody(self):\n bucket = self.client.bucket(self.bucket_name)\n o = bucket.new(self.key_name, \"Ain't no body\")\n o.store()\n\n stored_object = bucket.get(self.key_name, head_only=True)\n self.assertFalse(stored_object.data)\n\n list_of_objects = bucket.multiget([self.key_name], head_only=True)\n for stored_object in list_of_objects:\n self.assertFalse(stored_object.data)\n\n def test_many_link_headers_should_work_fine(self):\n bucket = self.client.bucket(self.bucket_name)\n o = bucket.new(\"lots_of_links\", \"My god, it's full of links!\")\n for i in range(0, 300):\n link = (\"other\", \"key%d\" % i, \"next\")\n o.add_link(link)\n\n o.store()\n stored_object = bucket.get(\"lots_of_links\")\n self.assertEqual(len(stored_object.links), 300)\n\n def test_is_alive(self):\n self.assertTrue(self.client.is_alive())\n\n def test_store_and_get(self):\n bucket = self.client.bucket(self.bucket_name)\n rand = self.randint()\n obj = bucket.new('foo', rand)\n obj.store()\n obj = bucket.get('foo')\n self.assertTrue(obj.exists)\n self.assertEqual(obj.bucket.name, self.bucket_name)\n self.assertEqual(obj.key, 'foo')\n self.assertEqual(obj.data, rand)\n\n # unicode objects are fine, as long as they don't\n # contain any non-ASCII chars\n if PY2:\n self.client.bucket(unicode(self.bucket_name)) # noqa\n else:\n self.client.bucket(self.bucket_name)\n if PY2:\n self.assertRaises(TypeError, self.client.bucket, u'búcket')\n self.assertRaises(TypeError, self.client.bucket, 'búcket')\n else:\n self.client.bucket(u'búcket')\n self.client.bucket('búcket')\n\n bucket.get(u'foo')\n if PY2:\n self.assertRaises(TypeError, bucket.get, u'føø')\n self.assertRaises(TypeError, bucket.get, 'føø')\n\n self.assertRaises(TypeError, bucket.new, u'foo', 'éå')\n self.assertRaises(TypeError, bucket.new, u'foo', 'éå')\n self.assertRaises(TypeError, bucket.new, 'foo', u'éå')\n self.assertRaises(TypeError, bucket.new, 'foo', u'éå')\n else:\n bucket.get(u'føø')\n bucket.get('føø')\n\n bucket.new(u'foo', 'éå')\n bucket.new(u'foo', 'éå')\n bucket.new('foo', u'éå')\n bucket.new('foo', u'éå')\n\n obj2 = bucket.new('baz', rand, 'application/json')\n obj2.charset = 'UTF-8'\n obj2.store()\n obj2 = bucket.get('baz')\n self.assertEqual(obj2.data, rand)\n\n def test_store_obj_with_unicode(self):\n bucket = self.client.bucket(self.bucket_name)\n data = {u'føø': u'éå'}\n obj = bucket.new('foo', data)\n obj.store()\n obj = bucket.get('foo')\n self.assertEqual(obj.data, data)\n\n def test_store_unicode_string(self):\n bucket = self.client.bucket(self.bucket_name)\n data = u\"some unicode data: \\u00c6\"\n obj = bucket.new(self.key_name, encoded_data=data.encode('utf-8'),\n content_type='text/plain')\n obj.charset = 'utf-8'\n obj.store()\n obj2 = bucket.get(self.key_name)\n self.assertEqual(data, obj2.encoded_data.decode('utf-8'))\n\n def test_string_bucket_name(self):\n # Things that are not strings cannot be bucket names\n for bad in (12345, True, None, {}, []):\n with self.assert_raises_regex(TypeError, 'must be a string'):\n self.client.bucket(bad)\n\n with self.assert_raises_regex(TypeError, 'must be a string'):\n RiakBucket(self.client, bad, None)\n\n # Unicode bucket names are not supported in Python 2.x,\n # if they can't be encoded to ASCII. This should be changed in a\n # future release.\n if PY2:\n with self.assert_raises_regex(TypeError,\n 'Unicode bucket names '\n 'are not supported'):\n self.client.bucket(u'føø')\n else:\n self.client.bucket(u'føø')\n\n # This is fine, since it's already ASCII\n self.client.bucket('ASCII')\n\n def test_generate_key(self):\n # Ensure that Riak generates a random key when\n # the key passed to bucket.new() is None.\n bucket = self.client.bucket(self.bucket_name)\n o = bucket.new(None, data={})\n self.assertIsNone(o.key)\n o.store()\n self.assertIsNotNone(o.key)\n self.assertNotIn('/', o.key)\n existing_keys = bucket.get_keys()\n self.assertEqual(len(existing_keys), 1)\n\n def maybe_store_keys(self):\n skey = 'rkb-init'\n bucket = self.client.bucket('random_key_bucket')\n sobj = bucket.get(skey)\n if sobj.exists:\n return\n for key in range(1, 1000):\n o = bucket.new(None, data={})\n o.store()\n o = bucket.new(skey, data={})\n o.store()\n\n def test_stream_keys(self):\n self.maybe_store_keys()\n bucket = self.client.bucket('random_key_bucket')\n regular_keys = bucket.get_keys()\n self.assertNotEqual(len(regular_keys), 0)\n streamed_keys = []\n for keylist in bucket.stream_keys():\n self.assertNotEqual([], keylist)\n for key in keylist:\n self.assertIsInstance(key, string_types)\n streamed_keys += keylist\n self.assertEqual(sorted(regular_keys), sorted(streamed_keys))\n\n def test_stream_keys_timeout(self):\n self.maybe_store_keys()\n bucket = self.client.bucket('random_key_bucket')\n streamed_keys = []\n with self.assertRaises(RiakError):\n for keylist in self.client.stream_keys(bucket, timeout=1):\n self.assertNotEqual([], keylist)\n for key in keylist:\n self.assertIsInstance(key, string_types)\n streamed_keys += keylist\n\n def test_stream_keys_abort(self):\n self.maybe_store_keys()\n bucket = self.client.bucket('random_key_bucket')\n regular_keys = bucket.get_keys()\n self.assertNotEqual(len(regular_keys), 0)\n try:\n for keylist in bucket.stream_keys():\n raise RuntimeError(\"abort\")\n except RuntimeError:\n pass\n\n # If the stream was closed correctly, this will not error\n robj = bucket.get(regular_keys[0])\n self.assertEqual(len(robj.siblings), 1)\n self.assertEqual(True, robj.exists)\n\n def test_bad_key(self):\n bucket = self.client.bucket(self.bucket_name)\n obj = bucket.new()\n with self.assertRaises(TypeError):\n bucket.get(None)\n\n with self.assertRaises(TypeError):\n self.client.get(obj)\n\n with self.assertRaises(TypeError):\n bucket.get(1)\n\n def test_binary_store_and_get(self):\n bucket = self.client.bucket(self.bucket_name)\n # Store as binary, retrieve as binary, then compare...\n rand = str(self.randint())\n if PY2:\n rand = bytes(rand)\n else:\n rand = bytes(rand, 'utf-8')\n obj = bucket.new(self.key_name, encoded_data=rand,\n content_type='text/plain')\n obj.store()\n obj = bucket.get(self.key_name)\n self.assertTrue(obj.exists)\n self.assertEqual(obj.encoded_data, rand)\n # Store as JSON, retrieve as binary, JSON-decode, then compare...\n data = [self.randint(), self.randint(), self.randint()]\n key2 = self.randname()\n obj = bucket.new(key2, data)\n obj.store()\n obj = bucket.get(key2)\n self.assertEqual(data, json.loads(obj.encoded_data.decode()))\n\n def test_blank_binary_204(self):\n bucket = self.client.bucket(self.bucket_name)\n\n # this should *not* raise an error\n empty = \"\"\n if PY2:\n empty = bytes(empty)\n else:\n empty = bytes(empty, 'utf-8')\n obj = bucket.new('foo2', encoded_data=empty, content_type='text/plain')\n obj.store()\n obj = bucket.get('foo2')\n self.assertTrue(obj.exists)\n self.assertEqual(obj.encoded_data, empty)\n\n def test_custom_bucket_encoder_decoder(self):\n bucket = self.client.bucket(self.bucket_name)\n # Teach the bucket how to pickle\n bucket.set_encoder('application/x-pickle', test_pickle_dumps)\n bucket.set_decoder('application/x-pickle', test_pickle_loads)\n data = {'array': [1, 2, 3], 'badforjson': NotJsonSerializable(1, 3)}\n obj = bucket.new(self.key_name, data, 'application/x-pickle')\n obj.store()\n obj2 = bucket.get(self.key_name)\n self.assertEqual(data, obj2.data)\n\n def test_custom_client_encoder_decoder(self):\n bucket = self.client.bucket(self.bucket_name)\n # Teach the client how to pickle\n self.client.set_encoder('application/x-pickle', test_pickle_dumps)\n self.client.set_decoder('application/x-pickle', test_pickle_loads)\n data = {'array': [1, 2, 3], 'badforjson': NotJsonSerializable(1, 3)}\n obj = bucket.new(self.key_name, data, 'application/x-pickle')\n obj.store()\n obj2 = bucket.get(self.key_name)\n self.assertEqual(data, obj2.data)\n\n def test_unknown_content_type_encoder_decoder(self):\n # Bypass the content_type encoders\n bucket = self.client.bucket(self.bucket_name)\n data = \"some funny data\"\n if PY3:\n # Python 3.x needs to store binaries\n data = data.encode()\n obj = bucket.new(self.key_name,\n encoded_data=data,\n content_type='application/x-frobnicator')\n obj.store()\n obj2 = bucket.get(self.key_name)\n self.assertEqual(data, obj2.encoded_data)\n\n def test_text_plain_encoder_decoder(self):\n bucket = self.client.bucket(self.bucket_name)\n data = \"some funny data\"\n obj = bucket.new(self.key_name, data, content_type='text/plain')\n obj.store()\n obj2 = bucket.get(self.key_name)\n self.assertEqual(data, obj2.data)\n\n def test_missing_object(self):\n bucket = self.client.bucket(self.bucket_name)\n obj = bucket.get(self.key_name)\n self.assertFalse(obj.exists)\n # Object with no siblings should not raise the ConflictError\n self.assertIsNone(obj.data)\n\n def test_delete(self):\n bucket = self.client.bucket(self.bucket_name)\n rand = self.randint()\n obj = bucket.new(self.key_name, rand)\n obj.store()\n obj = bucket.get(self.key_name)\n self.assertTrue(obj.exists)\n\n obj.delete()\n obj.reload()\n self.assertFalse(obj.exists)\n\n def test_bucket_delete(self):\n bucket = self.client.bucket(self.bucket_name)\n rand = self.randint()\n obj = bucket.new(self.key_name, rand)\n obj.store()\n\n bucket.delete(self.key_name)\n obj.reload()\n self.assertFalse(obj.exists)\n\n def test_set_bucket_properties(self):\n bucket = self.client.bucket(testrun_props_bucket)\n # Test setting allow mult...\n bucket.allow_mult = True\n # Test setting nval...\n bucket.n_val = 1\n\n c2 = self.create_client()\n bucket2 = c2.bucket(testrun_props_bucket)\n self.assertTrue(bucket2.allow_mult)\n self.assertEqual(bucket2.n_val, 1)\n # Test setting multiple properties...\n bucket.set_properties({\"allow_mult\": False, \"n_val\": 2})\n\n c3 = self.create_client()\n bucket3 = c3.bucket(testrun_props_bucket)\n self.assertFalse(bucket3.allow_mult)\n self.assertEqual(bucket3.n_val, 2)\n\n # clean up!\n c2.close()\n c3.close()\n\n def test_if_none_match(self):\n bucket = self.client.bucket(self.bucket_name)\n obj = bucket.get(self.key_name)\n obj.delete()\n\n obj.reload()\n self.assertFalse(obj.exists)\n obj.data = [\"first store\"]\n obj.content_type = 'application/json'\n obj.store()\n\n obj.data = [\"second store\"]\n with self.assertRaises(Exception):\n obj.store(if_none_match=True)\n\n def test_siblings(self):\n # Set up the bucket, clear any existing object...\n bucket = self.client.bucket(testrun_sibs_bucket)\n obj = bucket.get(self.key_name)\n bucket.allow_mult = True\n\n # Even if it previously existed, let's store a base resolved version\n # from which we can diverge by sending a stale vclock.\n obj.data = 'start'\n obj.content_type = 'text/plain'\n obj.store()\n\n vals = set(self.generate_siblings(obj, count=5))\n\n # Make sure the object has five siblings...\n obj = bucket.get(self.key_name)\n self.assertEqual(len(obj.siblings), 5)\n\n # When the object is in conflict, using the shortcut methods\n # should raise the ConflictError\n with self.assertRaises(ConflictError):\n obj.data\n\n # Get each of the values - make sure they match what was\n # assigned\n vals2 = set([sibling.data for sibling in obj.siblings])\n self.assertEqual(vals, vals2)\n\n # Resolve the conflict, and then do a get...\n resolved_sibling = obj.siblings[3]\n obj.siblings = [resolved_sibling]\n self.assertEqual(len(obj.siblings), 1)\n obj.store()\n\n self.assertEqual(len(obj.siblings), 1)\n self.assertEqual(obj.data, resolved_sibling.data)\n\n @unittest.skipUnless(RUN_RESOLVE, \"RUN_RESOLVE is 0\")\n def test_resolution(self):\n bucket = self.client.bucket(testrun_sibs_bucket)\n obj = bucket.get(self.key_name)\n bucket.allow_mult = True\n\n # Even if it previously existed, let's store a base resolved version\n # from which we can diverge by sending a stale vclock.\n obj.data = 'start'\n obj.content_type = 'text/plain'\n obj.store()\n\n vals = self.generate_siblings(obj, count=5, delay=1.01)\n\n # Make sure the object has five siblings when using the\n # default resolver\n obj = bucket.get(self.key_name)\n obj.reload()\n self.assertEqual(len(obj.siblings), 5)\n\n # Setting the resolver on the client object to use the\n # \"last-write-wins\" behavior\n self.client.resolver = last_written_resolver\n obj.reload()\n self.assertEqual(obj.resolver, last_written_resolver)\n self.assertEqual(1, len(obj.siblings))\n self.assertEqual(obj.data, vals[-1])\n\n # Set the resolver on the bucket to the default resolver,\n # overriding the resolver on the client\n bucket.resolver = default_resolver\n obj.reload()\n self.assertEqual(obj.resolver, default_resolver)\n self.assertEqual(len(obj.siblings), 5)\n\n # Define our own custom resolver on the object that returns\n # the maximum value, overriding the bucket and client resolvers\n def max_value_resolver(obj):\n obj.siblings = [max(obj.siblings, key=lambda s: s.data), ]\n\n obj.resolver = max_value_resolver\n obj.reload()\n self.assertEqual(obj.resolver, max_value_resolver)\n self.assertEqual(obj.data, max(vals))\n\n # Setting the resolver to None on all levels reverts to the\n # default resolver.\n obj.resolver = None\n self.assertEqual(obj.resolver, default_resolver) # set by bucket\n bucket.resolver = None\n self.assertEqual(obj.resolver, last_written_resolver) # set by client\n self.client.resolver = None\n self.assertEqual(obj.resolver, default_resolver) # reset\n self.assertEqual(bucket.resolver, default_resolver) # reset\n self.assertEqual(self.client.resolver, default_resolver) # reset\n\n @unittest.skipUnless(RUN_RESOLVE, \"RUN_RESOLVE is 0\")\n def test_resolution_default(self):\n # If no resolver is setup, be sure to resolve to default_resolver\n bucket = self.client.bucket(testrun_sibs_bucket)\n self.assertEqual(self.client.resolver, default_resolver)\n self.assertEqual(bucket.resolver, default_resolver)\n\n def test_tombstone_siblings(self):\n # Set up the bucket, clear any existing object...\n bucket = self.client.bucket(testrun_sibs_bucket)\n obj = bucket.get(self.key_name)\n bucket.allow_mult = True\n\n obj.data = 'start'\n obj.content_type = 'text/plain'\n obj.store(return_body=True)\n\n obj.delete()\n\n vals = set(self.generate_siblings(obj, count=4))\n\n obj = bucket.get(self.key_name)\n\n # TODO this used to be 5, only\n siblen = len(obj.siblings)\n self.assertTrue(siblen == 4 or siblen == 5)\n\n non_tombstones = 0\n for sib in obj.siblings:\n if sib.exists:\n non_tombstones += 1\n self.assertTrue(not sib.exists or sib.data in vals)\n self.assertEqual(non_tombstones, 4)\n\n def test_store_of_missing_object(self):\n bucket = self.client.bucket(self.bucket_name)\n # for json objects\n o = bucket.get(self.key_name)\n self.assertEqual(o.exists, False)\n o.data = {\"foo\": \"bar\"}\n o.content_type = 'application/json'\n\n o = o.store()\n self.assertEqual(o.data, {\"foo\": \"bar\"})\n self.assertEqual(o.content_type, \"application/json\")\n o.delete()\n # for binary objects\n o = bucket.get(self.randname())\n self.assertEqual(o.exists, False)\n if PY2:\n o.encoded_data = \"1234567890\"\n else:\n o.encoded_data = \"1234567890\".encode()\n o.content_type = 'application/octet-stream'\n\n o = o.store()\n if PY2:\n self.assertEqual(o.encoded_data, \"1234567890\")\n else:\n self.assertEqual(o.encoded_data, \"1234567890\".encode())\n self.assertEqual(o.content_type, \"application/octet-stream\")\n o.delete()\n\n def test_store_metadata(self):\n bucket = self.client.bucket(self.bucket_name)\n rand = self.randint()\n obj = bucket.new(self.key_name, rand)\n obj.usermeta = {'custom': 'some metadata'}\n obj.store()\n obj = bucket.get(self.key_name)\n self.assertEqual('some metadata', obj.usermeta['custom'])\n\n def test_list_buckets(self):\n bucket = self.client.bucket(self.bucket_name)\n bucket.new(\"one\", {\"foo\": \"one\", \"bar\": \"red\"}).store()\n buckets = self.client.get_buckets()\n self.assertTrue(self.bucket_name in [x.name for x in buckets])\n\n def test_stream_buckets(self):\n bucket = self.client.bucket(self.bucket_name)\n bucket.new(self.key_name, data={\"foo\": \"one\",\n \"bar\": \"baz\"}).store()\n buckets = []\n for bucket_list in self.client.stream_buckets():\n buckets.extend(bucket_list)\n\n self.assertTrue(self.bucket_name in [x.name for x in buckets])\n\n def test_stream_buckets_abort(self):\n bucket = self.client.bucket(self.bucket_name)\n bucket.new(self.key_name, data={\"foo\": \"one\",\n \"bar\": \"baz\"}).store()\n try:\n for bucket_list in self.client.stream_buckets():\n raise RuntimeError(\"abort\")\n except RuntimeError:\n pass\n\n robj = bucket.get(self.key_name)\n self.assertTrue(robj.exists)\n self.assertEqual(len(robj.siblings), 1)\n\n def test_get_params(self):\n bucket = self.client.bucket(self.bucket_name)\n bucket.new(self.key_name, data={\"foo\": \"one\",\n \"bar\": \"baz\"}).store()\n\n bucket.get(self.key_name, basic_quorum=False)\n bucket.get(self.key_name, basic_quorum=True)\n bucket.get(self.key_name, notfound_ok=True)\n bucket.get(self.key_name, notfound_ok=False)\n\n missing = bucket.get('missing-key', notfound_ok=True,\n basic_quorum=True)\n self.assertFalse(missing.exists)\n\n def test_preflist(self):\n nodes = ['riak@127.0.0.1', 'dev1@127.0.0.1']\n bucket = self.client.bucket(self.bucket_name)\n bucket.new(self.key_name, data={\"foo\": \"one\",\n \"bar\": \"baz\"}).store()\n try:\n preflist = bucket.get_preflist(self.key_name)\n preflist2 = self.client.get_preflist(bucket, self.key_name)\n for pref in (preflist, preflist2):\n self.assertEqual(len(pref), 3)\n self.assertIn(pref[0]['node'], nodes)\n [self.assertTrue(node['primary']) for node in pref]\n except NotImplementedError as e:\n raise unittest.SkipTest(e)\n\n def generate_siblings(self, original, count=5, delay=None):\n vals = []\n for _ in range(count):\n while True:\n randval = str(self.randint())\n if randval not in vals:\n break\n\n other_obj = original.bucket.new(key=original.key,\n data=randval,\n content_type='text/plain')\n other_obj.vclock = original.vclock\n other_obj.store()\n vals.append(randval)\n if delay:\n sleep(delay)\n return vals\n\n\n@unittest.skipUnless(RUN_KV, 'RUN_KV is 0')\nclass BucketPropsTest(IntegrationTestBase, unittest.TestCase):\n def test_rw_settings(self):\n bucket = self.client.bucket(testrun_props_bucket)\n self.assertEqual(bucket.r, \"quorum\")\n self.assertEqual(bucket.w, \"quorum\")\n self.assertEqual(bucket.dw, \"quorum\")\n self.assertEqual(bucket.rw, \"quorum\")\n\n bucket.w = 1\n self.assertEqual(bucket.w, 1)\n\n bucket.r = \"quorum\"\n self.assertEqual(bucket.r, \"quorum\")\n\n bucket.dw = \"all\"\n self.assertEqual(bucket.dw, \"all\")\n\n bucket.rw = \"one\"\n self.assertEqual(bucket.rw, \"one\")\n\n bucket.set_properties({'w': 'quorum',\n 'r': 'quorum',\n 'dw': 'quorum',\n 'rw': 'quorum'})\n bucket.clear_properties()\n\n def test_primary_quora(self):\n bucket = self.client.bucket(testrun_props_bucket)\n self.assertEqual(bucket.pr, 0)\n self.assertEqual(bucket.pw, 0)\n\n bucket.pr = 1\n self.assertEqual(bucket.pr, 1)\n\n bucket.pw = \"quorum\"\n self.assertEqual(bucket.pw, \"quorum\")\n\n bucket.set_properties({'pr': 0, 'pw': 0})\n bucket.clear_properties()\n\n def test_clear_bucket_properties(self):\n bucket = self.client.bucket(testrun_props_bucket)\n bucket.allow_mult = True\n self.assertTrue(bucket.allow_mult)\n bucket.n_val = 1\n self.assertEqual(bucket.n_val, 1)\n # Test setting clearing properties...\n\n self.assertTrue(bucket.clear_properties())\n self.assertFalse(bucket.allow_mult)\n self.assertEqual(bucket.n_val, 3)\n\n\n@unittest.skipUnless(RUN_KV, 'RUN_KV is 0')\nclass KVFileTests(IntegrationTestBase, unittest.TestCase):\n def test_store_binary_object_from_file(self):\n bucket = self.client.bucket(self.bucket_name)\n obj = bucket.new_from_file(self.key_name, __file__)\n obj.store()\n obj = bucket.get(self.key_name)\n self.assertNotEqual(obj.encoded_data, None)\n is_win32 = sys.platform == 'win32'\n self.assertTrue(obj.content_type == 'text/x-python' or\n (is_win32 and obj.content_type == 'text/plain') or\n obj.content_type == 'application/x-python-code')\n\n def test_store_binary_object_from_file_should_use_default_mimetype(self):\n bucket = self.client.bucket(self.bucket_name)\n filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n os.pardir, os.pardir, 'README.md')\n obj = bucket.new_from_file(self.key_name, filepath)\n obj.store()\n obj = bucket.get(self.key_name)\n self.assertEqual(obj.content_type, 'application/octet-stream')\n\n def test_store_binary_object_from_file_should_fail_if_file_not_found(self):\n bucket = self.client.bucket(self.bucket_name)\n with self.assertRaises(IOError):\n bucket.new_from_file(self.key_name, 'FILE_NOT_FOUND')\n obj = bucket.get(self.key_name)\n # self.assertEqual(obj.encoded_data, None)\n self.assertFalse(obj.exists)\n\n\n@unittest.skipUnless(RUN_KV, 'RUN_KV is 0')\nclass CounterTests(IntegrationTestBase, unittest.TestCase):\n def test_counter_requires_allow_mult(self):\n bucket = self.client.bucket(self.bucket_name)\n if bucket.allow_mult:\n bucket.allow_mult = False\n self.assertFalse(bucket.allow_mult)\n\n with self.assertRaises(Exception):\n bucket.update_counter(self.key_name, 10)\n\n def test_counter_ops(self):\n bucket = self.client.bucket(testrun_sibs_bucket)\n self.assertTrue(bucket.allow_mult)\n\n # Non-existent counter has no value\n self.assertEqual(None, bucket.get_counter(self.key_name))\n\n # Update the counter\n bucket.update_counter(self.key_name, 10)\n self.assertEqual(10, bucket.get_counter(self.key_name))\n\n # Update with returning the value\n self.assertEqual(15, bucket.update_counter(self.key_name, 5,\n returnvalue=True))\n\n # Now try decrementing\n self.assertEqual(10, bucket.update_counter(self.key_name, -5,\n returnvalue=True))\n"} +{"text": "/*\n * jGnash, a personal finance application\n * Copyright (C) 2001-2020 Craig Cavanaugh\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\npackage jgnash.engine.message;\n\n/**\n * Default message channels used by the engine.\n *\n * @author Craig Cavanaugh\n */\npublic enum MessageChannel {\n ACCOUNT, BUDGET, COMMODITY, CONFIG, REMINDER, SYSTEM, TAG, TRANSACTION\n}\n"} +{"text": "@{\r\n ViewData[\"Title\"] = \"Grouping and Summaries In Grid\";\r\n}\r\n\r\n@section ContentHeader {\r\n

@ViewData[\"Title\"]

\r\n}\r\n\r\n
\r\n \r\n

Here is a demo on grouping and summaries in SlickGrid.

\r\n

It starts with no grouping and only grand totals are shown. Click buttons to change grouping options.

\r\n

Please note that this is an experimental feature. It has no server side support so these operations are\r\n performed client side. It only groups by and shows totals for rows in visible page. You have to disable paging to \r\n show sums for all records.

\r\n\r\n

Source Files: @Html.AppSourceFile(\"Index.cshtml\"), @Html.AppSourceFile(\"GroupingAndSummariesInGrid.ts\")

\r\n
\r\n\r\n
\r\n\r\n"} +{"text": "Change Log\n==========\n\nVersion 0.7.0 *(2020-08-31)*\n----------------------------\n\n * New: Add support for contextual serializers which are registered with the supplied format.\n No new API or action is required for this to work–it's all implementation detail. Since it's\n a potentially incompatible behavior change, the version was bumped.\n\n\nVersion 0.6.0 *(2020-08-19)*\n----------------------------\n\n * Kotlin updated to 1.4.0\n * Serialization updated to 1.0.0-rc\n\n Note that the APIs used by this converter are marked as experimental. As such, the experimental\n annotation has been propagated to the public API such that you will need to opt-in to using it\n or receive a warning.\n\n\nVersion 0.5.0 *(2020-03-06)*\n----------------------------\n\n * Kotlin updated to 1.3.70\n * Serialization updated to 0.20.0\n * Retrofit updated to 2.6.4\n\n\nVersion 0.4.0 *(2019-04-12)*\n----------------------------\n\n * Serialization updated to 0.11.0\n\n\nVersion 0.3.0 *(2019-02-25)*\n----------------------------\n\n * New: `asConverterFactory()` extension API on `StringFormat` and `BinaryFormat`. This deprecates\n the old `serializationConverterFactory` top-level function.\n * Kotlin updated to 1.3.20\n * Serialization updated to 0.10.0\n\n\nVersion 0.2.0 *(2018-10-29)*\n----------------------------\n\n * New: `stringBased` and `bytesBased` have been removed in favor of a single\n `serializationConverterFactory` function with overloads for `StringFormat` and `BinaryFormat`\n instances (like `JSON` and `ProtoBuf`). For those configuring Retrofit from Java the API is now\n `KotlinSerializationConverterFactory.create`.\n * Kotlin updated to 1.3.0\n * Serialization updated to 0.9.0\n\n\nVersion 0.1.0 *(2018-09-22)*\n----------------------------\n\nUpdate to Kotlin 1.3.0-rc-57 and serialization 0.8.0-rc13.\n\n\nVersion 0.0.1 *(2018-01-15)*\n----------------------------\n\nInitial release.\n"} +{"text": "# Perks for Go (golang.org)\n\nPerks contains the Go package quantile that computes approximate quantiles over\nan unbounded data stream within low memory and CPU bounds.\n\nFor more information and examples, see:\nhttp://godoc.org/github.com/bmizerany/perks\n\nA very special thank you and shout out to Graham Cormode (Rutgers University),\nFlip Korn (AT&T Labs–Research), S. Muthukrishnan (Rutgers University), and\nDivesh Srivastava (AT&T Labs–Research) for their research and publication of\n[Effective Computation of Biased Quantiles over Data Streams](http://www.cs.rutgers.edu/~muthu/bquant.pdf)\n\nThank you, also:\n* Armon Dadgar (@armon)\n* Andrew Gerrand (@nf)\n* Brad Fitzpatrick (@bradfitz)\n* Keith Rarick (@kr)\n\nFAQ:\n\nQ: Why not move the quantile package into the project root?\nA: I want to add more packages to perks later.\n\nCopyright (C) 2013 Blake Mizerany\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n"} +{"text": "# Contributing to Go\n\nGo is an open source project.\n\nIt is the work of hundreds of contributors. We appreciate your help!\n\n## Filing issues\n\nWhen [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions:\n\n1. What version of Go are you using (`go version`)?\n2. What operating system and processor architecture are you using?\n3. What did you do?\n4. What did you expect to see?\n5. What did you see instead?\n\nGeneral questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.\nThe gophers there will answer or ask you to file an issue if you've tripped over a bug.\n\n## Contributing code\n\nPlease read the [Contribution Guidelines](https://golang.org/doc/contribute.html)\nbefore sending patches.\n\nUnless otherwise noted, the Go source files are distributed under\nthe BSD-style license found in the LICENSE file.\n"} +{"text": "/*=============================================================================\n Copyright (c) 2014-2015 Kohei Takahashi\n\n Distributed under the Boost Software License, Version 1.0. (See accompanying\n file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n==============================================================================*/\n#ifndef FUSION_VECTOR_FORWARD_11052014_1626\n#define FUSION_VECTOR_FORWARD_11052014_1626\n\n#include \n#include \n#include \n\n///////////////////////////////////////////////////////////////////////////////\n// With no variadics, we will use the C++03 version\n///////////////////////////////////////////////////////////////////////////////\n#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)\n# include \n#else\n\n///////////////////////////////////////////////////////////////////////////////\n// C++11 interface\n///////////////////////////////////////////////////////////////////////////////\n#include \n#include \n\nnamespace boost { namespace fusion\n{\n template \n struct vector;\n\n#define FUSION_VECTOR_N_ALIASES(z, N, d) \\\n template \\\n using BOOST_PP_CAT(vector, N) = vector;\n\n BOOST_PP_REPEAT(51, FUSION_VECTOR_N_ALIASES, ~)\n\n#undef FUSION_VECTOR_N_ALIASES\n}}\n\n#endif\n#endif\n\n"} +{"text": "// Copyright 2015 Dolphin Emulator Project\n// Licensed under GPLv2+\n// Refer to the license.txt file included.\n\n#pragma once\n\n#include \n#include \n#include \"Common/CommonTypes.h\"\n#include \"DiscIO/Volume.h\"\n\nclass wxCheckBox;\nclass wxChoice;\n\nclass WiiConfigPane final : public wxPanel\n{\npublic:\n\tWiiConfigPane(wxWindow* parent, wxWindowID id);\n\nprivate:\n\tvoid InitializeGUI();\n\tvoid LoadGUIValues();\n\tvoid RefreshGUI();\n\n\tvoid OnScreenSaverCheckBoxChanged(wxCommandEvent&);\n\tvoid OnPAL60CheckBoxChanged(wxCommandEvent&);\n\tvoid OnSDCardCheckBoxChanged(wxCommandEvent&);\n\tvoid OnConnectKeyboardCheckBoxChanged(wxCommandEvent&);\n\tvoid OnSystemLanguageChoiceChanged(wxCommandEvent&);\n\tvoid OnAspectRatioChoiceChanged(wxCommandEvent&);\n\n\tstatic u8 GetSADRCountryCode(DiscIO::IVolume::ELanguage language);\n\n\twxArrayString m_system_language_strings;\n\twxArrayString m_aspect_ratio_strings;\n\n\twxCheckBox* m_screensaver_checkbox;\n\twxCheckBox* m_pal60_mode_checkbox;\n\twxCheckBox* m_sd_card_checkbox;\n\twxCheckBox* m_connect_keyboard_checkbox;\n\twxChoice* m_system_language_choice;\n\twxChoice* m_aspect_ratio_choice;\n};\n"} +{"text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Symfony\\Component\\Console\\Descriptor;\n\nuse Symfony\\Component\\Console\\Application;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputDefinition;\nuse Symfony\\Component\\Console\\Input\\InputOption;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\nuse Symfony\\Component\\Console\\Exception\\InvalidArgumentException;\n\n/**\n * @author Jean-François Simon \n *\n * @internal\n */\nabstract class Descriptor implements DescriptorInterface\n{\n /**\n * @var OutputInterface\n */\n private $output;\n\n /**\n * {@inheritdoc}\n */\n public function describe(OutputInterface $output, $object, array $options = array())\n {\n $this->output = $output;\n\n switch (true) {\n case $object instanceof InputArgument:\n $this->describeInputArgument($object, $options);\n break;\n case $object instanceof InputOption:\n $this->describeInputOption($object, $options);\n break;\n case $object instanceof InputDefinition:\n $this->describeInputDefinition($object, $options);\n break;\n case $object instanceof Command:\n $this->describeCommand($object, $options);\n break;\n case $object instanceof Application:\n $this->describeApplication($object, $options);\n break;\n default:\n throw new InvalidArgumentException(sprintf('Object of type \"%s\" is not describable.', get_class($object)));\n }\n }\n\n /**\n * Writes content to output.\n *\n * @param string $content\n * @param bool $decorated\n */\n protected function write($content, $decorated = false)\n {\n $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);\n }\n\n /**\n * Describes an InputArgument instance.\n *\n * @param InputArgument $argument\n * @param array $options\n *\n * @return string|mixed\n */\n abstract protected function describeInputArgument(InputArgument $argument, array $options = array());\n\n /**\n * Describes an InputOption instance.\n *\n * @param InputOption $option\n * @param array $options\n *\n * @return string|mixed\n */\n abstract protected function describeInputOption(InputOption $option, array $options = array());\n\n /**\n * Describes an InputDefinition instance.\n *\n * @param InputDefinition $definition\n * @param array $options\n *\n * @return string|mixed\n */\n abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array());\n\n /**\n * Describes a Command instance.\n *\n * @param Command $command\n * @param array $options\n *\n * @return string|mixed\n */\n abstract protected function describeCommand(Command $command, array $options = array());\n\n /**\n * Describes an Application instance.\n *\n * @param Application $application\n * @param array $options\n *\n * @return string|mixed\n */\n abstract protected function describeApplication(Application $application, array $options = array());\n}\n"} +{"text": "open Core_kernel\nopen Bap.Std\nopen Bap_llvm.Std\nopen X86_asm.Reg\nopen X86_tools_types\n\ntype semantics = Mem_to_reg | Reg_to_mem\n\nmodule type S = sig\n type t [@@deriving bin_io, sexp, compare, enumerate]\n val asm_of_t : t -> X86_asm.reg\n val semantics : semantics\nend\n\nmodule type Version = sig\n module Mov_oa_ia32 : S\n module Mov_oa_amd64 : S\n module Mov_ao_ia32 : S\n module Mov_ao_amd64 : S\n val allow_nil : bool\nend\n\nmodule type Semantics = sig\n val lift : X86_asm.reg -> semantics -> bool -> lifter\nend\n\nmodule Insn_semantics(Tools : X86_tools.S) = struct\n open Tools\n\n let apply mem seg disp reg sem =\n let mem = MM.of_mem ?seg ~disp mem in\n match sem with\n | Mem_to_reg ->\n Ok [MM.load mem ~size:(RR.width reg) |> RR.set reg ]\n | Reg_to_mem ->\n Ok [RR.get reg |> MM.store mem ~size:(RR.width reg)]\n\n let lift asm sem allow_nil =\n let reg = RR.of_asm_exn asm in\n if allow_nil then\n X86_operands.ir ~f:(fun mem off seg -> apply mem (Some seg) off reg sem)\n else\n X86_operands.i ~f:(fun mem off -> apply mem None off reg sem)\nend\n\nmodule Ver_34 = struct\n\n let allow_nil = false\n\n module Mov_oa_ia32 = struct\n type t = MOV8o8a | MOV16o16a | MOV32o32a\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t t = match t with\n | MOV8o8a -> `AL\n | MOV16o16a -> `AX\n | MOV32o32a -> `EAX\n\n let semantics = Mem_to_reg\n end\n\n module Mov_oa_amd64 = struct\n type t = MOV64o8a | MOV64o16a | MOV64o32a | MOV64o64a\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t t = match t with\n | MOV64o8a -> `AL\n | MOV64o16a -> `AX\n | MOV64o32a -> `EAX\n | MOV64o64a -> `RAX\n\n let semantics = Mem_to_reg\n end\n\n module Mov_ao_ia32 = struct\n type t = MOV8ao8 | MOV16ao16 | MOV32ao32\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t t = match t with\n | MOV8ao8 -> `AL\n | MOV16ao16 -> `AX\n | MOV32ao32 -> `EAX\n\n let semantics = Reg_to_mem\n end\n\n module Mov_ao_amd64 = struct\n type t = MOV64ao8 | MOV64ao16 | MOV64ao32 | MOV64ao64\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t t = match t with\n | MOV64ao8 -> `AL\n | MOV64ao16 -> `AX\n | MOV64ao32 -> `EAX\n | MOV64ao64 -> `RAX\n\n let semantics = Reg_to_mem\n end\nend\n\nmodule Ver_common = struct\n\n let allow_nil = true\n\n module Mov_oa_ia32 = struct\n type t =\n | MOV8o16a\n | MOV8o32a\n | MOV16o32a\n | MOV32o32a\n | MOV16o16a\n | MOV32o16a\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t op = match op with\n | MOV8o16a | MOV8o32a -> `AL\n | MOV16o16a | MOV16o32a -> `AX\n | MOV32o16a | MOV32o32a -> `EAX\n\n let semantics = Reg_to_mem\n end\n\n module Mov_oa_amd64 = struct\n type t = MOV8o64a | MOV16o64a | MOV32o64a | MOV64o32a | MOV64o64a\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t op = match op with\n | MOV8o64a -> `AL\n | MOV16o64a -> `AX\n | MOV32o64a -> `EAX\n | MOV64o32a | MOV64o64a -> `RAX\n\n let semantics = Reg_to_mem\n end\n\n module Mov_ao_ia32 = struct\n type t =\n | MOV8ao16\n | MOV8ao32\n | MOV16ao32\n | MOV32ao32\n | MOV16ao16\n | MOV32ao16\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t op = match op with\n | MOV8ao16 | MOV8ao32 -> `AL\n | MOV16ao16 | MOV16ao32 -> `AX\n | MOV32ao16 | MOV32ao32 -> `EAX\n\n let semantics = Mem_to_reg\n end\n\n module Mov_ao_amd64 = struct\n type t = MOV8ao64 | MOV16ao64 | MOV32ao64 | MOV64ao32 | MOV64ao64\n [@@deriving bin_io, sexp, compare, enumerate]\n\n let asm_of_t op = match op with\n | MOV8ao64 -> `AL\n | MOV16ao64 -> `AX\n | MOV32ao64 -> `EAX\n | MOV64ao32 | MOV64ao64 -> `RAX\n\n let semantics = Mem_to_reg\n end\nend\n\nmodule Make(V : Version) = struct\n module IA32 = X86_backend.IA32\n module AMD64 = X86_backend.AMD64\n module Sema32 = Insn_semantics(X86_tools.IA32)\n module Sema64 = Insn_semantics(X86_tools.AMD64)\n open V\n\n let add insn back sema =\n let module L = (val insn : S) in\n let module B = (val back : X86_backend.S) in\n let module S = (val sema : Semantics) in\n List.iter L.all (fun op ->\n let f = S.lift (L.asm_of_t op) L.semantics V.allow_nil in\n let s = L.sexp_of_t op |> Sexp.to_string in\n B.register s f)\n\n let register () =\n add (module Mov_oa_ia32) (module IA32) (module Sema32);\n add (module Mov_ao_ia32) (module IA32) (module Sema32);\n add (module Mov_oa_amd64) (module AMD64) (module Sema64);\n add (module Mov_ao_amd64) (module AMD64) (module Sema64)\nend\n\nmodule T_34 = Make(Ver_34)\nmodule T = Make(Ver_common)\n\nmodule Self = Self ()\n\nlet normalize ver =\n match String.index ver '.' with\n | None -> ver\n | Some i -> match String.sub ver 0 (i + 2) with\n | x -> x\n | exception _ -> ver\n\nlet () =\n Bap_main.Extension.declare @@ fun _ctxt ->\n let ver = normalize llvm_version in\n if String.equal ver \"3.4\"\n then T_34.register ()\n else T.register ();\n Ok ()\n"} +{"text": "# This file is auto-generated by n2y\n\nmaintainers:\n - github: SilverRainZ\n email: Shengyu Zhang \n\nbuild_prefix: extra-x86_64\n\npre_build: aur_pre_build\n\npost_build: aur_post_build\n\nupdate_on:\n - source: aur\n aur: stockfish\n"} +{"text": "\nwiderface\n58--Hockey_58_Hockey_icehockey_puck_58_536.jpg\n\nwider face Database\nPASCAL VOC2007\nflickr\n-1\n\n\nyanyu\nyanyu\n\n\n1024\n654\n3\n\n0\n\nface\nUnspecified\n1\n0\n\n648\n118\n724\n220\n\n\n653.58\n156.371\n688.692\n162.754\n663.156\n184.46\n667.625\n196.589\n685.5\n197.228\n0\n0.62\n\n1\n\n\nface\nUnspecified\n1\n0\n\n538\n72\n612\n186\n\n\n550.781\n116.281\n577.375\n117.719\n555.812\n142.875\n557.969\n158.688\n579.531\n156.531\n0\n0.67\n\n1\n\n\nface\nUnspecified\n1\n0\n\n406\n126\n492\n234\n\n\n428.692\n170.621\n462.844\n167.888\n447.134\n195.21\n432.79\n200.674\n464.893\n197.259\n0\n0.7\n\n1\n\n"} +{"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n"} +{"text": "\n 1.6.0.18.00\n\n"} +{"text": "#include \"test/jemalloc_test.h\"\n\n#define MAXALIGN (((size_t)1) << 22)\n#define NITER 3\n\nTEST_BEGIN(test_basic) {\n\tvoid *ptr = mallocx(64, 0);\n\tsdallocx(ptr, 64, 0);\n}\nTEST_END\n\nTEST_BEGIN(test_alignment_and_size) {\n\tsize_t nsz, sz, alignment, total;\n\tunsigned i;\n\tvoid *ps[NITER];\n\n\tfor (i = 0; i < NITER; i++) {\n\t\tps[i] = NULL;\n\t}\n\n\tfor (alignment = 8;\n\t alignment <= MAXALIGN;\n\t alignment <<= 1) {\n\t\ttotal = 0;\n\t\tfor (sz = 1;\n\t\t sz < 3 * alignment && sz < (1U << 31);\n\t\t sz += (alignment >> (LG_SIZEOF_PTR-1)) - 1) {\n\t\t\tfor (i = 0; i < NITER; i++) {\n\t\t\t\tnsz = nallocx(sz, MALLOCX_ALIGN(alignment) |\n\t\t\t\t MALLOCX_ZERO);\n\t\t\t\tps[i] = mallocx(sz, MALLOCX_ALIGN(alignment) |\n\t\t\t\t MALLOCX_ZERO);\n\t\t\t\ttotal += nsz;\n\t\t\t\tif (total >= (MAXALIGN << 1)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < NITER; i++) {\n\t\t\t\tif (ps[i] != NULL) {\n\t\t\t\t\tsdallocx(ps[i], sz,\n\t\t\t\t\t MALLOCX_ALIGN(alignment));\n\t\t\t\t\tps[i] = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nTEST_END\n\nint\nmain(void) {\n\treturn test_no_reentrancy(\n\t test_basic,\n\t test_alignment_and_size);\n}\n"} +{"text": "from collections import OrderedDict\n\n\nclass FrozenDict(OrderedDict):\n \"\"\"\n Immutable ordered dictionary subclass\n\n Once constructed, dictionary can not be mutated without\n internal python hacks. Useful for enforcing invariants,\n but not useful for securing anything!\n\n Uses an OrderedDict as base, to preserve ordering when\n making outputs.\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n self.frozen = False\n super(FrozenDict, self).__init__(*args, **kwargs)\n self.frozen = True\n\n def __readonly__(self, func, *args, **kwargs):\n if self.frozen:\n raise ValueError(\"Can not modify FrozenDict\")\n else:\n return func(*args, **kwargs)\n\n def __setitem__(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).__setitem__, *args, **kwargs)\n\n def __delitem__(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).__delitem__, *args, **kwargs)\n\n def pop(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).pop, *args, **kwargs)\n\n def popitem(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).popitem, *args, **kwargs)\n\n def clear(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).clear, *args, **kwargs)\n\n def update(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).update, *args, **kwargs)\n\n def setdefault(self, *args, **kwargs):\n return self.__readonly__(super(FrozenDict, self).setdefault, *args, **kwargs)\n"} +{"text": "/*******************************************************************************\n * Copyright (c) 2015-2018 Skymind, Inc.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Apache License, Version 2.0 which is available at\n * https://www.apache.org/licenses/LICENSE-2.0.\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations\n * under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n ******************************************************************************/\n\npackage org.nd4j.linalg.indexing;\n\nimport lombok.extern.slf4j.Slf4j;\nimport lombok.val;\nimport org.nd4j.common.base.Preconditions;\nimport org.nd4j.linalg.api.ndarray.INDArray;\nimport org.nd4j.linalg.api.shape.Shape;\nimport org.nd4j.common.util.ArrayUtil;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * NDArray indexing\n *\n * @author Adam Gibson\n */\n@Slf4j\npublic abstract class NDArrayIndex implements INDArrayIndex {\n\n private long[] indices;\n private static NewAxis NEW_AXIS = new NewAxis();\n\n\n /**\n * Returns a point index\n * @param point the point index\n * @return the point index based\n * on the specified point\n */\n public static INDArrayIndex point(long point) {\n return new PointIndex(point);\n }\n\n /**\n * Add indexes for the given shape\n * @param shape the shape ot convert to indexes\n * @return the indexes for the given shape\n */\n public static INDArrayIndex[] indexesFor(long... shape) {\n INDArrayIndex[] ret = new INDArrayIndex[shape.length];\n for (int i = 0; i < shape.length; i++) {\n ret[i] = NDArrayIndex.point(shape[i]);\n }\n\n return ret;\n }\n\n /**\n * Compute the offset given an array of offsets.\n * The offset is computed(for both fortran an d c ordering) as:\n * sum from i to n - 1 o[i] * s[i]\n * where i is the index o is the offset and s is the stride\n * Notice the -1 at the end.\n * @param arr the array to compute the offset for\n * @param offsets the offsets for each dimension\n * @return the offset that should be used for indexing\n */\n public static long offset(INDArray arr, long... offsets) {\n return offset(arr.stride(), offsets);\n }\n\n /**\n * Compute the offset given an array of offsets.\n * The offset is computed(for both fortran an d c ordering) as:\n * sum from i to n - 1 o[i] * s[i]\n * where i is the index o is the offset and s is the stride\n * Notice the -1 at the end.\n * @param arr the array to compute the offset for\n * @param indices the offsets for each dimension\n * @return the offset that should be used for indexing\n */\n public static long offset(INDArray arr, INDArrayIndex... indices) {\n return offset(arr.stride(), Indices.offsets(arr.shape(), indices));\n }\n\n /**\n * Compute the offset given an array of offsets.\n * The offset is computed(for both fortran an d c ordering) as:\n * sum from i to n - 1 o[i] * s[i]\n * where i is the index o is the offset and s is the stride\n * Notice the -1 at the end.\n * @param strides the strides to compute the offset for\n * @param offsets the offsets for each dimension\n * @return the offset that should be used for indexing\n */\n public static long offset(long[] strides, long[] offsets) {\n int ret = 0;\n\n if (ArrayUtil.prod(offsets) == 1) {\n for (int i = 0; i < offsets.length; i++) {\n ret += offsets[i] * strides[i];\n }\n } else {\n for (int i = 0; i < offsets.length; i++) {\n ret += offsets[i] * strides[i];\n }\n\n }\n\n return ret;\n }\n\n public static long offset(int[] strides, long[] offsets) {\n int ret = 0;\n\n if (ArrayUtil.prodLong(offsets) == 1) {\n for (int i = 0; i < offsets.length; i++) {\n ret += offsets[i] * strides[i];\n }\n } else {\n for (int i = 0; i < offsets.length; i++) {\n ret += offsets[i] * strides[i];\n }\n\n }\n\n return ret;\n }\n\n\n /**\n * Repeat a copy of copy n times\n * @param copy the ndarray index to copy\n * @param n the number of times to copy\n * @return an array of length n containing copies of\n * the given ndarray index\n */\n public static INDArrayIndex[] nTimes(INDArrayIndex copy, int n) {\n INDArrayIndex[] ret = new INDArrayIndex[n];\n for (int i = 0; i < n; i++) {\n ret[i] = copy;\n }\n\n return ret;\n }\n\n /**\n * NDArrayIndexing based on the given\n * indexes\n * @param indices\n */\n public NDArrayIndex(long... indices) {\n this.indices = indices;\n }\n\n /**\n * Represents collecting all elements\n *\n * @return an ndarray index\n * meaning collect\n * all elements\n */\n public static INDArrayIndex all() {\n return new NDArrayIndexAll();\n }\n\n /**\n * Returns an instance of {@link SpecifiedIndex}.\n * Note that SpecifiedIndex works differently than the other indexing options, in that it always returns a copy\n * of the (subset of) the underlying array, for get operations. This means that INDArray.get(..., indices(x,y,z), ...)\n * will be a copy of the relevant subset of the array.\n * @param indices Indices to get\n */\n public static INDArrayIndex indices(long... indices){\n return new SpecifiedIndex(indices);\n }\n\n\n /**\n * Represents adding a new dimension\n * @return the indexing for\n * adding a new dimension\n */\n public static INDArrayIndex newAxis() {\n return NEW_AXIS;\n }\n\n /**\n * Given an all index and\n * the intended indexes, return an\n * index array containing a combination of all elements\n * for slicing and overriding particular indexes where necessary\n * @param arr the array to resolve indexes for\n * @param intendedIndexes the indexes specified by the user\n * @return the resolved indexes (containing all where nothing is specified, and the intended index\n * for a particular dimension otherwise)\n */\n public static INDArrayIndex[] resolve(INDArray arr, INDArrayIndex... intendedIndexes) {\n return resolve(NDArrayIndex.allFor(arr), intendedIndexes);\n }\n\n /**\n * Number of point indexes\n * @param indexes the indexes\n * to count for points\n * @return the number of point indexes\n * in the array\n */\n public static int numPoints(INDArrayIndex... indexes) {\n int ret = 0;\n for (int i = 0; i < indexes.length; i++)\n if (indexes[i] instanceof PointIndex)\n ret++;\n return ret;\n }\n\n /**\n * Given an all index and\n * the intended indexes, return an\n * index array containing a combination of all elements\n * for slicing and overriding particular indexes where necessary\n * @param shapeInfo the index containing all elements\n * @param intendedIndexes the indexes specified by the user\n * @return the resolved indexes (containing all where nothing is specified, and the intended index\n * for a particular dimension otherwise)\n */\n public static INDArrayIndex[] resolveLong(long[] shapeInfo, INDArrayIndex... intendedIndexes) {\n int numSpecified = 0;\n for (int i = 0; i < intendedIndexes.length; i++) {\n if (intendedIndexes[i] instanceof SpecifiedIndex)\n numSpecified++;\n }\n\n if (numSpecified > 0) {\n val shape = Shape.shapeOf(shapeInfo);\n INDArrayIndex[] ret = new INDArrayIndex[intendedIndexes.length];\n for (int i = 0; i < intendedIndexes.length; i++) {\n if (intendedIndexes[i] instanceof SpecifiedIndex)\n ret[i] = intendedIndexes[i];\n else {\n if (intendedIndexes[i] instanceof NDArrayIndexAll) {\n SpecifiedIndex specifiedIndex = new SpecifiedIndex(ArrayUtil.range(0L, shape[i]));\n ret[i] = specifiedIndex;\n } else if (intendedIndexes[i] instanceof IntervalIndex) {\n IntervalIndex intervalIndex = (IntervalIndex) intendedIndexes[i];\n ret[i] = new SpecifiedIndex(ArrayUtil.range(intervalIndex.begin, intervalIndex.end(),\n intervalIndex.stride()));\n } else if(intendedIndexes[i] instanceof PointIndex){\n ret[i] = intendedIndexes[i];\n }\n }\n }\n\n return ret;\n }\n\n\n /**\n * If it's a vector and index asking\n * for a scalar just return the array\n */\n int rank = Shape.rank(shapeInfo);\n val shape = Shape.shapeOf(shapeInfo);\n if (intendedIndexes.length >= rank || Shape.isVector(shapeInfo) && intendedIndexes.length == 1) {\n if(Shape.rank(shapeInfo) == 1){\n //1D edge case, with 1 index\n return intendedIndexes;\n }\n\n if (Shape.isRowVectorShape(shapeInfo) && intendedIndexes.length == 1) {\n INDArrayIndex[] ret = new INDArrayIndex[2];\n ret[0] = NDArrayIndex.point(0);\n long size;\n if (1 == shape[0] && rank == 2)\n size = shape[1];\n else\n size = shape[0];\n ret[1] = validate(size, intendedIndexes[0]);\n return ret;\n }\n List retList = new ArrayList<>(intendedIndexes.length);\n for (int i = 0; i < intendedIndexes.length; i++) {\n if (i < rank)\n retList.add(validate(shape[i], intendedIndexes[i]));\n else\n retList.add(intendedIndexes[i]);\n }\n return retList.toArray(new INDArrayIndex[retList.size()]);\n }\n\n List retList = new ArrayList<>(intendedIndexes.length + 1);\n int numNewAxes = 0;\n\n if (Shape.isMatrix(shape) && intendedIndexes.length == 1) {\n retList.add(validate(shape[0], intendedIndexes[0]));\n retList.add(NDArrayIndex.all());\n } else {\n for (int i = 0; i < intendedIndexes.length; i++) {\n retList.add(validate(shape[i], intendedIndexes[i]));\n if (intendedIndexes[i] instanceof NewAxis)\n numNewAxes++;\n }\n }\n\n int length = rank + numNewAxes;\n //fill the rest with all\n while (retList.size() < length)\n retList.add(NDArrayIndex.all());\n\n return retList.toArray(new INDArrayIndex[retList.size()]);\n }\n\n /**\n * Given an all index and\n * the intended indexes, return an\n * index array containing a combination of all elements\n * for slicing and overriding particular indexes where necessary\n * @param shape the index containing all elements\n * @param intendedIndexes the indexes specified by the user\n * @return the resolved indexes (containing all where nothing is specified, and the intended index\n * for a particular dimension otherwise)\n */\n public static INDArrayIndex[] resolve(int[] shape, INDArrayIndex... intendedIndexes) {\n return resolve(ArrayUtil.toLongArray(shape), intendedIndexes);\n }\n\n public static INDArrayIndex[] resolve(long[] shape, INDArrayIndex... intendedIndexes) {\n /**\n * If it's a vector and index asking for a scalar just return the array\n */\n if (intendedIndexes.length >= shape.length || Shape.isVector(shape) && intendedIndexes.length == 1) {\n if (Shape.isRowVectorShape(shape) && intendedIndexes.length == 1) {\n INDArrayIndex[] ret = new INDArrayIndex[2];\n ret[0] = NDArrayIndex.point(0);\n long size;\n if (1 == shape[0] && shape.length == 2)\n size = shape[1];\n else\n size = shape[0];\n ret[1] = validate(size, intendedIndexes[0]);\n return ret;\n }\n List retList = new ArrayList<>(intendedIndexes.length);\n for (int i = 0; i < intendedIndexes.length; i++) {\n if (i < shape.length)\n retList.add(validate(shape[i], intendedIndexes[i]));\n else\n retList.add(intendedIndexes[i]);\n }\n return retList.toArray(new INDArrayIndex[retList.size()]);\n }\n\n List retList = new ArrayList<>(intendedIndexes.length + 1);\n int numNewAxes = 0;\n\n if (Shape.isMatrix(shape) && intendedIndexes.length == 1) {\n retList.add(validate(shape[0], intendedIndexes[0]));\n retList.add(NDArrayIndex.all());\n } else {\n for (int i = 0; i < intendedIndexes.length; i++) {\n retList.add(validate(shape[i], intendedIndexes[i]));\n if (intendedIndexes[i] instanceof NewAxis)\n numNewAxes++;\n }\n }\n\n int length = shape.length + numNewAxes;\n //fill the rest with all\n while (retList.size() < length)\n retList.add(NDArrayIndex.all());\n\n\n\n return retList.toArray(new INDArrayIndex[retList.size()]);\n }\n\n protected static INDArrayIndex validate(long size, INDArrayIndex index) {\n if ((index instanceof IntervalIndex || index instanceof PointIndex) && size <= index.offset())\n throw new IllegalArgumentException(\"NDArrayIndex is out of range. Beginning index: \" + index.offset()\n + \" must be less than its size: \" + size);\n if (index instanceof IntervalIndex && index.end() > size)\n throw new IllegalArgumentException(\"NDArrayIndex is out of range. End index: \" + index.end()\n + \" must be less than its size: \" + size);\n if (index instanceof IntervalIndex && size < index.end()) {\n long begin = ((IntervalIndex) index).begin;\n index = NDArrayIndex.interval(begin, index.stride(), size);\n }\n return index;\n }\n\n\n /**\n * Given an all index and\n * the intended indexes, return an\n * index array containing a combination of all elements\n * for slicing and overriding particular indexes where necessary\n * @param allIndex the index containing all elements\n * @param intendedIndexes the indexes specified by the user\n * @return the resolved indexes (containing all where nothing is specified, and the intended index\n * for a particular dimension otherwise)\n */\n public static INDArrayIndex[] resolve(INDArrayIndex[] allIndex, INDArrayIndex... intendedIndexes) {\n\n int numNewAxes = numNewAxis(intendedIndexes);\n INDArrayIndex[] all = new INDArrayIndex[allIndex.length + numNewAxes];\n Arrays.fill(all, NDArrayIndex.all());\n for (int i = 0; i < allIndex.length; i++) {\n //collapse single length indexes in to point indexes\n if (i >= intendedIndexes.length)\n break;\n\n if (intendedIndexes[i] instanceof NDArrayIndex) {\n NDArrayIndex idx = (NDArrayIndex) intendedIndexes[i];\n if (idx.indices.length == 1)\n intendedIndexes[i] = new PointIndex(idx.indices[0]);\n }\n all[i] = intendedIndexes[i];\n }\n\n return all;\n }\n\n /**\n * Given an array of indexes\n * return the number of new axis elements\n * in teh array\n * @param axes the indexes to get the number\n * of new axes for\n * @return the number of new axis elements in the given array\n */\n public static int numNewAxis(INDArrayIndex... axes) {\n int ret = 0;\n for (INDArrayIndex index : axes)\n if (index instanceof NewAxis)\n ret++;\n return ret;\n }\n\n\n /**\n * Generate an all index\n * equal to the rank of the given array\n * @param arr the array to generate the all index for\n * @return an ndarray index array containing of length\n * arr.rank() containing all elements\n */\n public static INDArrayIndex[] allFor(INDArray arr) {\n INDArrayIndex[] ret = new INDArrayIndex[arr.rank()];\n for (int i = 0; i < ret.length; i++)\n ret[i] = NDArrayIndex.all();\n\n return ret;\n }\n\n /**\n * Creates an index covering the given shape\n * (for each dimension 0,shape[i])\n * @param shape the shape to cover\n * @return the ndarray indexes to cover\n */\n public static INDArrayIndex[] createCoveringShape(int[] shape) {\n INDArrayIndex[] ret = new INDArrayIndex[shape.length];\n for (int i = 0; i < ret.length; i++) {\n ret[i] = NDArrayIndex.interval(0, shape[i]);\n }\n return ret;\n }\n\n public static INDArrayIndex[] createCoveringShape(long[] shape) {\n INDArrayIndex[] ret = new INDArrayIndex[shape.length];\n for (int i = 0; i < ret.length; i++) {\n ret[i] = NDArrayIndex.interval(0, shape[i]);\n }\n return ret;\n }\n\n\n /**\n * Create a range based on the given indexes.\n * This is similar to create covering shape in that it approximates\n * the length of each dimension (ignoring elements) and\n * reproduces an index of the same dimension and length.\n *\n * @param indexes the indexes to create the range for\n * @return the index ranges.\n */\n public static INDArrayIndex[] rangeOfLength(INDArrayIndex[] indexes) {\n INDArrayIndex[] indexesRet = new INDArrayIndex[indexes.length];\n for (int i = 0; i < indexes.length; i++)\n indexesRet[i] = NDArrayIndex.interval(0, indexes[i].length());\n return indexesRet;\n }\n\n /**\n * Generates an interval from begin (inclusive) to end (exclusive)\n *\n * @param begin the begin\n * @param stride the stride at which to increment\n * @param end the end index\n * @param max the max length for this domain\n * @return the interval\n */\n public static INDArrayIndex interval(long begin, long stride, long end,long max) {\n if(begin < 0) {\n begin += max;\n }\n\n if(end < 0) {\n end += max;\n }\n\n if (Math.abs(begin - end) < 1)\n end++;\n if (stride > 1 && Math.abs(begin - end) == 1) {\n end *= stride;\n }\n return interval(begin, stride, end, false);\n }\n\n /**\n * Generates an interval from begin (inclusive) to end (exclusive)\n *\n * @param begin the begin\n * @param stride the stride at which to increment\n * @param end the end index\n * @return the interval\n */\n public static INDArrayIndex interval(long begin, long stride, long end) {\n if (Math.abs(begin - end) < 1)\n end++;\n if (stride > 1 && Math.abs(begin - end) == 1) {\n end *= stride;\n }\n return interval(begin, stride, end, false);\n }\n\n /**\n * Generates an interval from begin (inclusive) to end (exclusive)\n *\n * @param begin the begin\n * @param stride the stride at which to increment\n * @param end the end index\n * @param inclusive whether the end should be inclusive or not\n * @return the interval\n */\n public static INDArrayIndex interval(int begin, int stride, int end, boolean inclusive) {\n Preconditions.checkArgument(begin <= end, \"Beginning index (%s) in range must be less than or equal to end (%s)\", begin, end);\n INDArrayIndex index = new IntervalIndex(inclusive, stride);\n index.init(begin, end);\n return index;\n }\n\n\n\n public static INDArrayIndex interval(long begin, long stride, long end,long max, boolean inclusive) {\n Preconditions.checkArgument(begin <= end, \"Beginning index (%s) in range must be less than or equal to end (%s)\", begin, end);\n INDArrayIndex index = new IntervalIndex(inclusive, stride);\n index.init(begin, end);\n return index;\n }\n\n\n public static INDArrayIndex interval(long begin, long stride, long end, boolean inclusive) {\n Preconditions.checkArgument(begin <= end, \"Beginning index (%s) in range must be less than or equal to end (%s)\", begin, end);\n INDArrayIndex index = new IntervalIndex(inclusive, stride);\n index.init(begin, end);\n return index;\n }\n\n\n /**\n * Generates an interval from begin (inclusive) to end (exclusive)\n *\n * @param begin the begin\n * @param end the end index\n * @return the interval\n */\n public static INDArrayIndex interval(int begin, int end) {\n return interval(begin, 1, end, false);\n }\n\n public static INDArrayIndex interval(long begin, long end) {\n return interval(begin, 1, end, false);\n }\n\n /**\n * Generates an interval from begin (inclusive) to end (exclusive)\n *\n * @param begin the begin\n * @param end the end index\n * @param inclusive whether the end should be inclusive or not\n * @return the interval\n */\n public static INDArrayIndex interval(long begin, long end, boolean inclusive) {\n return interval(begin, 1, end, inclusive);\n }\n\n @Override\n public long end() {\n if (indices != null && indices.length > 0)\n return indices[indices.length - 1];\n return 0;\n }\n\n @Override\n public long offset() {\n if (indices.length < 1)\n return 0;\n return indices[0];\n }\n\n /**\n * Returns the length of the indices\n *\n * @return the length of the range\n */\n @Override\n public long length() {\n return indices.length;\n }\n\n @Override\n public long stride() {\n return 1;\n }\n\n @Override\n public void reverse() {\n ArrayUtil.reverse(indices);\n }\n\n @Override\n public String toString() {\n return \"NDArrayIndex{\" + \"indices=\" + Arrays.toString(indices) + '}';\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (!(o instanceof INDArrayIndex))\n return false;\n\n NDArrayIndex that = (NDArrayIndex) o;\n\n if (!Arrays.equals(indices, that.indices))\n return false;\n return true;\n }\n\n\n @Override\n public int hashCode() {\n return Arrays.hashCode(indices);\n }\n\n @Override\n public void init(INDArray arr, long begin, int dimension) {\n\n }\n\n @Override\n public void init(INDArray arr, int dimension) {\n\n }\n\n @Override\n public void init(long begin, long end, long max) {\n\n }\n\n @Override\n public void init(long begin, long end) {\n\n }\n\n}\n"} +{"text": "/* ---------------------------------------------------------------------- \n* Copyright (C) 2010-2014 ARM Limited. All rights reserved. \n* \n* $Date: 19. March 2015 \n* $Revision: \tV.1.4.5\n* \n* Project: \t CMSIS DSP Library \n* Title:\t arm_biquad_cascade_df2T_f32.c \n* \n* Description: Processing function for the floating-point transposed \n* direct form II Biquad cascade filter. \n* \n* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0\n* \n* Redistribution and use in source and binary forms, with or without \n* modification, are permitted provided that the following conditions\n* are met:\n* - Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n* - Redistributions in binary form must reproduce the above copyright\n* notice, this list of conditions and the following disclaimer in\n* the documentation and/or other materials provided with the \n* distribution.\n* - Neither the name of ARM LIMITED nor the names of its contributors\n* may be used to endorse or promote products derived from this\n* software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \n* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n* POSSIBILITY OF SUCH DAMAGE. \n* -------------------------------------------------------------------- */\n\n#include \"arm_math.h\"\n\n/** \n* @ingroup groupFilters \n*/\n\n/** \n* @defgroup BiquadCascadeDF2T Biquad Cascade IIR Filters Using a Direct Form II Transposed Structure \n* \n* This set of functions implements arbitrary order recursive (IIR) filters using a transposed direct form II structure. \n* The filters are implemented as a cascade of second order Biquad sections. \n* These functions provide a slight memory savings as compared to the direct form I Biquad filter functions. \n* Only floating-point data is supported. \n* \n* This function operate on blocks of input and output data and each call to the function \n* processes blockSize samples through the filter. \n* pSrc points to the array of input data and \n* pDst points to the array of output data. \n* Both arrays contain blockSize values. \n* \n* \\par Algorithm \n* Each Biquad stage implements a second order filter using the difference equation: \n*
       \n*    y[n] = b0 * x[n] + d1       \n*    d1 = b1 * x[n] + a1 * y[n] + d2       \n*    d2 = b2 * x[n] + a2 * y[n]       \n* 
\n* where d1 and d2 represent the two state values. \n* \n* \\par \n* A Biquad filter using a transposed Direct Form II structure is shown below. \n* \\image html BiquadDF2Transposed.gif \"Single transposed Direct Form II Biquad\" \n* Coefficients b0, b1, and b2 multiply the input signal x[n] and are referred to as the feedforward coefficients. \n* Coefficients a1 and a2 multiply the output signal y[n] and are referred to as the feedback coefficients. \n* Pay careful attention to the sign of the feedback coefficients. \n* Some design tools flip the sign of the feedback coefficients: \n*
       \n*    y[n] = b0 * x[n] + d1;       \n*    d1 = b1 * x[n] - a1 * y[n] + d2;       \n*    d2 = b2 * x[n] - a2 * y[n];       \n* 
\n* In this case the feedback coefficients a1 and a2 must be negated when used with the CMSIS DSP Library. \n* \n* \\par \n* Higher order filters are realized as a cascade of second order sections. \n* numStages refers to the number of second order stages used. \n* For example, an 8th order filter would be realized with numStages=4 second order stages. \n* A 9th order filter would be realized with numStages=5 second order stages with the \n* coefficients for one of the stages configured as a first order filter (b2=0 and a2=0). \n* \n* \\par \n* pState points to the state variable array. \n* Each Biquad stage has 2 state variables d1 and d2. \n* The state variables are arranged in the pState array as: \n*
       \n*     {d11, d12, d21, d22, ...}       \n* 
\n* where d1x refers to the state variables for the first Biquad and \n* d2x refers to the state variables for the second Biquad. \n* The state array has a total length of 2*numStages values. \n* The state variables are updated after each block of data is processed; the coefficients are untouched. \n* \n* \\par \n* The CMSIS library contains Biquad filters in both Direct Form I and transposed Direct Form II. \n* The advantage of the Direct Form I structure is that it is numerically more robust for fixed-point data types. \n* That is why the Direct Form I structure supports Q15 and Q31 data types. \n* The transposed Direct Form II structure, on the other hand, requires a wide dynamic range for the state variables d1 and d2. \n* Because of this, the CMSIS library only has a floating-point version of the Direct Form II Biquad. \n* The advantage of the Direct Form II Biquad is that it requires half the number of state variables, 2 rather than 4, per Biquad stage. \n* \n* \\par Instance Structure \n* The coefficients and state variables for a filter are stored together in an instance data structure. \n* A separate instance structure must be defined for each filter. \n* Coefficient arrays may be shared among several instances while state variable arrays cannot be shared. \n* \n* \\par Init Functions \n* There is also an associated initialization function. \n* The initialization function performs following operations: \n* - Sets the values of the internal structure fields. \n* - Zeros out the values in the state buffer. \n* To do this manually without calling the init function, assign the follow subfields of the instance structure:\n* numStages, pCoeffs, pState. Also set all of the values in pState to zero. \n* \n* \\par \n* Use of the initialization function is optional. \n* However, if the initialization function is used, then the instance structure cannot be placed into a const data section. \n* To place an instance structure into a const data section, the instance structure must be manually initialized. \n* Set the values in the state buffer to zeros before static initialization. \n* For example, to statically initialize the instance structure use \n*
       \n*     arm_biquad_cascade_df2T_instance_f32 S1 = {numStages, pState, pCoeffs};       \n* 
\n* where numStages is the number of Biquad stages in the filter; pState is the address of the state buffer. \n* pCoeffs is the address of the coefficient buffer; \n* \n*/\n\n/** \n* @addtogroup BiquadCascadeDF2T \n* @{ \n*/\n\n/** \n* @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. \n* @param[in] *S points to an instance of the filter data structure. \n* @param[in] *pSrc points to the block of input data. \n* @param[out] *pDst points to the block of output data \n* @param[in] blockSize number of samples to process. \n* @return none. \n*/\n\n\nLOW_OPTIMIZATION_ENTER\nvoid arm_biquad_cascade_df2T_f32(\nconst arm_biquad_cascade_df2T_instance_f32 * S,\nfloat32_t * pSrc,\nfloat32_t * pDst,\nuint32_t blockSize)\n{\n\n float32_t *pIn = pSrc; /* source pointer */\n float32_t *pOut = pDst; /* destination pointer */\n float32_t *pState = S->pState; /* State pointer */\n float32_t *pCoeffs = S->pCoeffs; /* coefficient pointer */\n float32_t acc1; /* accumulator */\n float32_t b0, b1, b2, a1, a2; /* Filter coefficients */\n float32_t Xn1; /* temporary input */\n float32_t d1, d2; /* state variables */\n uint32_t sample, stage = S->numStages; /* loop counters */\n\n#if defined(ARM_MATH_CM7)\n\t\n float32_t Xn2, Xn3, Xn4, Xn5, Xn6, Xn7, Xn8; /* Input State variables */\n float32_t Xn9, Xn10, Xn11, Xn12, Xn13, Xn14, Xn15, Xn16;\n float32_t acc2, acc3, acc4, acc5, acc6, acc7; /* Simulates the accumulator */\n float32_t acc8, acc9, acc10, acc11, acc12, acc13, acc14, acc15, acc16;\n\n do\n {\n /* Reading the coefficients */ \n b0 = pCoeffs[0]; \n b1 = pCoeffs[1]; \n b2 = pCoeffs[2]; \n a1 = pCoeffs[3]; \n /* Apply loop unrolling and compute 16 output values simultaneously. */ \n sample = blockSize >> 4u; \n a2 = pCoeffs[4]; \n\n /*Reading the state values */ \n d1 = pState[0]; \n d2 = pState[1]; \n\n pCoeffs += 5u;\n\n \n /* First part of the processing with loop unrolling. Compute 16 outputs at a time. \n ** a second loop below computes the remaining 1 to 15 samples. */\n while(sample > 0u) {\n\n /* y[n] = b0 * x[n] + d1 */\n /* d1 = b1 * x[n] + a1 * y[n] + d2 */\n /* d2 = b2 * x[n] + a2 * y[n] */\n\n /* Read the first 2 inputs. 2 cycles */\n Xn1 = pIn[0 ];\n Xn2 = pIn[1 ];\n\n /* Sample 1. 5 cycles */\n Xn3 = pIn[2 ];\n acc1 = b0 * Xn1 + d1;\n \n Xn4 = pIn[3 ];\n d1 = b1 * Xn1 + d2;\n \n Xn5 = pIn[4 ];\n d2 = b2 * Xn1;\n \n Xn6 = pIn[5 ];\n d1 += a1 * acc1;\n \n Xn7 = pIn[6 ];\n d2 += a2 * acc1;\n\n /* Sample 2. 5 cycles */\n Xn8 = pIn[7 ];\n acc2 = b0 * Xn2 + d1;\n \n Xn9 = pIn[8 ];\n d1 = b1 * Xn2 + d2;\n \n Xn10 = pIn[9 ];\n d2 = b2 * Xn2;\n \n Xn11 = pIn[10];\n d1 += a1 * acc2;\n \n Xn12 = pIn[11];\n d2 += a2 * acc2;\n\n /* Sample 3. 5 cycles */\n Xn13 = pIn[12];\n acc3 = b0 * Xn3 + d1;\n \n Xn14 = pIn[13];\n d1 = b1 * Xn3 + d2;\n \n Xn15 = pIn[14];\n d2 = b2 * Xn3;\n \n Xn16 = pIn[15];\n d1 += a1 * acc3;\n \n pIn += 16;\n d2 += a2 * acc3;\n\n /* Sample 4. 5 cycles */\n acc4 = b0 * Xn4 + d1;\n d1 = b1 * Xn4 + d2;\n d2 = b2 * Xn4;\n d1 += a1 * acc4;\n d2 += a2 * acc4;\n\n /* Sample 5. 5 cycles */\n acc5 = b0 * Xn5 + d1;\n d1 = b1 * Xn5 + d2;\n d2 = b2 * Xn5;\n d1 += a1 * acc5;\n d2 += a2 * acc5;\n\n /* Sample 6. 5 cycles */\n acc6 = b0 * Xn6 + d1;\n d1 = b1 * Xn6 + d2;\n d2 = b2 * Xn6;\n d1 += a1 * acc6;\n d2 += a2 * acc6;\n\n /* Sample 7. 5 cycles */\n acc7 = b0 * Xn7 + d1;\n d1 = b1 * Xn7 + d2;\n d2 = b2 * Xn7;\n d1 += a1 * acc7;\n d2 += a2 * acc7;\n\n /* Sample 8. 5 cycles */\n acc8 = b0 * Xn8 + d1;\n d1 = b1 * Xn8 + d2;\n d2 = b2 * Xn8;\n d1 += a1 * acc8;\n d2 += a2 * acc8;\n\n /* Sample 9. 5 cycles */\n acc9 = b0 * Xn9 + d1;\n d1 = b1 * Xn9 + d2;\n d2 = b2 * Xn9;\n d1 += a1 * acc9;\n d2 += a2 * acc9;\n\n /* Sample 10. 5 cycles */\n acc10 = b0 * Xn10 + d1;\n d1 = b1 * Xn10 + d2;\n d2 = b2 * Xn10;\n d1 += a1 * acc10;\n d2 += a2 * acc10;\n\n /* Sample 11. 5 cycles */\n acc11 = b0 * Xn11 + d1;\n d1 = b1 * Xn11 + d2;\n d2 = b2 * Xn11;\n d1 += a1 * acc11;\n d2 += a2 * acc11;\n\n /* Sample 12. 5 cycles */\n acc12 = b0 * Xn12 + d1;\n d1 = b1 * Xn12 + d2;\n d2 = b2 * Xn12;\n d1 += a1 * acc12;\n d2 += a2 * acc12;\n\n /* Sample 13. 5 cycles */\n acc13 = b0 * Xn13 + d1; \n d1 = b1 * Xn13 + d2; \n d2 = b2 * Xn13;\n \n pOut[0 ] = acc1 ;\n d1 += a1 * acc13;\n \n pOut[1 ] = acc2 ;\t\n d2 += a2 * acc13;\n\n /* Sample 14. 5 cycles */\n pOut[2 ] = acc3 ;\t\n acc14 = b0 * Xn14 + d1;\n \n pOut[3 ] = acc4 ;\n d1 = b1 * Xn14 + d2;\n \n pOut[4 ] = acc5 ; \n d2 = b2 * Xn14;\n \n pOut[5 ] = acc6 ;\t \n d1 += a1 * acc14;\n \n pOut[6 ] = acc7 ;\t\n d2 += a2 * acc14;\n\n /* Sample 15. 5 cycles */\n pOut[7 ] = acc8 ;\n pOut[8 ] = acc9 ; \n acc15 = b0 * Xn15 + d1;\n \n pOut[9 ] = acc10;\t\n d1 = b1 * Xn15 + d2;\n \n pOut[10] = acc11;\t\n d2 = b2 * Xn15;\n \n pOut[11] = acc12;\n d1 += a1 * acc15;\n \n pOut[12] = acc13;\n d2 += a2 * acc15;\n\n /* Sample 16. 5 cycles */\n pOut[13] = acc14;\t\n acc16 = b0 * Xn16 + d1;\n \n pOut[14] = acc15;\t\n d1 = b1 * Xn16 + d2;\n \n pOut[15] = acc16;\n d2 = b2 * Xn16;\n \n sample--;\t \n d1 += a1 * acc16;\n \n pOut += 16;\n d2 += a2 * acc16;\n }\n\n sample = blockSize & 0xFu;\n while(sample > 0u) {\n Xn1 = *pIn; \n acc1 = b0 * Xn1 + d1;\n \n pIn++;\n d1 = b1 * Xn1 + d2;\n \n *pOut = acc1; \n d2 = b2 * Xn1;\n \n pOut++;\n d1 += a1 * acc1;\n \n sample--;\t\n d2 += a2 * acc1; \n }\n\n /* Store the updated state variables back into the state array */ \n pState[0] = d1; \n /* The current stage input is given as the output to the next stage */ \n pIn = pDst; \n \n pState[1] = d2; \n /* decrement the loop counter */ \n stage--; \n\n pState += 2u;\n\n /*Reset the output working pointer */ \n pOut = pDst; \n\n } while(stage > 0u);\n\t\n#elif defined(ARM_MATH_CM0_FAMILY)\n\n /* Run the below code for Cortex-M0 */\n\n do\n {\n /* Reading the coefficients */\n b0 = *pCoeffs++;\n b1 = *pCoeffs++;\n b2 = *pCoeffs++;\n a1 = *pCoeffs++;\n a2 = *pCoeffs++;\n\n /*Reading the state values */\n d1 = pState[0];\n d2 = pState[1];\n\n\n sample = blockSize;\n\n while(sample > 0u)\n {\n /* Read the input */\n Xn1 = *pIn++;\n\n /* y[n] = b0 * x[n] + d1 */\n acc1 = (b0 * Xn1) + d1;\n\n /* Store the result in the accumulator in the destination buffer. */\n *pOut++ = acc1;\n\n /* Every time after the output is computed state should be updated. */\n /* d1 = b1 * x[n] + a1 * y[n] + d2 */\n d1 = ((b1 * Xn1) + (a1 * acc1)) + d2;\n\n /* d2 = b2 * x[n] + a2 * y[n] */\n d2 = (b2 * Xn1) + (a2 * acc1);\n\n /* decrement the loop counter */\n sample--;\n }\n\n /* Store the updated state variables back into the state array */\n *pState++ = d1;\n *pState++ = d2;\n\n /* The current stage input is given as the output to the next stage */\n pIn = pDst;\n\n /*Reset the output working pointer */\n pOut = pDst;\n\n /* decrement the loop counter */\n stage--;\n\n } while(stage > 0u);\n\t \n#else\n\n float32_t Xn2, Xn3, Xn4; \t /* Input State variables */\n float32_t acc2, acc3, acc4; \t\t /* accumulator */\n\n\n float32_t p0, p1, p2, p3, p4, A1;\n\n /* Run the below code for Cortex-M4 and Cortex-M3 */\n do\n {\n /* Reading the coefficients */ \n b0 = *pCoeffs++;\n b1 = *pCoeffs++;\n b2 = *pCoeffs++;\n a1 = *pCoeffs++;\n a2 = *pCoeffs++;\n \n\n /*Reading the state values */\n d1 = pState[0];\n d2 = pState[1];\n\n /* Apply loop unrolling and compute 4 output values simultaneously. */\n sample = blockSize >> 2u;\n\n /* First part of the processing with loop unrolling. Compute 4 outputs at a time. \n ** a second loop below computes the remaining 1 to 3 samples. */\n while(sample > 0u) {\n\n /* y[n] = b0 * x[n] + d1 */\n /* d1 = b1 * x[n] + a1 * y[n] + d2 */\n /* d2 = b2 * x[n] + a2 * y[n] */\n\n /* Read the four inputs */\n Xn1 = pIn[0];\n Xn2 = pIn[1];\n Xn3 = pIn[2];\n Xn4 = pIn[3];\n pIn += 4; \n\n p0 = b0 * Xn1; \n p1 = b1 * Xn1;\n acc1 = p0 + d1;\n p0 = b0 * Xn2; \n p3 = a1 * acc1;\n p2 = b2 * Xn1;\n A1 = p1 + p3;\n p4 = a2 * acc1;\n d1 = A1 + d2;\n d2 = p2 + p4;\n\n p1 = b1 * Xn2;\n acc2 = p0 + d1;\n p0 = b0 * Xn3;\t \n p3 = a1 * acc2; \n p2 = b2 * Xn2; \n A1 = p1 + p3;\n p4 = a2 * acc2;\n d1 = A1 + d2;\n d2 = p2 + p4;\n\n p1 = b1 * Xn3;\n acc3 = p0 + d1;\n p0 = b0 * Xn4;\t\n p3 = a1 * acc3;\n p2 = b2 * Xn3;\n A1 = p1 + p3;\n p4 = a2 * acc3;\n d1 = A1 + d2;\n d2 = p2 + p4;\n\n acc4 = p0 + d1;\n p1 = b1 * Xn4;\n p3 = a1 * acc4;\n p2 = b2 * Xn4;\n A1 = p1 + p3;\n p4 = a2 * acc4;\n d1 = A1 + d2;\n d2 = p2 + p4;\n\n pOut[0] = acc1;\t\n pOut[1] = acc2;\t\n pOut[2] = acc3;\t\n pOut[3] = acc4;\n\t\t pOut += 4;\n\t\t\t\t \n sample--;\t \n }\n\n sample = blockSize & 0x3u;\n while(sample > 0u) {\n Xn1 = *pIn++;\n\n p0 = b0 * Xn1; \n p1 = b1 * Xn1;\n acc1 = p0 + d1;\n p3 = a1 * acc1;\n p2 = b2 * Xn1;\n A1 = p1 + p3;\n p4 = a2 * acc1;\n d1 = A1 + d2;\n d2 = p2 + p4;\n\t\n *pOut++ = acc1;\n \n sample--;\t \n }\n\n /* Store the updated state variables back into the state array */\n *pState++ = d1;\n *pState++ = d2;\n\n /* The current stage input is given as the output to the next stage */\n pIn = pDst;\n\n /*Reset the output working pointer */\n pOut = pDst;\n\n /* decrement the loop counter */\n stage--;\n\n } while(stage > 0u);\n\n#endif \n\n}\nLOW_OPTIMIZATION_EXIT\n\n/** \n * @} end of BiquadCascadeDF2T group \n */\n"} +{"text": "// automatically generated by the FlatBuffers compiler, do not modify\n\npackage com.nvidia.spark.rapids.format;\n\nimport java.nio.*;\nimport java.lang.*;\nimport java.util.*;\nimport com.google.flatbuffers.*;\n\n@SuppressWarnings(\"unused\")\n/**\n * Descriptor for a buffer within another uncompressed buffer.\n */\npublic final class SubBufferMeta extends Struct {\n public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }\n public SubBufferMeta __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }\n\n /**\n * byte-offset from the start of the buffer where this buffer begins\n */\n public long offset() { return bb.getLong(bb_pos + 0); }\n public void mutateOffset(long offset) { bb.putLong(bb_pos + 0, offset); }\n /**\n * size in bytes of the buffer\n */\n public long length() { return bb.getLong(bb_pos + 8); }\n public void mutateLength(long length) { bb.putLong(bb_pos + 8, length); }\n\n public static int createSubBufferMeta(FlatBufferBuilder builder, long offset, long length) {\n builder.prep(8, 16);\n builder.putLong(length);\n builder.putLong(offset);\n return builder.offset();\n }\n}\n\n"} +{"text": "#!/usr/bin/python\n\nfrom jinja2 import Environment, FileSystemLoader\nimport traceback, cgi, time, sys, os, shutil\nfrom docs import gen_docs\n\nglfx_file = '../glfx.js'\nsource_dir = '../src/'\ntemplate_dir = './templates/'\noutput_dir = './glfx.js/'\n\nhtml = '

Error rendering %s

An error was encountered while rendering the file %s.  Here is the stack trace:

%s
'\n\ndef do(files):\n if not os.path.exists(output_dir):\n os.makedirs(output_dir)\n shutil.copy(glfx_file, os.path.join(output_dir, os.path.basename(glfx_file)))\n docs = gen_docs()\n for file in files:\n file = file.replace(template_dir, '')\n if file == 'base.html' or not file.endswith('.html'):\n continue\n new_file = output_dir + file\n if file != 'index.html':\n directory = output_dir + file[0:-5]\n if not os.path.exists(directory):\n os.makedirs(directory)\n new_file = directory + '/index.html'\n f = open(new_file, 'w')\n try:\n f.write(env.get_template(file).render(debug=debug, docs=docs))\n print 'success -', file\n except:\n print traceback.format_exc()\n f.write(html % (cgi.escape(file), cgi.escape(os.getcwd() + '/' + file), cgi.escape(traceback.format_exc())))\n print 'error -', file\n f.close()\n\ndef stat(files):\n return [os.stat(file).st_mtime for file in files]\n\ndef findfiles(path, ext):\n return [os.path.join(base, f) for base, folders, files in \\\n os.walk(path) for f in files if f.endswith(ext)]\n\ndef files():\n return findfiles(source_dir, '.js') + findfiles(template_dir, '.html') + [glfx_file]\n\ndebug = 'debug' in sys.argv\nenv = Environment(loader=FileSystemLoader(template_dir))\n\ndo(files())\nif debug:\n a = stat(files())\n while True:\n time.sleep(1)\n b = stat(files())\n if a != b:\n a = b\n do(files())\n"} +{"text": "/*\n * Copyright (C) 2019 Peng fei Pan \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage me.panpf.sketch;\n\nimport android.app.Application;\nimport android.content.ComponentCallbacks2;\nimport android.content.ContentProvider;\nimport android.content.ContentResolver;\nimport android.content.Context;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\nimport android.widget.ImageView;\n\nimport androidx.annotation.DrawableRes;\nimport androidx.annotation.Keep;\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\n\nimport me.panpf.sketch.request.CancelCause;\nimport me.panpf.sketch.request.DisplayHelper;\nimport me.panpf.sketch.request.DisplayRequest;\nimport me.panpf.sketch.request.DownloadHelper;\nimport me.panpf.sketch.request.DownloadListener;\nimport me.panpf.sketch.request.LoadHelper;\nimport me.panpf.sketch.request.LoadListener;\nimport me.panpf.sketch.uri.AssetUriModel;\nimport me.panpf.sketch.uri.DrawableUriModel;\nimport me.panpf.sketch.util.SketchUtils;\n\n/**\n * {@link Sketch} 是一个功能强大且全面的图片加载器,可以从网络或者本地加载图片,支持 gif、手势缩放以及分块显示超大图\n *
    \n *
  • {@link #display(String, SketchView)}:显示图片到 {@link SketchImageView} 上
  • \n *
  • {@link #load(String, LoadListener)}:加载图片到内存中
  • \n *
  • {@link #download(String, DownloadListener)}:下载图片到磁盘上
  • \n *
\n */\npublic class Sketch {\n public static final String META_DATA_KEY_INITIALIZER = \"SKETCH_INITIALIZER\";\n\n @Nullable\n private static volatile Sketch instance;\n @NonNull\n private Configuration configuration;\n\n private Sketch(@NonNull Context context) {\n this.configuration = new Configuration(context);\n }\n\n /**\n * Get a unique instance\n */\n @NonNull\n public static Sketch with(@NonNull Context context) {\n Sketch oldInstance = instance;\n if (oldInstance != null) return oldInstance;\n\n synchronized (Sketch.class) {\n oldInstance = instance;\n if (oldInstance != null) return oldInstance;\n\n Sketch newInstance = new Sketch(context);\n SLog.i(null, \"Version %s %s(%d) -> %s\",\n BuildConfig.BUILD_TYPE, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, newInstance.configuration.toString());\n\n Initializer initializer = SketchUtils.findInitializer(context);\n if (initializer != null) {\n initializer.onInitialize(context.getApplicationContext(), newInstance.configuration);\n }\n instance = newInstance;\n return newInstance;\n }\n }\n\n /**\n * 取消请求\n *\n * @param sketchView 会通过 {@link SketchView} 的 {@link Drawable} 找到正在执行的请求,然后取消它\n * @return true:当前 {@link SketchView} 有正在执行的任务并且取消成功;false:当前 {@link SketchView} 没有正在执行的任务\n */\n public static boolean cancel(@NonNull SketchView sketchView) {\n final DisplayRequest displayRequest = SketchUtils.findDisplayRequest(sketchView);\n if (displayRequest != null && !displayRequest.isFinished()) {\n displayRequest.cancel(CancelCause.BE_CANCELLED);\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * 获取配置对象\n *\n * @return {@link Configuration}\n */\n @NonNull\n public Configuration getConfiguration() {\n return configuration;\n }\n\n /**\n * 根据指定的 uri 下载图片\n *\n * @param uri 图片 uri,只支持 http:// 和 https://\n * @param listener 监听下载过程\n * @return {@link DownloadHelper} 你可以继续通过 {@link DownloadHelper} 设置参数,最后调用其 {@link DownloadHelper#commit()} 方法提交\n */\n @NonNull\n public DownloadHelper download(@NonNull String uri, @Nullable DownloadListener listener) {\n return configuration.getHelperFactory().getDownloadHelper(this, uri, listener);\n }\n\n /**\n * 根据指定的 uri 加载图片到内存中\n *\n * @param uri 图片 uri,支持全部的 uri 类型,请参考 https://github.com/panpf/sketch/blob/master/docs/wiki/uri.md\n * @param listener 监听下载过程\n * @return {@link LoadHelper} 你可以继续通过 {@link LoadHelper} 设置参数,最后调用其 {@link LoadHelper#commit()} 方法提交\n */\n @NonNull\n public LoadHelper load(@NonNull String uri, @Nullable LoadListener listener) {\n return configuration.getHelperFactory().getLoadHelper(this, uri, listener);\n }\n\n /**\n * 加载 assets 资源图片\n *\n * @param assetFileName assets 文件夹下的图片文件的名称\n * @param listener 监听加载过程\n * @return {@link LoadHelper} 你可以继续通过 {@link LoadHelper} 设置参数,最后调用其 {@link LoadHelper#commit()} 方法提交\n */\n @NonNull\n public LoadHelper loadFromAsset(@NonNull String assetFileName, @Nullable LoadListener listener) {\n String uri = AssetUriModel.makeUri(assetFileName);\n return configuration.getHelperFactory().getLoadHelper(this, uri, listener);\n }\n\n /**\n * 加载 drawable 资源图片\n *\n * @param drawableResId drawable 资源 id\n * @param listener 监听加载过程\n * @return {@link LoadHelper} 你可以继续通过 {@link LoadHelper} 设置参数,最后调用其 {@link LoadHelper#commit()} 方法提交\n */\n @NonNull\n public LoadHelper loadFromResource(@DrawableRes int drawableResId, @Nullable LoadListener listener) {\n String uri = DrawableUriModel.makeUri(drawableResId);\n return configuration.getHelperFactory().getLoadHelper(this, uri, listener);\n }\n\n /**\n * 加载来自 {@link ContentProvider} 的图片\n *\n * @param uri 来自 {@link ContentProvider} 的图片 uri,例如:content://、file://,使用 {@link ContentResolver#openInputStream(Uri)} api 读取图片\n * @param listener 监听加载过程\n * @return {@link LoadHelper} 你可以继续通过 {@link LoadHelper} 设置参数,最后调用其 {@link LoadHelper#commit()} 方法提交\n */\n @NonNull\n public LoadHelper loadFromContent(@NonNull String uri, @Nullable LoadListener listener) {\n return configuration.getHelperFactory().getLoadHelper(this, uri, listener);\n }\n\n /**\n * 根据指定的 uri 显示图片\n *\n * @param uri 图片 uri,支持全部的 uri 类型,请参考 https://github.com/panpf/sketch/blob/master/docs/wiki/uri.md\n * @param sketchView {@link Sketch} 对 {@link ImageView} 的规范接口,默认实现是 {@link SketchImageView}\n * @return {@link DisplayHelper} 你可以继续通过 {@link DisplayHelper} 设置参数,最后调用其 {@link DisplayHelper#commit()} 方法提交\n */\n @NonNull\n public DisplayHelper display(@Nullable String uri, @NonNull SketchView sketchView) {\n return configuration.getHelperFactory().getDisplayHelper(this, uri, sketchView);\n }\n\n /**\n * 显示 assets 资源图片\n *\n * @param assetFileName assets 文件夹下的图片文件的名称\n * @param sketchView {@link Sketch} 对 {@link ImageView} 的规范接口,默认实现是 {@link SketchImageView}\n * @return {@link DisplayHelper} 你可以继续通过 {@link DisplayHelper} 设置参数,最后调用其 {@link DisplayHelper#commit()} 方法提交\n */\n @NonNull\n public DisplayHelper displayFromAsset(@NonNull String assetFileName, @NonNull SketchView sketchView) {\n String uri = AssetUriModel.makeUri(assetFileName);\n return configuration.getHelperFactory().getDisplayHelper(this, uri, sketchView);\n }\n\n /**\n * 显示 drawable 资源图片\n *\n * @param drawableResId drawable 资源 id\n * @param sketchView {@link Sketch} 对 {@link ImageView} 的规范接口,默认实现是 {@link SketchImageView}\n * @return {@link DisplayHelper} 你可以继续通过 {@link DisplayHelper} 设置参数,最后调用其 {@link DisplayHelper#commit()} 方法提交\n */\n @NonNull\n public DisplayHelper displayFromResource(@DrawableRes int drawableResId, @NonNull SketchView sketchView) {\n String uri = DrawableUriModel.makeUri(drawableResId);\n return configuration.getHelperFactory().getDisplayHelper(this, uri, sketchView);\n }\n\n /**\n * 显示来自 {@link ContentProvider} 的图片\n *\n * @param uri 来自 {@link ContentProvider} 的图片 uri,例如:content://、file://,使用 {@link ContentResolver#openInputStream(Uri)} api 读取图片\n * @param sketchView {@link Sketch} 对 {@link ImageView} 的规范接口,默认实现是 {@link SketchImageView}\n * @return {@link DisplayHelper} 你可以继续通过 {@link DisplayHelper} 设置参数,最后调用其 {@link DisplayHelper#commit()} 方法提交\n */\n @NonNull\n public DisplayHelper displayFromContent(@NonNull String uri, @NonNull SketchView sketchView) {\n return configuration.getHelperFactory().getDisplayHelper(this, uri, sketchView);\n }\n\n /**\n * 修整内存缓存,4.0 以下你需要重写 {@link Application#onTrimMemory(int)} 方法,然后调用这个方法\n *\n * @param level 修剪级别,对应 APP 的不同状态,对应 {@link ComponentCallbacks2} 里的常量\n */\n @Keep\n public void onTrimMemory(int level) {\n SLog.w(null, \"Trim of memory, level= %s\", SketchUtils.getTrimLevelName(level));\n\n configuration.getMemoryCache().trimMemory(level);\n configuration.getBitmapPool().trimMemory(level);\n }\n\n /**\n * 当内存低时直接清空全部内存缓存,4.0 以下你需要重写 {@link Application#onLowMemory} 方法,然后调用这个方法\n */\n @Keep\n public void onLowMemory() {\n SLog.w(null, \"Memory is very low, clean memory cache and bitmap pool\");\n\n configuration.getMemoryCache().clear();\n configuration.getBitmapPool().clear();\n }\n}"} +{"text": "\n\nmodule Veewee\n module Provider\n module Vmfusion\n module BoxCommand\n\n def build(options)\n super(options)\n add_share_from_defn\n end\n end\n end\n end\nend\n"} +{"text": "#ifndef BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP\n#define BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP\n\n// MS compatible compilers support #pragma once\n#if defined(_MSC_VER)\n# pragma once\n#endif\n\n/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8\n// unescape.hpp\n\n// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . \n// Use, modification and distribution is subject to the Boost Software\n// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\n// http://www.boost.org/LICENSE_1_0.txt)\n\n// See http://www.boost.org for updates, documentation, and revision history.\n\n#include \n\n#include \n#include \n\nnamespace boost { \nnamespace archive {\nnamespace iterators {\n\n/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8\n// class used by text archives to translate char strings to wchar_t\n// strings of the currently selected locale\ntemplate\nclass unescape \n : public boost::iterator_adaptor<\n unescape,\n Base, \n typename pointee::type,\n single_pass_traversal_tag,\n typename pointee::type\n >\n{\n friend class boost::iterator_core_access;\n typedef typename boost::iterator_adaptor<\n unescape, \n Base, \n typename pointee::type,\n single_pass_traversal_tag,\n typename pointee::type\n > super_t;\n\n typedef unescape this_t;\npublic:\n typedef typename this_t::value_type value_type;\n typedef typename this_t::reference reference;\nprivate:\n value_type dereference_impl() {\n if(! m_full){\n m_current_value = static_cast(this)->drain();\n m_full = true;\n }\n return m_current_value;\n }\n\n reference dereference() const {\n return const_cast(this)->dereference_impl();\n }\n\n value_type m_current_value;\n bool m_full;\n\n void increment(){\n ++(this->base_reference());\n dereference_impl();\n m_full = false;\n };\n\npublic:\n\n unescape(Base base) : \n super_t(base),\n m_full(false)\n {}\n\n};\n\n} // namespace iterators\n} // namespace archive\n} // namespace boost\n\n#endif // BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP\n"} +{"text": "\n\n \n \n Debug\n AnyCPU\n {EF0D6FB5-5350-42B6-85C2-49C5194D53E5}\n Library\n Properties\n LogMaster4Net.Base\n LogMaster4Net.Base\n v4.0\n 512\n \n \n \n true\n full\n false\n bin\\Debug\\\n DEBUG;TRACE\n prompt\n 4\n \n \n pdbonly\n true\n bin\\Release\\\n TRACE\n prompt\n 4\n \n \n \n False\n ..\\packages\\AnyLog.0.1.5.0\\lib\\net40\\AnyLog.dll\n \n \n \n \n \n \n \n \n \n \n GlobalAssemblyInfo.cs\n \n \n \n \n \n \n \n \n \n \n \n \n \n"} +{"text": "getMessage();\n\n $chat = $message->getChat();\n $user = $message->getFrom();\n $text = trim($message->getText(true));\n $chat_id = $chat->getId();\n $user_id = $user->getId();\n\n // Preparing response\n $data = [\n 'chat_id' => $chat_id,\n // Remove any keyboard by default\n 'reply_markup' => Keyboard::remove(['selective' => true]),\n ];\n\n if ($chat->isGroupChat() || $chat->isSuperGroup()) {\n // Force reply is applied by default so it can work with privacy on\n $data['reply_markup'] = Keyboard::forceReply(['selective' => true]);\n }\n\n // Conversation start\n $this->conversation = new Conversation($user_id, $chat_id, $this->getName());\n\n // Load any existing notes from this conversation\n $notes = &$this->conversation->notes;\n !is_array($notes) && $notes = [];\n\n // Load the current state of the conversation\n $state = $notes['state'] ?? 0;\n\n $result = Request::emptyResponse();\n\n // State machine\n // Every time a step is achieved the state is updated\n switch ($state) {\n case 0:\n if ($text === '') {\n $notes['state'] = 0;\n $this->conversation->update();\n\n $data['text'] = 'Type your name:';\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $notes['name'] = $text;\n $text = '';\n\n // No break!\n case 1:\n if ($text === '') {\n $notes['state'] = 1;\n $this->conversation->update();\n\n $data['text'] = 'Type your surname:';\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $notes['surname'] = $text;\n $text = '';\n\n // No break!\n case 2:\n if ($text === '' || !is_numeric($text)) {\n $notes['state'] = 2;\n $this->conversation->update();\n\n $data['text'] = 'Type your age:';\n if ($text !== '') {\n $data['text'] = 'Age must be a number';\n }\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $notes['age'] = $text;\n $text = '';\n\n // No break!\n case 3:\n if ($text === '' || !in_array($text, ['M', 'F'], true)) {\n $notes['state'] = 3;\n $this->conversation->update();\n\n $data['reply_markup'] = (new Keyboard(['M', 'F']))\n ->setResizeKeyboard(true)\n ->setOneTimeKeyboard(true)\n ->setSelective(true);\n\n $data['text'] = 'Select your gender:';\n if ($text !== '') {\n $data['text'] = 'Choose a keyboard option to select your gender';\n }\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $notes['gender'] = $text;\n\n // No break!\n case 4:\n if ($message->getLocation() === null) {\n $notes['state'] = 4;\n $this->conversation->update();\n\n $data['reply_markup'] = (new Keyboard(\n (new KeyboardButton('Share Location'))->setRequestLocation(true)\n ))\n ->setOneTimeKeyboard(true)\n ->setResizeKeyboard(true)\n ->setSelective(true);\n\n $data['text'] = 'Share your location:';\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $notes['longitude'] = $message->getLocation()->getLongitude();\n $notes['latitude'] = $message->getLocation()->getLatitude();\n\n // No break!\n case 5:\n if ($message->getPhoto() === null) {\n $notes['state'] = 5;\n $this->conversation->update();\n\n $data['text'] = 'Insert your picture:';\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $photo = $message->getPhoto()[0];\n $notes['photo_id'] = $photo->getFileId();\n\n // No break!\n case 6:\n if ($message->getContact() === null) {\n $notes['state'] = 6;\n $this->conversation->update();\n\n $data['reply_markup'] = (new Keyboard(\n (new KeyboardButton('Share Contact'))->setRequestContact(true)\n ))\n ->setOneTimeKeyboard(true)\n ->setResizeKeyboard(true)\n ->setSelective(true);\n\n $data['text'] = 'Share your contact information:';\n\n $result = Request::sendMessage($data);\n break;\n }\n\n $notes['phone_number'] = $message->getContact()->getPhoneNumber();\n\n // No break!\n case 7:\n $this->conversation->update();\n $out_text = '/Survey result:' . PHP_EOL;\n unset($notes['state']);\n foreach ($notes as $k => $v) {\n $out_text .= PHP_EOL . ucfirst($k) . ': ' . $v;\n }\n\n $data['photo'] = $notes['photo_id'];\n $data['caption'] = $out_text;\n\n $this->conversation->stop();\n\n $result = Request::sendPhoto($data);\n break;\n }\n\n return $result;\n }\n}\n"} +{"text": "/*\ntable encoder position an values id\n OFF_ON = 0+3 = 3\n ON_OFF = 1+5 = 6\n ON_ON = 1+3 = 4\n OFF_OFF = 0+5 = 5 \n */\n \n //left:3,6\n// right: 4,5\nconst int encoder0PinA = 2;\nconst int encoder0PinB = 3;\nconst int encoder0PinC = 4; // not used\nshort directionEncoders;\nshort lastDirectionEncoders;\nvoid setup() {// put your setup code here, to run once:\n pinMode(encoder0PinA,INPUT);\n pinMode(encoder0PinB,INPUT);\n pinMode(encoder0PinC,INPUT);\n \n Serial.begin(115200);\n directionEncoders = 0;\n lastDirectionEncoders = -1;\n}\n\nvoid loop() {\n directionEncoders = 0;\n if(digitalRead(encoder0PinA)== HIGH){ \n // directionEncoders is ON for encoder A\n directionEncoders += 1; \n }\n else{ \n // directionEncoders is OFF for encoder A\n directionEncoders += 0; \n }\n if(digitalRead(encoder0PinB)== HIGH){ \n // directionEncoders is ON for encoder B\n directionEncoders +=3; \n }\n else{ \n // directionEncoders is OFF for encoder B\n directionEncoders +=5;\n } \n \n // print when is different\n if(lastDirectionEncoders != directionEncoders){\n lastDirectionEncoders = directionEncoders;\n Serial.println(directionEncoders);\n }\n \n \n}\n"} +{"text": "from django import forms\nfrom django.forms.forms import BoundField\nfrom django.utils.html import escape\nfrom django.utils.encoding import force_unicode\nfrom django.utils.safestring import mark_safe\n\nclass SectionedForm(object):\n \"\"\"\n ToDo\n \"\"\"\n sections = {}\n section_template = \"

%s

\"\n\n def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row):\n \"Helper function for outputting HTML. Used by as_table(), as_ul(), as_p().\"\n top_errors = self.non_field_errors() # Errors that should be displayed above all fields.\n output, hidden_fields = [], []\n\n for section, fields in self.sections:\n if section:\n output.append(normal_row % {'errors': '', 'label': ' ', 'field': self.section_template%section, 'help_text': ''})\n\n for name, field in [i for i in self.fields.items() if i[0] in fields]:\n bf = BoundField(self, field, name)\n bf_errors = self.error_class([escape(error) for error in bf.errors]) # Escape and cache in local variable.\n if bf.is_hidden:\n if bf_errors:\n top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors])\n hidden_fields.append(unicode(bf))\n else:\n if errors_on_separate_row and bf_errors:\n output.append(error_row % force_unicode(bf_errors))\n if bf.label:\n label = escape(force_unicode(bf.label))\n # Only add the suffix if the label does not end in\n # punctuation.\n if self.label_suffix:\n if label[-1] not in ':?.!':\n label += self.label_suffix\n label = bf.label_tag(label) or ''\n else:\n label = ''\n if field.help_text:\n help_text = help_text_html % force_unicode(field.help_text)\n else:\n help_text = u''\n output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text})\n\n if top_errors:\n output.insert(0, error_row % force_unicode(top_errors))\n if hidden_fields: # Insert any hidden fields in the last row.\n str_hidden = u''.join(hidden_fields)\n if output:\n last_row = output[-1]\n # Chop off the trailing row_ender (e.g. '') and\n # insert the hidden fields.\n output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender\n else:\n # If there aren't any rows in the output, just append the\n # hidden fields.\n output.append(str_hidden)\n return mark_safe(u'\\n'.join(output))\n\n"} +{"text": "/*\n * This file is part of EIBA.\n *\n * Copyright (C) 2017 Zhejiang University\n * For more information see \n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\n#include \"PlatformIndependence/sse.h\"\n\n#ifndef _FRAME_H_\n\n#include \"stdafx.h\"\n\n#include \"Camera.h\"\n#include \"Feature.h\"\n#include \"M-Estimator.h\"\n#include \"Matrix2x3.h\"\n#include \"Matrix2x4.h\"\n#include \"Matrix8x8.h\"\n\n#define FRM_IP_LEVELS 4\n#define FRM_IP_LEVELS_MINUS_ONE 3\n#define FRM_IP_LEVELS_PLUS_ONE 5\n//#define FRM_IT_LEVEL\t\t\t4\n\n#define FRM_IT_CHECK_INVALID_DEFAULT 0\n#define FRM_IT_CHKCK_INVALID_FIRST 1\n#define FRM_IT_CHKCK_INVALID_ALL 2\n\n//#define FRM_ALN_DECOUPLE_RIGID\n\n#define FRM_ALN_FLAG_DEFAULT 0\n#define FRM_ALN_FLAG_ROTATION 1\n#define FRM_ALN_FLAG_POSITION 2\n#define FRM_ALN_FLAG_DEPTH 4\n#define FRM_ALN_FLAG_INITIALIZED 8\n\n#ifdef CFG_TUNE_PARAMETERS\nextern int FRM_IT_LEVEL;\nextern float FRM_IT_BLUR_SIGMA;\nextern float FRM_ALN_WEIGHT_INTENSITY;\nextern float FRM_ALN_WEIGHT_PRIOR_ROTATION;\nextern int FRM_ALN_MAX_ITERATIONS;\nextern float FRM_ALN_VARIANCE_INTENSITY;\nextern float FRM_ALN_VARIANCE_MATCH;\nextern float FRM_ALN_VARIANCE_PRIOR_INTENSITY_OFFSET;\nextern float FRM_ALN_VARIANCE_PRIOR_DEPTH;\n#ifdef CFG_DEPTH_MAP\nextern float FRM_ALN_VARIANCE_PRIOR_DEPTH_MAP;\n#endif\nextern float FRM_ALN_VARIANCE_PRIOR_ROTATION;\nextern float FRM_ALN_VARIANCE_PRIOR_POSITION_X;\nextern float FRM_ALN_VARIANCE_PRIOR_POSITION_Y;\nextern float FRM_ALN_VARIANCE_PRIOR_POSITION_Z;\nextern float FRM_ALN_MAX_ERROR_INTENSITY;\nextern float FRM_ALN_MAX_ERROR_MATCH;\nextern float FRM_ALN_MIN_OVERLAP_RATIO;\nextern float FRM_ALN_MIN_OVERLAP_RATIO_ROBUST;\nextern float FRM_ALN_CONVERGE_MOVEMENT;\nextern float FRM_ALN_CONVERGE_DEPTH;\nextern float FRM_ALN_EPSILON_ROTATION;\nextern float FRM_ALN_EPSILON_POSITION;\n#include \"Configurator.h\"\nextern void LOAD_PARAMETERS_FRAME_ALIGNMENT(const Configurator &cfgor);\n#else\n#define FRM_IT_LEVEL 4\n#define FRM_IT_BLUR_SIGMA 1.5f\n#define FRM_ALN_WEIGHT_INTENSITY 1.0e-3f\n//#define FRM_ALN_WEIGHT_INTENSITY\t\t\t\t1.0f\n#define FRM_ALN_WEIGHT_PRIOR_ROTATION 1.0e-3f\n//#define FRM_ALN_WEIGHT_PRIOR_ROTATION\t\t\t1.0f\n#define FRM_ALN_MAX_ITERATIONS 20\n#define FRM_ALN_VARIANCE_INTENSITY 100.0f // 10^2\n#define FRM_ALN_VARIANCE_MATCH 1.0f // 1^2\n#define FRM_ALN_VARIANCE_PRIOR_INTENSITY_OFFSET 9.0f // 3^2\n//#define FRM_ALN_VARIANCE_PRIOR_DEPTH\t\t\t1.0f\n//// 1^2\n#define FRM_ALN_VARIANCE_PRIOR_DEPTH 100.0f // 10^2\n#ifdef CFG_DEPTH_MAP\n//#define FRM_ALN_VARIANCE_PRIOR_DEPTH_MAP\t\t0.01f\n//// 0.1^2\n#define FRM_ALN_VARIANCE_PRIOR_DEPTH_MAP 1.0f // 1^2\n#endif\n#define FRM_ALN_VARIANCE_PRIOR_ROTATION 3.046174198662e-4f // (1.0*pi/180)^2\n#define FRM_ALN_VARIANCE_PRIOR_POSITION_X 9.0f // 3^2+\n#define FRM_ALN_VARIANCE_PRIOR_POSITION_Y 9.0f\n#define FRM_ALN_VARIANCE_PRIOR_POSITION_Z 9.0f\n#define FRM_ALN_MAX_ERROR_INTENSITY 20.0f\n#define FRM_ALN_MAX_ERROR_MATCH 1.0f\n#define FRM_ALN_MIN_OVERLAP_RATIO 0.3f\n#define FRM_ALN_MIN_OVERLAP_RATIO_ROBUST 0.3f\n#define FRM_ALN_CONVERGE_MOVEMENT 0.01f\n//#define FRM_ALN_CONVERGE_MOVEMENT\t\t\t\t0.1f\n#define FRM_ALN_CONVERGE_DEPTH 0.01f\n//#define FRM_ALN_CONVERGE_DEPTH\t\t\t\t0.1f\n#define FRM_ALN_EPSILON_ROTATION 1.745329252e-4f // 0.01*pi/180\n#define FRM_ALN_EPSILON_POSITION 0.001f\n#endif\n\nnamespace FRM\n{\ntemplate \ninline void VectorSaveB(const std::vector &V, FILE *fp)\n{\n const int N = int(V.size());\n UT::SaveB(N, fp);\n for (int i = 0; i < N; ++i) V[i].SaveB(fp);\n}\ntemplate inline void VectorLoadB(std::vector &V, FILE *fp)\n{\n const int N = UT::LoadB(fp);\n V.resize(N);\n for (int i = 0; i < N; ++i) V[i].LoadB(fp);\n}\n\ntemplate inline void ListSaveB(const std::list &L, FILE *fp)\n{\n const int N = int(L.size());\n UT::SaveB(N, fp);\n for (typename std::list::const_iterator it = L.begin(); it != L.end();\n ++it)\n it->SaveB(fp);\n}\ntemplate inline void ListLoadB(std::list &L, FILE *fp)\n{\n const int N = UT::LoadB(fp);\n L.resize(N);\n for (typename std::list::iterator it = L.begin(); it != L.end(); ++it)\n it->LoadB(fp);\n}\n\n// store frame tag\nclass Tag\n{\n public:\n inline bool operator==(const Tag &T) const\n {\n return m_iFrm == T.m_iFrm && m_t == T.m_t;\n }\n inline bool operator!=(const Tag &T) const\n {\n return m_iFrm != T.m_iFrm || m_t != T.m_t;\n }\n inline bool operator<(const Tag &T) const\n {\n return m_iFrm < T.m_iFrm && m_t < T.m_t;\n }\n inline bool operator>(const Tag &T) const\n {\n return m_iFrm > T.m_iFrm && m_t > T.m_t;\n }\n inline void SaveB(FILE *fp) const\n {\n UT::SaveB(m_iFrm, fp);\n UT::SaveB(m_t, fp);\n#ifdef CFG_VIEW\n UT::StringSaveB(m_fileName, fp);\n#ifdef CFG_DEPTH_MAP\n UT::StringSaveB(m_fileNameDep, fp);\n#endif\n#endif\n }\n inline void LoadB(FILE *fp)\n {\n UT::LoadB(m_iFrm, fp);\n UT::LoadB(m_t, fp);\n UT::StringLoadB(m_fileName, fp);\n UT::StringLoadB(m_fileNameDep, fp);\n }\n\n public:\n int m_iFrm;\n float m_t;\n std::string m_fileName;\n std::string m_fileNameDep;\n};\n\nclass Measurement\n{\n public:\n inline Measurement() {}\n inline Measurement(const int iKF, const int izIP[FRM_IP_LEVELS_PLUS_ONE])\n {\n m_iKF = iKF;\n memcpy(m_izIP, izIP, sizeof(m_izIP));\n }\n inline bool operator==(const Measurement &Z) const\n {\n return m_iKF == Z.m_iKF &&\n UT::VectorEqual(m_izIP, Z.m_izIP, FRM_IP_LEVELS_PLUS_ONE);\n }\n inline bool operator<(const int iKF) const { return m_iKF < iKF; }\n inline int SearchFeatureMeasurementLevel(const int iz) const\n {\n if (iz < m_izIP[0] || iz >= m_izIP[FRM_IP_LEVELS]) return -1;\n for (int iLvl = 0; iLvl < FRM_IP_LEVELS; ++iLvl) {\n if (iz < m_izIP[iLvl + 1]) return iLvl;\n }\n return -1;\n }\n inline void AssertConsistency() const\n {\n UT_ASSERT(m_iKF >= 0);\n for (int iLvl = 0; iLvl < FRM_IP_LEVELS; ++iLvl)\n UT_ASSERT(m_izIP[iLvl] <= m_izIP[iLvl + 1]);\n }\n\n public:\n // m_iKF : keyframe index\n // m_izIP : measurement start index for every image level\n int m_iKF, m_izIP[FRM_IP_LEVELS_PLUS_ONE];\n};\n\nclass Frame\n{\n public:\n inline Frame() {}\n inline Frame(const Frame &F) { *this = F; }\n inline void operator=(const Frame &F)\n {\n m_T = F.m_T;\n m_Zs = F.m_Zs;\n m_zs = F.m_zs;\n m_iKFsMatch = F.m_iKFsMatch;\n }\n inline bool operator==(const Frame &F) const\n {\n return m_T == F.m_T && UT::VectorEqual(m_Zs, F.m_Zs) &&\n UT::VectorEqual(m_zs, F.m_zs) &&\n UT::VectorEqual(m_iKFsMatch, F.m_iKFsMatch);\n }\n inline void Initialize(const Tag &T)\n {\n m_T = T;\n ClearMeasurements();\n }\n inline void Initialize(const Frame &F)\n {\n m_T = F.m_T;\n m_Zs = F.m_Zs;\n m_zs = F.m_zs;\n m_iKFsMatch = F.m_iKFsMatch;\n }\n inline void ClearMeasurements()\n {\n m_Zs.resize(0);\n m_zs.resize(0);\n m_iKFsMatch.resize(0);\n }\n inline int SearchFrameMeasurement(const int iKF) const\n {\n const std::vector::const_iterator iZ =\n std::lower_bound(m_Zs.begin(), m_Zs.end(), iKF);\n if (iZ == m_Zs.end() || iZ->m_iKF != iKF)\n return -1;\n else\n return int(iZ - m_Zs.begin());\n }\n inline int SearchFeatureMeasurement(const int iKF, const int ix) const\n {\n const int iZ = SearchFrameMeasurement(iKF);\n if (iZ == -1) return -1;\n const Measurement &Z = m_Zs[iZ];\n for (int iLvl = 0; iLvl < FRM_IP_LEVELS; ++iLvl) {\n const std::vector::const_iterator\n iz1 = m_zs.begin() + Z.m_izIP[iLvl],\n iz2 = m_zs.begin() + Z.m_izIP[iLvl + 1];\n const std::vector::const_iterator iz =\n std::lower_bound(iz1, iz2, ix);\n if (iz != iz2 && iz->m_ix == ix) return int(iz - m_zs.begin());\n }\n return -1;\n }\n#if 0\n\tinline bool SearchFeatureMeasurement(const int iKF, const int ix, int &iz, int &iLvl) const\n\t{\n\t\tiz = iLvl = -1;\n\t\tconst int iZ = SearchFrameMeasurement(iKF);\n\t\tif(iZ == -1)\n\t\t\treturn false;\n\t\tconst Measurement &Z = m_Zs[iZ];\n\t\tfor(int _iLvl = 0; _iLvl < FRM_IP_LEVELS; ++_iLvl)\n\t\t{\n\t\t\tconst std::vector::const_iterator iz1 = m_zs.begin() + Z.m_izIP[_iLvl], iz2 = m_zs.begin() + Z.m_izIP[_iLvl + 1];\n\t\t\tconst std::vector::const_iterator _iz = std::lower_bound(iz1, iz2, ix);\n\t\t\tif(_iz != iz2 && _iz->m_ix == ix)\n\t\t\t{\n\t\t\t\tiz = int(_iz - m_zs.begin());\n\t\t\t\tiLvl = _iLvl;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n#endif\n inline int SearchFeatureMeasurementLevel(const int iz) const\n {\n#ifdef CFG_DEBUG\n UT_ASSERT(iz < int(m_zs.size()));\n#endif\n const int NZ = int(m_Zs.size());\n for (int iZ = 0; iZ < NZ; ++iZ) {\n const Measurement &Z = m_Zs[iZ];\n if (Z.m_izIP[FRM_IP_LEVELS] <= iz) continue;\n for (int iLvl = 0; iLvl < FRM_IP_LEVELS; ++iLvl) {\n if (Z.m_izIP[iLvl + 1] > iz) return iLvl;\n }\n }\n return -1;\n }\n inline void SearchFeatureMeasurementMatches(\n const Frame &F, std::vector &izms) const\n {\n izms.resize(0);\n const int NZ1 = int(m_Zs.size());\n for (int iZ1 = 0; iZ1 < NZ1; ++iZ1) {\n const Measurement &Z1 = m_Zs[iZ1];\n const int iZ2 = F.SearchFrameMeasurement(Z1.m_iKF);\n if (iZ2 == -1) continue;\n const Measurement &Z2 = F.m_Zs[iZ2];\n const std::vector::const_iterator\n iz21 = F.m_zs.begin() + Z2.m_izIP[0],\n iz22 = F.m_zs.begin() + Z2.m_izIP[FRM_IP_LEVELS];\n const int iz11 = Z1.m_izIP[0], iz12 = Z1.m_izIP[FRM_IP_LEVELS];\n for (int iz1 = iz11; iz1 < iz12; ++iz1) {\n const int ix = m_zs[iz1].m_ix;\n const std::vector::const_iterator iz2 =\n std::lower_bound(iz21, iz22, ix);\n if (iz2 != iz22 && iz2->m_ix == ix)\n izms.push_back(FTR::Measurement::Match(\n iz1, int(iz2 - F.m_zs.begin())));\n }\n }\n }\n inline int CountFeatureMeasurements(const int iLvl) const\n {\n int SN = 0;\n const int NZ = int(m_Zs.size());\n for (int iZ = 0; iZ < NZ; ++iZ) {\n const Measurement &Z = m_Zs[iZ];\n SN += Z.m_izIP[iLvl + 1] - Z.m_izIP[iLvl];\n }\n return SN;\n }\n inline void PyramidToFirstLevel()\n {\n const int NZ = int(m_Zs.size());\n for (int iZ = 0; iZ < NZ; ++iZ) {\n Measurement &Z = m_Zs[iZ];\n const int iz1 = Z.m_izIP[0], iz2 = Z.m_izIP[FRM_IP_LEVELS];\n for (int iLvl = 1; iLvl < FRM_IP_LEVELS; ++iLvl)\n Z.m_izIP[iLvl] = iz2;\n std::sort(m_zs.begin() + iz1, m_zs.begin() + iz2);\n }\n }\n inline void SaveB(FILE *fp) const\n {\n m_T.SaveB(fp);\n UT::VectorSaveB(m_Zs, fp);\n UT::VectorSaveB(m_zs, fp);\n UT::VectorSaveB(m_iKFsMatch, fp);\n }\n inline void LoadB(FILE *fp)\n {\n m_T.LoadB(fp);\n UT::VectorLoadB(m_Zs, fp);\n UT::VectorLoadB(m_zs, fp);\n UT::VectorLoadB(m_iKFsMatch, fp);\n }\n inline void AssertConsistency() const\n {\n const int NZ = int(m_Zs.size());\n if (NZ == 0) return;\n for (int iZ = 0; iZ < NZ; ++iZ) m_Zs[iZ].AssertConsistency();\n UT_ASSERT(m_Zs.front().m_izIP[0] == 0);\n for (int iZ = 1; iZ < NZ; ++iZ) {\n const Measurement &Z1 = m_Zs[iZ - 1], &Z2 = m_Zs[iZ];\n UT_ASSERT(Z1.m_iKF < Z2.m_iKF);\n UT_ASSERT(Z1.m_izIP[FRM_IP_LEVELS] == Z2.m_izIP[0]);\n }\n UT_ASSERT(m_Zs.back().m_izIP[FRM_IP_LEVELS] == int(m_zs.size()));\n const int nKFsMatch = int(m_iKFsMatch.size());\n for (int i = 1; i < nKFsMatch; ++i)\n UT_ASSERT(m_iKFsMatch[i - 1] < m_iKFsMatch[i]);\n std::vector::const_iterator ik = m_iKFsMatch.begin();\n for (int iZ = 0; iZ < NZ; ++iZ) {\n const Measurement &Z = m_Zs[iZ];\n for (int iLvl = 0; iLvl < FRM_IP_LEVELS; ++iLvl) {\n const int iz1 = Z.m_izIP[iLvl], iz2 = Z.m_izIP[iLvl + 1];\n for (int iz = iz1 + 1; iz < iz2; ++iz)\n UT_ASSERT(m_zs[iz - 1].m_ix < m_zs[iz].m_ix);\n }\n ik = std::lower_bound(ik, m_iKFsMatch.end(), Z.m_iKF);\n UT_ASSERT(ik != m_iKFsMatch.end() && *ik == Z.m_iKF);\n }\n }\n\n public:\n // frame tag info\n Tag m_T;\n // measurements start index (store each matched frames by pyramid level)\n std::vector m_Zs;\n // feature measurements\n std::vector m_zs;\n // matched keyframe's index\n std::vector m_iKFsMatch;\n};\n\nnamespace ALN\n{\nclass Jacobian\n{\n public:\n inline bool Empty() const { return m_jxrs.Empty(); }\n inline void Resize(const int N)\n {\n m_jxrs.Resize(N);\n m_jxhs.Resize(N);\n }\n\n public:\n AlignedVector m_jxrs;\n AlignedVector m_jxhs;\n};\n\nclass Factor\n{\n public:\n class Data3\n {\n struct CanNotMakeAnonymous {\n LA::AlignedVector3f m_j;\n LA::SymmetricMatrix3x3f m_a;\n };\n\n public:\n CanNotMakeAnonymous fe;\n _pi__m128 m_data[3];\n };\n class Data6\n {\n struct CanNotMakeAnonymous {\n LA::AlignedVector6f m_j;\n LA::SymmetricMatrix3x3f m_arr, m_app;\n LA::Matrix3x3f m_arp;\n };\n\n public:\n CanNotMakeAnonymous fe;\n _pi__m128 m_data[8];\n };\n class Data8\n {\n public:\n LA::AlignedVector8f m_j;\n LA::SymmetricMatrix8x8f m_a;\n };\n\n public:\n inline void Resize(const int N)\n {\n m_ars.Resize(N);\n m_ahs.Resize(N);\n#ifdef FRM_ALN_DECOUPLE_RIGID\n m_aps.Resize(N);\n#else\n m_arps.Resize(N);\n#endif\n }\n\n public:\n AlignedVector m_ars;\n AlignedVector m_ahs;\n#ifdef FRM_ALN_DECOUPLE_RIGID\n AlignedVector m_aps;\n#else\n AlignedVector m_arps;\n#endif\n};\n\nclass MatchList\n{\n public:\n inline MatchList(AlignedVector &x1s, AlignedVector &x2s)\n : m_x1s(x1s), m_x2s(x2s)\n {\n }\n inline int Size() const { return m_x1s.Size(); }\n public:\n AlignedVector m_x1s, m_x2s;\n};\n}\n}\n\n#endif\n"} +{"text": "// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen\n\n#if os(OSX)\n import AppKit.NSColor\n internal typealias Color = NSColor\n#elseif os(iOS) || os(tvOS) || os(watchOS)\n import UIKit.UIColor\n internal typealias Color = UIColor\n#endif\n\n// swiftlint:disable superfluous_disable_command\n// swiftlint:disable file_length\n\n// swiftlint:disable operator_usage_whitespace\ninternal extension Color {\n convenience init(rgbaValue: UInt32) {\n let red = CGFloat((rgbaValue >> 24) & 0xff) / 255.0\n let green = CGFloat((rgbaValue >> 16) & 0xff) / 255.0\n let blue = CGFloat((rgbaValue >> 8) & 0xff) / 255.0\n let alpha = CGFloat((rgbaValue ) & 0xff) / 255.0\n\n self.init(red: red, green: green, blue: blue, alpha: alpha)\n }\n}\n// swiftlint:enable operator_usage_whitespace\n\n// swiftlint:disable identifier_name line_length type_body_length\ninternal struct ColorName {\n internal let rgbaValue: UInt32\n internal var color: Color { return Color(named: self) }\n\n /// \n /// Alpha: 100%
(0xc0392bff)\n internal static let errorMessageBackground = ColorName(rgbaValue: 0xc0392bff)\n /// \n /// Alpha: 100%
(0xffffccff)\n internal static let favoriteBackground = ColorName(rgbaValue: 0xffffccff)\n /// \n /// Alpha: 100%
(0xc05d5dff)\n internal static let navigationBackground = ColorName(rgbaValue: 0xc05d5dff)\n /// \n /// Alpha: 100%
(0x27ae60ff)\n internal static let onlineMessageBackground = ColorName(rgbaValue: 0x27ae60ff)\n}\n// swiftlint:enable identifier_name line_length type_body_length\n\ninternal extension Color {\n convenience init(named color: ColorName) {\n self.init(rgbaValue: color.rgbaValue)\n }\n}\n"} +{"text": "Timezone\n========\n\nValidates that a value is a valid timezone identifier (e.g. ``Europe/Paris``).\n\n========== ======================================================================\nApplies to :ref:`property or method `\nOptions - `countryCode`_\n - `groups`_\n - `intlCompatible`_\n - `message`_\n - `payload`_\n - `zone`_\nClass :class:`Symfony\\\\Component\\\\Validator\\\\Constraints\\\\Timezone`\nValidator :class:`Symfony\\\\Component\\\\Validator\\\\Constraints\\\\TimezoneValidator`\n========== ======================================================================\n\nBasic Usage\n-----------\n\nSuppose you have a ``UserSettings`` class, with a ``timezone`` field that is a\nstring which contains any of the `PHP timezone identifiers`_ (e.g. ``America/New_York``):\n\n.. configuration-block::\n\n .. code-block:: php-annotations\n\n // src/Entity/UserSettings.php\n namespace App\\Entity;\n\n use Symfony\\Component\\Validator\\Constraints as Assert;\n\n class UserSettings\n {\n /**\n * @Assert\\Timezone\n */\n protected $timezone;\n }\n\n .. code-block:: yaml\n\n # config/validator/validation.yaml\n App\\Entity\\UserSettings:\n properties:\n timezone:\n - Timezone: ~\n\n .. code-block:: xml\n\n \n \n \n\n \n \n \n \n \n \n\n .. code-block:: php\n\n // src/Entity/UserSettings.php\n namespace App\\Entity;\n\n use Symfony\\Component\\Validator\\Constraints as Assert;\n use Symfony\\Component\\Validator\\Mapping\\ClassMetadata;\n\n class UserSettings\n {\n public static function loadValidatorMetadata(ClassMetadata $metadata)\n {\n $metadata->addPropertyConstraint('timezone', new Assert\\Timezone());\n }\n }\n\n.. include:: /reference/constraints/_empty-values-are-valid.rst.inc\n\nOptions\n-------\n\ncountryCode\n~~~~~~~~~~~\n\n**type**: ``string`` **default**: ``null``\n\nIf the ``zone`` option is set to ``\\DateTimeZone::PER_COUNTRY``, this option\nrestricts the valid timezone identifiers to the ones that belong to the given\ncountry.\n\nThe value of this option must be a valid `ISO 3166-1 alpha-2`_ country code\n(e.g. ``CN`` for China).\n\n.. include:: /reference/constraints/_groups-option.rst.inc\n\nintlCompatible\n~~~~~~~~~~~~~~\n\n**type**: ``boolean`` **default**: ``false``\n\nThis constraint considers valid both the `PHP timezone identifiers`_ and the\n:ref:`ICU timezones ` provided by Symfony's\n:doc:`Intl component `\n\nHowever, the timezones provided by the Intl component can be different from the\ntimezones provided by PHP's Intl extension (because they use different ICU\nversions). If this option is set to ``true``, this constraint only considers\nvalid the values compatible with the PHP ``\\IntlTimeZone::createTimeZone()`` method.\n\nmessage\n~~~~~~~\n\n**type**: ``string`` **default**: ``This value is not a valid timezone.``\n\nThis message is shown if the underlying data is not a valid timezone identifier.\n\nYou can use the following parameters in this message:\n\n=============== ==============================================================\nParameter Description\n=============== ==============================================================\n``{{ value }}`` The current (invalid) value\n``{{ label }}`` Corresponding form field label\n=============== ==============================================================\n\n.. versionadded:: 5.2\n\n The ``{{ label }}`` parameter was introduced in Symfony 5.2.\n\n.. include:: /reference/constraints/_payload-option.rst.inc\n\nzone\n~~~~\n\n**type**: ``string`` **default**: ``\\DateTimeZone::ALL``\n\nSet this option to any of the following constants to restrict the valid timezone\nidentifiers to the ones that belong to that geographical zone:\n\n* ``\\DateTimeZone::AFRICA``\n* ``\\DateTimeZone::AMERICA``\n* ``\\DateTimeZone::ANTARCTICA``\n* ``\\DateTimeZone::ARCTIC``\n* ``\\DateTimeZone::ASIA``\n* ``\\DateTimeZone::ATLANTIC``\n* ``\\DateTimeZone::AUSTRALIA``\n* ``\\DateTimeZone::EUROPE``\n* ``\\DateTimeZone::INDIAN``\n* ``\\DateTimeZone::PACIFIC``\n\nIn addition, there are some special zone values:\n\n* ``\\DateTimeZone::ALL`` accepts any timezone excluding deprecated timezones;\n* ``\\DateTimeZone::ALL_WITH_BC`` accepts any timezone including deprecated\n timezones;\n* ``\\DateTimeZone::PER_COUNTRY`` restricts the valid timezones to a certain\n country (which is defined using the ``countryCode`` option).\n\n.. _`PHP timezone identifiers`: https://www.php.net/manual/en/timezones.php\n.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\n"} +{"text": "/// \n"} +{"text": "let assert = require('assert').deepStrictEqual\n\nfunction Product(name, price) {\n this.name = name\n this.price = price\n}\n\nfunction Food(name, price) {\n Product.call(this, name, price)\n this.category = 'food'\n}\n\nassert(new Food('cheese', 5).name, 'cheese')\n// expected output: \"cheese\"\n"} +{"text": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc setTimespec(sec, nsec int64) Timespec {\n\treturn Timespec{Sec: sec, Nsec: int32(nsec)}\n}\n\nfunc setTimeval(sec, usec int64) Timeval {\n\treturn Timeval{Sec: sec, Usec: int32(usec)}\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"} +{"text": "{\n \"name\": \"iliakan\",\n \"isAdmin\": true\n}\n"} +{"text": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n//\n// The following only applies to changes made to this file as part of YugaByte development.\n//\n// Portions Copyright (c) YugaByte, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software distributed under the License\n// is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n// or implied. See the License for the specific language governing permissions and limitations\n// under the License.\n//\n#ifndef YB_CONSENSUS_CONSENSUS_H_\n#define YB_CONSENSUS_CONSENSUS_H_\n\n#include \n#include \n#include \n#include \n#include \n\n#include \n\n#include \"yb/common/hybrid_time.h\"\n\n#include \"yb/consensus/consensus_fwd.h\"\n#include \"yb/consensus/consensus_types.h\"\n#include \"yb/consensus/consensus.pb.h\"\n#include \"yb/consensus/opid_util.h\"\n\n#include \"yb/gutil/callback.h\"\n#include \"yb/gutil/gscoped_ptr.h\"\n#include \"yb/gutil/ref_counted.h\"\n#include \"yb/gutil/stringprintf.h\"\n#include \"yb/gutil/strings/substitute.h\"\n\n#include \"yb/util/enums.h\"\n#include \"yb/util/monotime.h\"\n#include \"yb/util/opid.h\"\n#include \"yb/util/status.h\"\n#include \"yb/util/status_callback.h\"\n#include \"yb/util/strongly_typed_bool.h\"\n\nnamespace yb {\n\nnamespace log {\nclass Log;\n}\n\nnamespace master {\nclass SysCatalogTable;\n}\n\nnamespace server {\nclass Clock;\n}\n\nnamespace tablet {\nclass TabletPeer;\n}\n\nnamespace tserver {\nclass TabletServerErrorPB;\n}\n\nnamespace consensus {\n\ntypedef int64_t ConsensusTerm;\n\ntypedef std::function\n ConsensusReplicatedCallback;\n\n// After completing bootstrap, some of the results need to be plumbed through\n// into the consensus implementation.\nstruct ConsensusBootstrapInfo {\n ConsensusBootstrapInfo();\n\n // The id of the last operation in the log\n OpIdPB last_id;\n\n // The id of the last committed operation in the log.\n OpIdPB last_committed_id;\n\n // The id of the split operation designated for this tablet added to Raft log.\n // See comments for ReplicateState::split_op_id_.\n OpIdPB split_op_id;\n\n // REPLICATE messages which were in the log with no accompanying\n // COMMIT. These need to be passed along to consensus init in order\n // to potentially commit them.\n //\n // These are owned by the ConsensusBootstrapInfo instance.\n ReplicateMsgs orphaned_replicates;\n\n private:\n DISALLOW_COPY_AND_ASSIGN(ConsensusBootstrapInfo);\n};\n\nstruct LeaderState;\n\n// Mode is orthogonal to pre-elections, so any combination could be used.\nYB_DEFINE_ENUM(ElectionMode,\n // A normal leader election. Peers will not vote for this node\n // if they believe that a leader is alive.\n (NORMAL_ELECTION)\n // In this mode, peers will vote for this candidate even if they\n // think a leader is alive. This can be used for a faster hand-off\n // between a leader and one of its replicas.\n (ELECT_EVEN_IF_LEADER_IS_ALIVE));\n\n// Arguments for StartElection.\nstruct LeaderElectionData {\n ElectionMode mode;\n\n // pending_commit - we should start election only after we have specified entry committed.\n const bool pending_commit = false;\n\n // must_be_committed_opid - only matters if pending_commit is true.\n // If this is specified, we would wait until this entry is committed. If not specified\n // (i.e. if this has the default OpId value) it is taken from the last call to StartElection\n // with pending_commit = true.\n OpIdPB must_be_committed_opid = OpIdPB::default_instance();\n\n // originator_uuid - if election is initiated by an old leader as part of a stepdown procedure,\n // this would contain the uuid of the old leader.\n std::string originator_uuid = std::string();\n\n TEST_SuppressVoteRequest suppress_vote_request = TEST_SuppressVoteRequest::kFalse;\n\n std::string ToString() const;\n};\n\n// The external interface for a consensus peer.\n//\n// Note: Even though Consensus points to Log, it needs to be destroyed\n// after it. See Log class header comment for the reason why. On the other\n// hand Consensus must be quiesced before closing the log, otherwise it\n// will try to write to a destroyed/closed log.\n//\n// The order of these operations on shutdown must therefore be:\n// 1 - quiesce Consensus\n// 2 - close/destroy Log\n// 3 - destroy Consensus\nclass Consensus {\n public:\n class ConsensusFaultHooks;\n\n Consensus() {}\n virtual ~Consensus() {}\n\n // Starts running the consensus algorithm.\n virtual CHECKED_STATUS Start(const ConsensusBootstrapInfo& info) = 0;\n\n // Returns true if consensus is running.\n virtual bool IsRunning() const = 0;\n\n // Emulates a leader election by simply making this peer leader.\n virtual CHECKED_STATUS EmulateElection() = 0;\n\n virtual CHECKED_STATUS StartElection(const LeaderElectionData& data) = 0;\n\n // We tried to step down, so you protege become leader.\n // But it failed to win election, so we should reset our withhold time and try to reelect ourself.\n // election_lost_by_uuid - uuid of protege that lost election.\n virtual CHECKED_STATUS ElectionLostByProtege(const std::string& election_lost_by_uuid) = 0;\n\n // Implement a LeaderStepDown() request.\n virtual CHECKED_STATUS StepDown(const LeaderStepDownRequestPB* req,\n LeaderStepDownResponsePB* resp) {\n return STATUS(NotSupported, \"Not implemented.\");\n }\n\n // Wait until the node has LEADER role.\n // Returns Status::TimedOut if the role is not LEADER within 'timeout'.\n virtual CHECKED_STATUS WaitUntilLeaderForTests(const MonoDelta& timeout) = 0;\n\n // Creates a new ConsensusRound, the entity that owns all the data\n // structures required for a consensus round, such as the ReplicateMsg.\n // ConsensusRound will also point to and increase the reference count for the provided callbacks.\n ConsensusRoundPtr NewRound(\n ReplicateMsgPtr replicate_msg,\n const ConsensusReplicatedCallback& replicated_cb);\n\n // Called by a Leader to replicate an entry to the state machine.\n //\n // From the leader instance perspective execution proceeds as follows:\n //\n // Leader RaftConfig\n // + +\n // 1) Req->| Replicate() |\n // | |\n // 2) +-------------replicate-------------->|\n // |<---------------ACK------------------+\n // | |\n // 3) +--+ |\n // <----+ round.NotifyReplicationFinished()|\n // | |\n // 3a) | +------ update commitIndex ------->|\n // | |\n //\n // 1) Caller calls Replicate(), method returns immediately to the caller and\n // runs asynchronously.\n //\n // 2) Leader replicates the entry to the peers using the consensus\n // algorithm, proceeds as soon as a majority of voters acknowledges the\n // entry.\n //\n // 3) Leader defers to the caller by calling ConsensusRound::NotifyReplicationFinished,\n // which calls the ConsensusReplicatedCallback.\n //\n // 3a) The leader asynchronously notifies other peers of the new\n // commit index, which tells them to apply the operation.\n //\n // This method can only be called on the leader, i.e. role() == LEADER\n\n virtual CHECKED_STATUS TEST_Replicate(const ConsensusRoundPtr& round) = 0;\n\n // A batch version of Replicate, which is what we try to use as much as possible for performance.\n virtual CHECKED_STATUS ReplicateBatch(ConsensusRounds* rounds) = 0;\n\n // Messages sent from LEADER to FOLLOWERS and LEARNERS to update their\n // state machines. This is equivalent to \"AppendEntries()\" in Raft\n // terminology.\n //\n // ConsensusRequestPB contains a sequence of 0 or more operations to apply\n // on the replica. If there are 0 operations the request is considered\n // 'status-only' i.e. the leader is communicating with the follower only\n // in order to pass back and forth information on watermarks (eg committed\n // operation ID, replicated op id, etc).\n //\n // If the sequence contains 1 or more operations they will be replicated\n // in the same order as the leader, and submitted for asynchronous Prepare\n // in the same order.\n //\n // The leader also provides information on the index of the latest\n // operation considered committed by consensus. The replica uses this\n // information to update the state of any pending (previously replicated/prepared)\n // transactions.\n //\n // Returns Status::OK if the response has been filled (regardless of accepting\n // or rejecting the specific request). Returns non-OK Status if a specific\n // error response could not be formed, which will result in the service\n // returning an UNKNOWN_ERROR RPC error code to the caller and including the\n // stringified Status message.\n virtual CHECKED_STATUS Update(\n ConsensusRequestPB* request,\n ConsensusResponsePB* response,\n CoarseTimePoint deadline) = 0;\n\n // Messages sent from CANDIDATEs to voting peers to request their vote\n // in leader election.\n virtual CHECKED_STATUS RequestVote(const VoteRequestPB* request,\n VoteResponsePB* response) = 0;\n\n // Implement a ChangeConfig() request.\n virtual CHECKED_STATUS ChangeConfig(const ChangeConfigRequestPB& req,\n const StdStatusCallback& client_cb,\n boost::optional* error) {\n return STATUS(NotSupported, \"Not implemented.\");\n }\n\n // Returns the current Raft role of this instance.\n virtual RaftPeerPB::Role role() const = 0;\n\n // Returns the leader status (see LeaderStatus type description for details).\n // If leader is ready, then also returns term, otherwise OpId::kUnknownTerm is returned.\n //\n // allow_stale could be used to avoid refreshing cache, when we are OK to read slightly outdated\n // value.\n virtual LeaderState GetLeaderState(bool allow_stale = false) const = 0;\n\n LeaderStatus GetLeaderStatus(bool allow_stale = false) const;\n int64_t LeaderTerm() const;\n\n // Returns the uuid of this peer.\n virtual std::string peer_uuid() const = 0;\n\n // Returns the id of the tablet whose updates this consensus instance helps coordinate.\n virtual std::string tablet_id() const = 0;\n\n // Returns a copy of the committed state of the Consensus system. Also allows returning the\n // leader lease status captured under the same lock.\n virtual ConsensusStatePB ConsensusState(\n ConsensusConfigType type,\n LeaderLeaseStatus* leader_lease_status = nullptr) const = 0;\n\n // Returns a copy of the committed state of the Consensus system, assuming caller holds the needed\n // locks.\n virtual ConsensusStatePB ConsensusStateUnlocked(\n ConsensusConfigType type,\n LeaderLeaseStatus* leader_lease_status = nullptr) const = 0;\n\n // Returns a copy of the current committed Raft configuration.\n virtual RaftConfigPB CommittedConfig() const = 0;\n\n virtual void DumpStatusHtml(std::ostream& out) const = 0;\n\n void SetFaultHooks(const std::shared_ptr& hooks);\n\n const std::shared_ptr& GetFaultHooks() const;\n\n // Stops running the consensus algorithm.\n virtual void Shutdown() = 0;\n\n // Returns the last OpId (either received or committed, depending on the 'type' argument) that the\n // Consensus implementation knows about. Primarily used for testing purposes.\n Result GetLastOpId(OpIdType type);\n\n virtual yb::OpId GetLastReceivedOpId() = 0;\n\n virtual yb::OpId GetLastCommittedOpId() = 0;\n\n virtual yb::OpId GetLastAppliedOpId() = 0;\n\n // Return the ID of the split operation requesting to split this Raft group if it has been added\n // to Raft log and uninitialized OpId otherwise.\n virtual yb::OpId GetSplitOpId() = 0;\n\n // Assuming we are the leader, wait until we have a valid leader lease (i.e. the old leader's\n // lease has expired, and we have replicated a new lease that has not expired yet).\n virtual CHECKED_STATUS WaitForLeaderLeaseImprecise(CoarseTimePoint deadline) = 0;\n\n // Check that this Consensus is a leader and has lease, returns Status::OK in this case.\n // Otherwise error status is returned.\n virtual CHECKED_STATUS CheckIsActiveLeaderAndHasLease() const = 0;\n\n // Returns majority replicated ht lease, so we know that after leader change\n // operations would not be added with hybrid time below this lease.\n //\n // `min_allowed` - result should be greater or equal to `min_allowed`, otherwise\n // it tries to wait until ht lease reaches this value or `deadline` happens.\n //\n // Returns 0 if timeout happened.\n virtual MicrosTime MajorityReplicatedHtLeaseExpiration(\n MicrosTime min_allowed, CoarseTimePoint deadline) const = 0;\n\n // Read majority replicated messages for CDC producer.\n virtual Result ReadReplicatedMessagesForCDC(const yb::OpId& from,\n int64_t* repl_index) = 0;\n\n virtual void UpdateCDCConsumerOpId(const yb::OpId& op_id) = 0;\n\n protected:\n friend class RefCountedThreadSafe;\n friend class tablet::TabletPeer;\n friend class master::SysCatalogTable;\n\n\n // Fault hooks for tests. In production code this will always be null.\n std::shared_ptr fault_hooks_;\n\n enum HookPoint {\n PRE_START,\n POST_START,\n PRE_CONFIG_CHANGE,\n POST_CONFIG_CHANGE,\n PRE_REPLICATE,\n POST_REPLICATE,\n PRE_COMMIT,\n POST_COMMIT,\n PRE_UPDATE,\n POST_UPDATE,\n PRE_SHUTDOWN,\n POST_SHUTDOWN\n };\n\n CHECKED_STATUS ExecuteHook(HookPoint point);\n\n enum State {\n kNotInitialized,\n kInitializing,\n kConfiguring,\n kRunning,\n };\n\n private:\n DISALLOW_COPY_AND_ASSIGN(Consensus);\n};\n\nYB_DEFINE_ENUM(StateChangeReason,\n (INVALID_REASON)\n (TABLET_PEER_STARTED)\n (CONSENSUS_STARTED)\n (NEW_LEADER_ELECTED)\n (FOLLOWER_NO_OP_COMPLETE)\n (LEADER_CONFIG_CHANGE_COMPLETE)\n (FOLLOWER_CONFIG_CHANGE_COMPLETE));\n\n// Context provided for callback on master/tablet-server peer state change for post processing\n// e.g., update in-memory contents.\nstruct StateChangeContext {\n\n const StateChangeReason reason;\n\n explicit StateChangeContext(StateChangeReason in_reason)\n : reason(in_reason) {\n }\n\n StateChangeContext(StateChangeReason in_reason, bool is_locked)\n : reason(in_reason),\n is_config_locked_(is_locked) {\n }\n\n StateChangeContext(StateChangeReason in_reason, string uuid)\n : reason(in_reason),\n new_leader_uuid(uuid) {\n }\n\n StateChangeContext(StateChangeReason in_reason,\n ChangeConfigRecordPB change_rec,\n string remove = \"\")\n : reason(in_reason),\n change_record(change_rec),\n remove_uuid(remove) {\n }\n\n bool is_config_locked() const {\n return is_config_locked_;\n }\n\n ~StateChangeContext() {}\n\n std::string ToString() const {\n switch (reason) {\n case StateChangeReason::TABLET_PEER_STARTED:\n return \"Started TabletPeer\";\n case StateChangeReason::CONSENSUS_STARTED:\n return \"RaftConsensus started\";\n case StateChangeReason::NEW_LEADER_ELECTED:\n return strings::Substitute(\"New leader $0 elected\", new_leader_uuid);\n case StateChangeReason::FOLLOWER_NO_OP_COMPLETE:\n return \"Replicate of NO_OP complete on follower\";\n case StateChangeReason::LEADER_CONFIG_CHANGE_COMPLETE:\n return strings::Substitute(\"Replicated change config $0 round complete on leader\",\n change_record.ShortDebugString());\n case StateChangeReason::FOLLOWER_CONFIG_CHANGE_COMPLETE:\n return strings::Substitute(\"Config change $0 complete on follower\",\n change_record.ShortDebugString());\n case StateChangeReason::INVALID_REASON: FALLTHROUGH_INTENDED;\n default:\n return \"INVALID REASON\";\n }\n }\n\n // Auxiliary info for some of the reasons above.\n // Value is filled when the change reason is NEW_LEADER_ELECTED.\n const string new_leader_uuid;\n\n // Value is filled when the change reason is LEADER/FOLLOWER_CONFIG_CHANGE_COMPLETE.\n const ChangeConfigRecordPB change_record;\n\n // Value is filled when the change reason is LEADER_CONFIG_CHANGE_COMPLETE\n // and it is a REMOVE_SERVER, then that server's uuid is saved here by the master leader.\n const string remove_uuid;\n\n // If this is true, the call-stack above has taken the lock for the raft consensus state. Needed\n // in SysCatalogStateChanged for master to not re-get the lock. Not used for tserver callback.\n // Note that the state changes using the UpdateConsensus() mechanism always hold the lock, so\n // defaulting to true as they are majority. For ones that do not hold the lock, setting\n // it to false in their constructor suffices currently, so marking it const.\n const bool is_config_locked_ = true;\n};\n\n// Context for a consensus round on the LEADER side, typically created as an\n// out-parameter of Consensus::Append.\n// This class is ref-counted because we want to ensure it stays alive for the\n// duration of the Operation when it is associated with a Operation, while\n// we also want to ensure it has a proper lifecycle when a ConsensusRound is\n// pushed that is not associated with a Tablet transaction.\nclass ConsensusRound : public RefCountedThreadSafe {\n public:\n static constexpr int64_t kUnboundTerm = -1;\n\n // Ctor used for leader transactions. Leader transactions can and must specify the\n // callbacks prior to initiating the consensus round.\n ConsensusRound(Consensus* consensus,\n ReplicateMsgPtr replicate_msg,\n ConsensusReplicatedCallback replicated_cb);\n\n // Ctor used for follower/learner transactions. These transactions do not use the\n // replicate callback and the commit callback is set later, after the transaction\n // is actually started.\n ConsensusRound(Consensus* consensus, ReplicateMsgPtr replicate_msg);\n\n std::string ToString() const {\n return replicate_msg_->ShortDebugString();\n }\n\n const ReplicateMsgPtr& replicate_msg() {\n return replicate_msg_;\n }\n\n // Returns the id of the (replicate) operation this context\n // refers to. This is only set _after_ Consensus::Replicate(context).\n OpIdPB id() const {\n return replicate_msg_->id();\n }\n\n // Register a callback that is called by Consensus to notify that the round\n // is considered either replicated, if 'status' is OK(), or that it has\n // permanently failed to replicate if 'status' is anything else. If 'status'\n // is OK() then the operation can be applied to the state machine, otherwise\n // the operation should be aborted.\n void SetConsensusReplicatedCallback(ConsensusReplicatedCallback replicated_cb) {\n replicated_cb_ = std::move(replicated_cb);\n }\n\n void SetAppendCallback(ConsensusAppendCallback* append_cb) {\n append_cb_ = append_cb;\n }\n\n ConsensusAppendCallback* append_callback() {\n return append_cb_;\n }\n\n // If a continuation was set, notifies it that the round has been replicated.\n void NotifyReplicationFinished(\n const Status& status, int64_t leader_term, OpIds* applied_op_ids);\n\n // Binds this round such that it may not be eventually executed in any term\n // other than 'term'.\n // See CheckBoundTerm().\n void BindToTerm(int64_t term) {\n DCHECK_EQ(bound_term_, kUnboundTerm);\n bound_term_ = term;\n }\n\n // Check for a rare race in which an operation is submitted to the LEADER in some term,\n // then before the operation is prepared, the replica loses its leadership, receives\n // more operations as a FOLLOWER, and then regains its leadership. We detect this case\n // by setting the ConsensusRound's \"bound term\" when it is first submitted to the\n // PREPARE queue, and validate that the term is still the same when we have finished\n // preparing it. See KUDU-597 for details.\n //\n // If this round has not been bound to any term, this is a no-op.\n CHECKED_STATUS CheckBoundTerm(int64_t current_term) const;\n\n int64_t bound_term() { return bound_term_; }\n\n private:\n friend class RaftConsensusQuorumTest;\n friend class RefCountedThreadSafe;\n\n ~ConsensusRound() {}\n\n Consensus* consensus_;\n // This round's replicate message.\n ReplicateMsgPtr replicate_msg_;\n\n // The continuation that will be called once the transaction is\n // deemed committed/aborted by consensus.\n ConsensusReplicatedCallback replicated_cb_;\n\n // The leader term that this round was submitted in. CheckBoundTerm()\n // ensures that, when it is eventually replicated, the term has not\n // changed in the meantime.\n //\n // Set to -1 if no term has been bound.\n int64_t bound_term_ = kUnboundTerm;\n\n ConsensusAppendCallback* append_cb_ = nullptr;\n};\n\nclass Consensus::ConsensusFaultHooks {\n public:\n virtual CHECKED_STATUS PreStart() { return Status::OK(); }\n virtual CHECKED_STATUS PostStart() { return Status::OK(); }\n virtual CHECKED_STATUS PreConfigChange() { return Status::OK(); }\n virtual CHECKED_STATUS PostConfigChange() { return Status::OK(); }\n virtual CHECKED_STATUS PreReplicate() { return Status::OK(); }\n virtual CHECKED_STATUS PostReplicate() { return Status::OK(); }\n virtual CHECKED_STATUS PreUpdate() { return Status::OK(); }\n virtual CHECKED_STATUS PostUpdate() { return Status::OK(); }\n virtual CHECKED_STATUS PreShutdown() { return Status::OK(); }\n virtual CHECKED_STATUS PostShutdown() { return Status::OK(); }\n virtual ~ConsensusFaultHooks() {}\n};\n\nclass SafeOpIdWaiter {\n public:\n virtual yb::OpId WaitForSafeOpIdToApply(const yb::OpId& op_id) = 0;\n\n protected:\n ~SafeOpIdWaiter() {}\n};\n\nstruct LeaderState {\n LeaderStatus status;\n int64_t term;\n MonoDelta remaining_old_leader_lease;\n\n LeaderState& MakeNotReadyLeader(LeaderStatus status);\n\n bool ok() const {\n return status == LeaderStatus::LEADER_AND_READY;\n }\n\n CHECKED_STATUS CreateStatus() const;\n};\n\ninline CHECKED_STATUS MoveStatus(LeaderState&& state) {\n return state.CreateStatus();\n}\n\n} // namespace consensus\n} // namespace yb\n\n#endif // YB_CONSENSUS_CONSENSUS_H_\n"} +{"text": "// This file is part of Eigen, a lightweight C++ template library\n// for linear algebra.\n//\n// Copyright (C) 2008-2014 Gael Guennebaud \n// Copyright (C) 2006-2008 Benoit Jacob \n//\n// This Source Code Form is subject to the terms of the Mozilla\n// Public License v. 2.0. If a copy of the MPL was not distributed\n// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n#ifndef EIGEN_CWISE_UNARY_OP_H\n#define EIGEN_CWISE_UNARY_OP_H\n\nnamespace Eigen { \n\nnamespace internal {\ntemplate\nstruct traits >\n : traits\n{\n typedef typename result_of<\n UnaryOp(const typename XprType::Scalar&)\n >::type Scalar;\n typedef typename XprType::Nested XprTypeNested;\n typedef typename remove_reference::type _XprTypeNested;\n enum {\n Flags = _XprTypeNested::Flags & RowMajorBit \n };\n};\n}\n\ntemplate\nclass CwiseUnaryOpImpl;\n\n/** \\class CwiseUnaryOp\n * \\ingroup Core_Module\n *\n * \\brief Generic expression where a coefficient-wise unary operator is applied to an expression\n *\n * \\tparam UnaryOp template functor implementing the operator\n * \\tparam XprType the type of the expression to which we are applying the unary operator\n *\n * This class represents an expression where a unary operator is applied to an expression.\n * It is the return type of all operations taking exactly 1 input expression, regardless of the\n * presence of other inputs such as scalars. For example, the operator* in the expression 3*matrix\n * is considered unary, because only the right-hand side is an expression, and its\n * return type is a specialization of CwiseUnaryOp.\n *\n * Most of the time, this is the only way that it is used, so you typically don't have to name\n * CwiseUnaryOp types explicitly.\n *\n * \\sa MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp\n */\ntemplate\nclass CwiseUnaryOp : public CwiseUnaryOpImpl::StorageKind>, internal::no_assignment_operator\n{\n public:\n\n typedef typename CwiseUnaryOpImpl::StorageKind>::Base Base;\n EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp)\n typedef typename internal::ref_selector::type XprTypeNested;\n typedef typename internal::remove_all::type NestedExpression;\n\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE\n explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp())\n : m_xpr(xpr), m_functor(func) {}\n\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE\n Index rows() const { return m_xpr.rows(); }\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE\n Index cols() const { return m_xpr.cols(); }\n\n /** \\returns the functor representing the unary operation */\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE\n const UnaryOp& functor() const { return m_functor; }\n\n /** \\returns the nested expression */\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE\n const typename internal::remove_all::type&\n nestedExpression() const { return m_xpr; }\n\n /** \\returns the nested expression */\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE\n typename internal::remove_all::type&\n nestedExpression() { return m_xpr; }\n\n protected:\n XprTypeNested m_xpr;\n const UnaryOp m_functor;\n};\n\n// Generic API dispatcher\ntemplate\nclass CwiseUnaryOpImpl\n : public internal::generic_xpr_base >::type\n{\npublic:\n typedef typename internal::generic_xpr_base >::type Base;\n};\n\n} // end namespace Eigen\n\n#endif // EIGEN_CWISE_UNARY_OP_H\n"} +{"text": "/*\n * Copyright 2016 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include \n#include \n\n#include \n#include \n#include \n#include \n#include \n\n#include \n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n\n// In general, emutls cleanup is not guaranteed to play nice with the way\n// StaticMeta mixes direct pthread calls and the use of __thread. This has\n// caused problems on multiple platforms so don't use __thread there.\n//\n// XXX: Ideally we would instead determine if emutls is in use at runtime as it\n// is possible to configure glibc on Linux to use emutls regardless.\n#if !FOLLY_MOBILE && !defined(__APPLE__) && !defined(_MSC_VER)\n#define FOLLY_TLD_USE_FOLLY_TLS 1\n#else\n#undef FOLLY_TLD_USE_FOLLY_TLS\n#endif\n\nnamespace folly {\nnamespace threadlocal_detail {\n\n/**\n * POD wrapper around an element (a void*) and an associated deleter.\n * This must be POD, as we memset() it to 0 and memcpy() it around.\n */\nstruct ElementWrapper {\n using DeleterFunType = void(void*, TLPDestructionMode);\n\n bool dispose(TLPDestructionMode mode) {\n if (ptr == nullptr) {\n return false;\n }\n\n DCHECK(deleter1 != nullptr);\n ownsDeleter ? (*deleter2)(ptr, mode) : (*deleter1)(ptr, mode);\n cleanup();\n return true;\n }\n\n void* release() {\n auto retPtr = ptr;\n\n if (ptr != nullptr) {\n cleanup();\n }\n\n return retPtr;\n }\n\n template \n void set(Ptr p) {\n auto guard = makeGuard([&] { delete p; });\n DCHECK(ptr == nullptr);\n DCHECK(deleter1 == nullptr);\n\n if (p) {\n ptr = p;\n deleter1 = [](void* pt, TLPDestructionMode) {\n delete static_cast(pt);\n };\n ownsDeleter = false;\n guard.dismiss();\n }\n }\n\n template \n void set(Ptr p, const Deleter& d) {\n auto guard = makeGuard([&] {\n if (p) {\n d(p, TLPDestructionMode::THIS_THREAD);\n }\n });\n DCHECK(ptr == nullptr);\n DCHECK(deleter2 == nullptr);\n if (p) {\n ptr = p;\n auto d2 = d; // gcc-4.8 doesn't decay types correctly in lambda captures\n deleter2 = new std::function(\n [d2](void* pt, TLPDestructionMode mode) {\n d2(static_cast(pt), mode);\n });\n ownsDeleter = true;\n guard.dismiss();\n }\n }\n\n void cleanup() {\n if (ownsDeleter) {\n delete deleter2;\n }\n ptr = nullptr;\n deleter1 = nullptr;\n ownsDeleter = false;\n }\n\n void* ptr;\n union {\n DeleterFunType* deleter1;\n std::function* deleter2;\n };\n bool ownsDeleter;\n};\n\nstruct StaticMetaBase;\n\n/**\n * Per-thread entry. Each thread using a StaticMeta object has one.\n * This is written from the owning thread only (under the lock), read\n * from the owning thread (no lock necessary), and read from other threads\n * (under the lock).\n */\nstruct ThreadEntry {\n ElementWrapper* elements{nullptr};\n size_t elementsCapacity{0};\n ThreadEntry* next{nullptr};\n ThreadEntry* prev{nullptr};\n StaticMetaBase* meta{nullptr};\n};\n\nconstexpr uint32_t kEntryIDInvalid = std::numeric_limits::max();\n\nstruct PthreadKeyUnregisterTester;\n\n/**\n * We want to disable onThreadExit call at the end of shutdown, we don't care\n * about leaking memory at that point.\n *\n * Otherwise if ThreadLocal is used in a shared library, onThreadExit may be\n * called after dlclose().\n *\n * This class has one single static instance; however since it's so widely used,\n * directly or indirectly, by so many classes, we need to take care to avoid\n * problems stemming from the Static Initialization/Destruction Order Fiascos.\n * Therefore this class needs to be constexpr-constructible, so as to avoid\n * the need for this to participate in init/destruction order.\n */\nclass PthreadKeyUnregister {\n public:\n static constexpr size_t kMaxKeys = 1UL << 16;\n\n ~PthreadKeyUnregister() {\n // If static constructor priorities are not supported then\n // ~PthreadKeyUnregister logic is not safe.\n#if !defined(__APPLE__) && !defined(_MSC_VER)\n MSLGuard lg(lock_);\n while (size_) {\n pthread_key_delete(keys_[--size_]);\n }\n#endif\n }\n\n static void registerKey(pthread_key_t key) {\n instance_.registerKeyImpl(key);\n }\n\n private:\n /**\n * Only one global instance should exist, hence this is private.\n * See also the important note at the top of this class about `constexpr`\n * usage.\n */\n constexpr PthreadKeyUnregister() : lock_(), size_(0), keys_() { }\n friend struct folly::threadlocal_detail::PthreadKeyUnregisterTester;\n\n void registerKeyImpl(pthread_key_t key) {\n MSLGuard lg(lock_);\n if (size_ == kMaxKeys) {\n throw std::logic_error(\"pthread_key limit has already been reached\");\n }\n keys_[size_++] = key;\n }\n\n MicroSpinLock lock_;\n size_t size_;\n pthread_key_t keys_[kMaxKeys];\n\n static PthreadKeyUnregister instance_;\n};\n\nstruct StaticMetaBase {\n // Represents an ID of a thread local object. Initially set to the maximum\n // uint. This representation allows us to avoid a branch in accessing TLS data\n // (because if you test capacity > id if id = maxint then the test will always\n // fail). It allows us to keep a constexpr constructor and avoid SIOF.\n class EntryID {\n public:\n std::atomic value;\n\n constexpr EntryID() : value(kEntryIDInvalid) {\n }\n\n EntryID(EntryID&& other) noexcept : value(other.value.load()) {\n other.value = kEntryIDInvalid;\n }\n\n EntryID& operator=(EntryID&& other) {\n assert(this != &other);\n value = other.value.load();\n other.value = kEntryIDInvalid;\n return *this;\n }\n\n EntryID(const EntryID& other) = delete;\n EntryID& operator=(const EntryID& other) = delete;\n\n uint32_t getOrInvalid() {\n // It's OK for this to be relaxed, even though we're effectively doing\n // double checked locking in using this value. We only care about the\n // uniqueness of IDs, getOrAllocate does not modify any other memory\n // this thread will use.\n return value.load(std::memory_order_relaxed);\n }\n\n uint32_t getOrAllocate(StaticMetaBase& meta) {\n uint32_t id = getOrInvalid();\n if (id != kEntryIDInvalid) {\n return id;\n }\n // The lock inside allocate ensures that a single value is allocated\n return meta.allocate(this);\n }\n };\n\n explicit StaticMetaBase(ThreadEntry* (*threadEntry)());\n\n ~StaticMetaBase() {\n LOG(FATAL) << \"StaticMeta lives forever!\";\n }\n\n void push_back(ThreadEntry* t) {\n t->next = &head_;\n t->prev = head_.prev;\n head_.prev->next = t;\n head_.prev = t;\n }\n\n void erase(ThreadEntry* t) {\n t->next->prev = t->prev;\n t->prev->next = t->next;\n t->next = t->prev = t;\n }\n\n static void onThreadExit(void* ptr);\n\n uint32_t allocate(EntryID* ent);\n\n void destroy(EntryID* ent);\n\n /**\n * Reserve enough space in the ThreadEntry::elements for the item\n * @id to fit in.\n */\n void reserve(EntryID* id);\n\n ElementWrapper& get(EntryID* ent);\n\n static void initAtFork();\n static void registerAtFork(\n folly::Function prepare,\n folly::Function parent,\n folly::Function child);\n\n uint32_t nextId_;\n std::vector freeIds_;\n std::mutex lock_;\n pthread_key_t pthreadKey_;\n ThreadEntry head_;\n ThreadEntry* (*threadEntry_)();\n};\n\n// Held in a singleton to track our global instances.\n// We have one of these per \"Tag\", by default one for the whole system\n// (Tag=void).\n//\n// Creating and destroying ThreadLocalPtr objects, as well as thread exit\n// for threads that use ThreadLocalPtr objects collide on a lock inside\n// StaticMeta; you can specify multiple Tag types to break that lock.\ntemplate \nstruct StaticMeta : StaticMetaBase {\n StaticMeta() : StaticMetaBase(&StaticMeta::getThreadEntrySlow) {\n registerAtFork(\n /*prepare*/ &StaticMeta::preFork,\n /*parent*/ &StaticMeta::onForkParent,\n /*child*/ &StaticMeta::onForkChild);\n }\n\n static StaticMeta& instance() {\n // Leak it on exit, there's only one per process and we don't have to\n // worry about synchronization with exiting threads.\n static auto instance = detail::createGlobal, void>();\n return *instance;\n }\n\n ElementWrapper& get(EntryID* ent) {\n ThreadEntry* threadEntry = getThreadEntry();\n uint32_t id = ent->getOrInvalid();\n // if id is invalid, it is equal to uint32_t's max value.\n // x <= max value is always true\n if (UNLIKELY(threadEntry->elementsCapacity <= id)) {\n reserve(ent);\n id = ent->getOrInvalid();\n assert(threadEntry->elementsCapacity > id);\n }\n return threadEntry->elements[id];\n }\n\n static ThreadEntry* getThreadEntrySlow() {\n auto& meta = instance();\n auto key = meta.pthreadKey_;\n ThreadEntry* threadEntry =\n static_cast(pthread_getspecific(key));\n if (!threadEntry) {\n#ifdef FOLLY_TLD_USE_FOLLY_TLS\n static FOLLY_TLS ThreadEntry threadEntrySingleton;\n threadEntry = &threadEntrySingleton;\n#else\n threadEntry = new ThreadEntry();\n#endif\n threadEntry->meta = &meta;\n int ret = pthread_setspecific(key, threadEntry);\n checkPosixError(ret, \"pthread_setspecific failed\");\n }\n return threadEntry;\n }\n\n inline static ThreadEntry* getThreadEntry() {\n#ifdef FOLLY_TLD_USE_FOLLY_TLS\n static FOLLY_TLS ThreadEntry* threadEntryCache{nullptr};\n if (UNLIKELY(threadEntryCache == nullptr)) {\n threadEntryCache = instance().threadEntry_();\n }\n return threadEntryCache;\n#else\n return instance().threadEntry_();\n#endif\n }\n\n static void preFork(void) {\n instance().lock_.lock(); // Make sure it's created\n }\n\n static void onForkParent(void) { instance().lock_.unlock(); }\n\n static void onForkChild(void) {\n // only the current thread survives\n instance().head_.next = instance().head_.prev = &instance().head_;\n ThreadEntry* threadEntry = getThreadEntry();\n // If this thread was in the list before the fork, add it back.\n if (threadEntry->elementsCapacity != 0) {\n instance().push_back(threadEntry);\n }\n instance().lock_.unlock();\n }\n};\n\n} // namespace threadlocal_detail\n} // namespace folly\n"} +{"text": "= Name =\n\n'''ngx_headers_more''' - Set and clear input and output headers...more than \"add\"!\n\n''This module is not distributed with the Nginx source.'' See [[#Installation|the installation instructions]].\n\n= Version =\n\nThis document describes headers-more-nginx-module [http://github.com/agentzh/headers-more-nginx-module/tags v0.24] released on 14 December 2013.\n\n= Synopsis =\n\n\n # set the Server output header\n more_set_headers 'Server: my-server';\n\n # set and clear output headers\n location /bar {\n more_set_headers 'X-MyHeader: blah' 'X-MyHeader2: foo';\n more_set_headers -t 'text/plain text/css' 'Content-Type: text/foo';\n more_set_headers -s '400 404 500 503' -s 413 'Foo: Bar';\n more_clear_headers 'Content-Type';\n \n # your proxy_pass/memcached_pass/or any other config goes here...\n }\n\n # set output headers\n location /type {\n more_set_headers 'Content-Type: text/plain';\n # ...\n }\n\n # set input headers\n location /foo {\n set $my_host 'my dog';\n more_set_input_headers 'Host: $my_host';\n more_set_input_headers -t 'text/plain' 'X-Foo: bah';\n \n # now $host and $http_host have their new values...\n # ...\n }\n\n # replace input header X-Foo *only* if it already exists\n more_set_input_headers -r 'X-Foo: howdy';\n\n\n= Description =\n\nThis module allows you to add, set, or clear any output\nor input header that you specify.\n\nThis is an enhanced version of the standard\n[[HttpHeadersModule|headers]] module because it provides more utilities like\nresetting or clearing \"builtin headers\" like Content-Type,\nContent-Length, and Server.\n\nIt also allows you to specify an optional HTTP status code\ncriteria using the -s option and an optional content\ntype criteria using the -t option while modifying the\noutput headers with the [[#more_set_headers|more_set_headers]] and\n[[#more_clear_headers|more_clear_headers]] directives. For example,\n\n\n more_set_headers -s 404 -t 'text/html' 'X-Foo: Bar';\n\n\nInput headers can be modified as well. For example\n\n\n location /foo {\n more_set_input_headers 'Host: foo' 'User-Agent: faked';\n # now $host, $http_host, $user_agent, and\n # $http_user_agent all have their new values.\n }\n\n\nThe option -t is also available in the\n[[#more_set_input_headers|more_set_input_headers]] and\n[[#more_clear_input_headers|more_clear_input_headers]] directives (for request header filtering) while the -s option\nis not allowed.\n\nUnlike the standard [[HttpHeadersModule|headers]] module, this module's directives will by\ndefault apply to all the status codes, including 4xx and 5xx.\n\n= Directives =\n\n== more_set_headers ==\n'''syntax:''' ''more_set_headers [-t ]... [-s ]... ...''\n\n'''default:''' ''no''\n\n'''context:''' ''http, server, location, location if''\n\n'''phase:''' ''output-header-filter''\n\nAdds or replaces the specified output headers when the response status code matches the codes specified by the -s option ''AND'' the response content type matches the types specified by the -t option.\n\nIf either -s or -t is not specified or has an empty list value, then no match is required. Therefore, the following directive set the Server output header to the custom value for ''any'' status code and ''any'' content type:\n\n\n more_set_headers \"Server: my_server\";\n\n\nA single directive can set/add multiple output headers. For example\n\n\n more_set_headers 'Foo: bar' 'Baz: bah';\n\n\nMultiple occurrences of the options are allowed in a single directive. Their values will be merged together. For instance\n\n\n more_set_headers -s 404 -s '500 503' 'Foo: bar';\n\n\nis equivalent to\n\n\n more_set_headers -s '404 500 503' 'Foo: bar';\n\n\nThe new header should be the one of the forms:\n\n# Name: Value\n# Name: \n# Name\n\nThe last two effectively clear the value of the header Name.\n\nNginx variables are allowed in header values. For example:\n\n\n set $my_var \"dog\";\n more_set_headers \"Server: $my_var\";\n\n\nBut variables won't work in header keys due to performance considerations.\n\nMultiple set/clear header directives are allowed in a single location, and they're executed sequentially.\n\nDirectives inherited from an upper level scope (say, http block or server blocks) are executed before the directives in the location block.\n\nNote that although more_set_headers is allowed in ''location'' if blocks, it is ''not'' allowed in the ''server'' if blocks, as in\n\n\n ? # This is NOT allowed!\n ? server {\n ? if ($args ~ 'download') {\n ? more_set_headers 'Foo: Bar';\n ? }\n ? ...\n ? }\n\n\nBehind the scene, use of this directive and its friend [[#more_clear_headers|more_clear_headers]] will (lazily) register an ouput header filter that modifies r->headers_out the way you specify.\n\n== more_clear_headers ==\n'''syntax:''' ''more_clear_headers [-t ]... [-s ]... ...''\n\n'''default:''' ''no''\n\n'''context:''' ''http, server, location, location if''\n\n'''phase:''' ''output-header-filter''\n\nClears the specified output headers.\n\nIn fact,\n\n\n more_clear_headers -s 404 -t 'text/plain' Foo Baz;\n\n\nis exactly equivalent to\n\n\n more_set_headers -s 404 -t 'text/plain' \"Foo: \" \"Baz: \";\n\n\nor\n\n\n more_set_headers -s 404 -t 'text/plain' Foo Baz\n\n\nSee [[#more_set_headers|more_set_headers]] for more details.\n\nWildcard * can also be used to specify a header name pattern. For example, the following directive effectively clears ''any'' output headers starting by \"X-Hidden-\":\n\n\n more_clear_headers 'X-Hidden-*';\n\n\nThe * wildcard support was first introduced in [[#v0.09|v0.09]].\n\n== more_set_input_headers ==\n'''syntax:''' ''more_set_input_headers [-r] [-t ]... ...''\n\n'''default:''' ''no''\n\n'''context:''' ''http, server, location, location if''\n\n'''phase:''' ''rewrite tail''\n\nVery much like [[#more_set_headers|more_set_headers]] except that it operates on input headers (or request headers) and it only supports the -t option.\n\nNote that using the -t option in this directive means filtering by the Content-Type ''request'' header, rather than the response header.\n\nBehind the scene, use of this directive and its friend [[#more_clear_input_headers|more_clear_input_headers]] will (lazily) register a rewrite phase handler that modifies r->headers_in the way you specify. Note that it always run at the ''end'' of the rewrite so that it runs ''after'' the standard [[HttpRewriteModule|rewrite module]] and works in subrequests as well.\n\nIf the -r option is specified, then the headers will be replaced to the new values ''only if'' they already exist.\n\n== more_clear_input_headers ==\n'''syntax:''' ''more_clear_input_headers [-t ]... ...''\n\n'''default:''' ''no''\n\n'''context:''' ''http, server, location, location if''\n\n'''phase:''' ''rewrite tail''\n\nClears the specified input headers.\n\nIn fact,\n\n\n more_clear_input_headers -s 404 -t 'text/plain' Foo Baz;\n\n\nis exactly equivalent to\n\n\n more_set_input_headers -s 404 -t 'text/plain' \"Foo: \" \"Baz: \";\n\n\nor\n\n\n more_set_input_headers -s 404 -t 'text/plain' Foo Baz\n\n\nSee [[#more_set_input_headers|more_set_input_headers]] for more details.\n\n= Limitations =\n\n* Unlike the standard [[HttpHeadersModule|headers]] module, this module does not automatically take care of the constraint among the Expires, Cache-Control, and Last-Modified headers. You have to get them right yourself or use the [[HttpHeadersModule|headers]] module together with this module.\n\n= Installation =\n\nGrab the nginx source code from [http://nginx.org/ nginx.org], for example,\nthe version 1.4.4 (see [[#Compatibility|nginx compatibility]]), and then build the source with this module:\n\n\n wget 'http://nginx.org/download/nginx-1.4.4.tar.gz'\n tar -xzvf nginx-1.4.4.tar.gz\n cd nginx-1.4.4/\n \n # Here we assume you would install you nginx under /opt/nginx/.\n ./configure --prefix=/opt/nginx \\\n --add-module=/path/to/headers-more-nginx-module\n \n make\n make install\n\n\nDownload the latest version of the release tarball of this module from [http://github.com/agentzh/headers-more-nginx-module/tags headers-more-nginx-module file list].\n\nAlso, this module is included and enabled by default in the [http://openresty.org ngx_openresty bundle].\n\n= Compatibility =\n\nThe following versions of Nginx should work with this module:\n\n* '''1.4.x''' (last tested: 1.4.4)\n* '''1.3.x''' (last tested: 1.3.7)\n* '''1.2.x''' (last tested: 1.2.9)\n* '''1.1.x''' (last tested: 1.1.5)\n* '''1.0.x''' (last tested: 1.0.11)\n* '''0.9.x''' (last tested: 0.9.4)\n* '''0.8.x''' (last tested: 0.8.54)\n* '''0.7.x >= 0.7.44''' (last tested: 0.7.68)\n\nEarlier versions of Nginx like 0.6.x and 0.5.x will ''not'' work.\n\nIf you find that any particular version of Nginx above 0.7.44 does not work with this module, please consider [[#Report Bugs|reporting a bug]].\n\n= Community =\n\n== English Mailing List ==\n\nThe [https://groups.google.com/group/openresty-en openresty-en] mailing list is for English speakers.\n\n== Chinese Mailing List ==\n\nThe [https://groups.google.com/group/openresty openresty] mailing list is for Chinese speakers.\n\n= Bugs and Patches =\n\nPlease submit bug reports, wishlists, or patches by\n\n# creating a ticket on the [http://github.com/chaoslawful/lua-nginx-module/issues GitHub Issue Tracker],\n# or posting to the [[#Community|OpenResty community]].\n\n= Source Repository =\n\nAvailable on github at [http://github.com/agentzh/headers-more-nginx-module agentzh/headers-more-nginx-module].\n\n= Changes =\n\nThe changes of every release of this module can be obtained from the ngx_openresty bundle's change logs:\n\nhttp://openresty.org/#Changes\n\n= Test Suite =\n\nThis module comes with a Perl-driven test suite. The [http://github.com/agentzh/headers-more-nginx-module/tree/master/t/ test cases] are\n[http://github.com/agentzh/headers-more-nginx-module/blob/master/t/sanity.t declarative] too. Thanks to the [http://search.cpan.org/perldoc?Test::Nginx Test::Nginx] module in the Perl world.\n\nTo run it on your side:\n\n\n $ PATH=/path/to/your/nginx-with-headers-more-module:$PATH prove -r t\n\n\nTo run the test suite with valgrind's memcheck, use the following commands:\n\n\n $ export PATH=/path/to/your/nginx-with-headers-more-module:$PATH\n $ TEST_NGINX_USE_VALGRIND=1 prove -r t\n\n\nYou need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary.\n\nBecause a single nginx server (by default, localhost:1984) is used across all the test scripts (.t files), it's meaningless to run the test suite in parallel by specifying -jN when invoking the prove utility.\n\nSome parts of the test suite requires modules [[HttpProxyModule|proxy]], [[HttpRewriteModule|rewrite]], and [[HttpEchoModule|echo]] to be enabled as well when building Nginx.\n\n= TODO =\n\n* Support variables in new headers' keys.\n\n= Getting involved =\n\nYou'll be very welcomed to submit patches to the [[#Author|author]] or just ask for a commit bit to the [[#Source Repository|source repository]] on GitHub.\n\n= Authors =\n\n* Yichun \"agentzh\" Zhang (章亦春) '''', CloudFlare Inc.\n* Bernd Dorn ( http://www.lovelysystems.com/ )\n\nThis wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well.\n\n= Copyright & License =\n\nThe code base is borrowed directly from the standard [[HttpHeadersModule|headers]] module in Nginx 0.8.24. This part of code is copyrighted by Igor Sysoev.\n\nCopyright (c) 2009-2013, Yichun \"agentzh\" Zhang (章亦春) , CloudFlare Inc.\n\nCopyright (c) 2010-2013, Bernd Dorn.\n\nThis module is licensed under the terms of the BSD license.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n= See Also =\n\n* The original thread on the Nginx mailing list that inspires this module's development: [http://forum.nginx.org/read.php?2,11206,11738 \"A question about add_header replication\"].\n* The orginal announcement thread on the Nginx mailing list: [http://forum.nginx.org/read.php?2,23460 \"The \"headers_more\" module: Set and clear output headers...more than 'add'!\"].\n* The original [http://agentzh.blogspot.com/2009/11/headers-more-module-scripting-input-and.html blog post] about this module's initial development.\n* The [[HttpEchoModule|echo module]] for Nginx module's automated testing.\n* The standard [[HttpHeadersModule|headers]] module.\n\n"} +{"text": "# EMC controller parameters for a simulated machine.\n\n# General note: Comments can either be preceded with a # or ; - either is\n# acceptable, although # is in keeping with most linux config files.\n\n# General section -------------------------------------------------------------\n[EMC]\n\n# Version of this INI file\nVERSION = $Revision$\n\n# Name of machine, for use with display, etc.\nMACHINE = LinuxCNC-HAL-SIM-AXIS\n\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\n# DEBUG = 0x7FFFFFFF\nDEBUG = 0\n\n# Sections for display options ------------------------------------------------\n[DISPLAY]\nPYVCP = vcp.xml\n# Name of display program, e.g., axis\nDISPLAY = axis\n\n# Cycle time, in seconds, that display will sleep between polls\nCYCLE_TIME = 0.100\n\n# Path to help file\nHELP_FILE = doc/help.txt\n\n# Initial display setting for position, RELATIVE or MACHINE\nPOSITION_OFFSET = RELATIVE\n\n# Initial display setting for position, COMMANDED or ACTUAL\nPOSITION_FEEDBACK = ACTUAL\n\n# Highest value that will be allowed for feed override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 1.2\nMAX_SPINDLE_OVERRIDE = 1.0\n# Prefix to be used\nPROGRAM_PREFIX = ../../../nc_files/\n\n# Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n\nEDITOR = gedit\n\nINCREMENTS = 1 mm, .01 in, .1mm, 1 mil, .1 mil, 1/8000 in\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\n\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python\n\n# Task controller section -----------------------------------------------------\n[TASK]\n\n# Name of task controller program, e.g., milltask\nTASK = milltask\n\n# Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.001\n\n# Part program interpreter section --------------------------------------------\n[RS274NGC]\n\n# File containing interpreter variables\nPARAMETER_FILE = sim_mm.var\n\n# Motion control section ------------------------------------------------------\n[EMCMOT]\n\nEMCMOT = motmod\n\n# Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n\n# BASE_PERIOD is unused in this configuration but specified in core_sim.hal\nBASE_PERIOD = 0\n# Servo task period, in nano-seconds\nSERVO_PERIOD = 1000000\n\n# Hardware Abstraction Layer section --------------------------------------------------\n[HAL]\n\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n#\n\n# list of hal config files to run through halcmd\n# files are executed in the order in which they appear\nHALFILE = core_sim.hal\nHALFILE = sim_spindle_encoder.hal\nHALFILE = axis_manualtoolchange.hal\nHALFILE = simulated_home.hal\nHALFILE = test_status.tcl\n\n# list of halcmd commands to execute\n# commands are executed in the order in which they appear\n#HALCMD = save neta\n\n# Single file that is executed after the GUI has started. Only supported by\n# AXIS at this time (only AXIS creates a HAL component of its own)\nPOSTGUI_HALFILE = postgui.hal\n\nHALUI = halui\n\n# Trajectory planner section --------------------------------------------------\n[TRAJ]\n\nAXES = 3\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = mm\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 30.48\nMAX_LINEAR_VELOCITY = 53.34\nDEFAULT_LINEAR_ACCELERATION = 508\nMAX_LINEAR_ACCELERATION = 508\nPOSITION_FILE = position_mm.txt\nARC_BLEND_ENABLE = 1\nARC_BLEND_FALLBACK_ENABLE = 0\nARC_BLEND_OPTIMIZATION_DEPTH = 100\nARC_BLEND_GAP_CYCLES = 2\nARC_BLEND_RAMP_FREQ = 20\n\n# Axes sections ---------------------------------------------------------------\n\n# First axis\n[AXIS_0]\n\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\nBACKLASH = 0.000\nINPUT_SCALE = 157.48\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -254\nMAX_LIMIT = 254\nFERROR = 1.27\nMIN_FERROR = .254\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 127\nHOME_LATCH_VEL = 25.4\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n# Second axis\n[AXIS_1]\n\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\nBACKLASH = 0.000\nINPUT_SCALE = 157.48\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -254\nMAX_LIMIT = 254\nFERROR = 1.27\nMIN_FERROR = .254\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 127\nHOME_LATCH_VEL = 25.4\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 1\n\n# Third axis\n[AXIS_2]\n\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\nBACKLASH = 0.000\nINPUT_SCALE = 157.48\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -50.8\nMAX_LIMIT = 101.6\nFERROR = 1.27\nMIN_FERROR = .254\nHOME_OFFSET = 25.4\nHOME_SEARCH_VEL = 127\nHOME_LATCH_VEL = 25.4\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n\n# section for main IO controller parameters -----------------------------------\n[EMCIO]\n\n# Name of IO controller program, e.g., io\nEMCIO = \t\tio\n\n# cycle time, in seconds\nCYCLE_TIME = 0.100\n\n# tool table file\nTOOL_TABLE = sim_mm.tbl\nTOOL_CHANGE_POSITION = 0 0 50.8\n"} +{"text": "\n\n\t\n\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\n"} +{"text": "parrot\n"} +{"text": "/*\n * Copyright 2015-2020 Alexandr Evstigneev\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.perl5.lang.perl.idea.structureView.filters;\n\nimport com.intellij.ide.util.treeView.smartTree.ActionPresentation;\nimport com.intellij.ide.util.treeView.smartTree.ActionPresentationData;\nimport com.perl5.PerlIcons;\nimport com.perl5.lang.perl.idea.structureView.elements.PerlStructureViewElement;\nimport com.perl5.lang.perl.idea.structureView.elements.PerlVariableDeclarationStructureViewElement;\nimport org.jetbrains.annotations.NotNull;\n\n\npublic class PerlVariableFilter extends PerlFilter {\n public static final PerlVariableFilter INSTANCE = new PerlVariableFilter();\n private static final String ID = \"SHOW_VARIABLES\";\n\n @Override\n protected boolean isMyElement(@NotNull PerlStructureViewElement treeElement) {\n return treeElement instanceof PerlVariableDeclarationStructureViewElement;\n }\n\n @Override\n public @NotNull ActionPresentation getPresentation() {\n return new ActionPresentationData(\"Show variables\", null, PerlIcons.SCALAR_GUTTER_ICON);\n }\n\n @Override\n public @NotNull String getName() {\n return ID;\n }\n}\n"} +{"text": "[connectivity] \nsp = kernel_getrf_nopivot_0_1.A:DDR[0]\n#slr = kernel_getrf_nopivot_0_1:SLR0\n"} +{"text": "\n\n\n \n \n \n \n \n ($1, 2))], $f3=[IS TRUE(<>($1, 5))])\n +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])\n]]>\n \n \n (b, 2)) AS $f2, IS TRUE(<>(b, 5)) AS $f3, MOD(HASH_CODE(b), 1024) AS $f4])\n +- FlinkLogicalLegacyTableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n"} +{"text": "# This file is used to maintain libtool version info for libffi. See\n# the libtool manual to understand the meaning of the fields. This is\n# a separate file so that version updates don't involve re-running\n# automake.\n#\n# Here are a set of rules to help you update your library version\n# information:\n# \n# 1. Start with version information of `0:0:0' for each libtool library.\n#\n# 2. Update the version information only immediately before a public\n# release of your software. More frequent updates are unnecessary,\n# and only guarantee that the current interface number gets larger\n# faster.\n#\n# 3. If the library source code has changed at all since the last\n# update, then increment revision (`c:r:a' becomes `c:r+1:a').\n#\n# 4. If any interfaces have been added, removed, or changed since the\n# last update, increment current, and set revision to 0.\n#\n# 5. If any interfaces have been added since the last public release,\n# then increment age.\n#\n# 6. If any interfaces have been removed since the last public\n# release, then set age to 0.\n#\n# CURRENT:REVISION:AGE\n6:4:0\n"} +{"text": "import torch\nimport torch.nn.functional as F\nfrom collections import deque\nfrom parlai.core.agents import Agent\nfrom model.transformer_model import TransformerModel\nfrom model.text import BPEVocab\nfrom model.utils import pad_sequence\nfrom model.postprocessing import ngram_replaser, ReplyChecker, detokenize, syntax_fix\nfrom model.retrieval import RetrievalBot, DIALOG_SIZE\nfrom model.sentiment import pick_emoji, clean_emoji\nfrom config import get_model_config\nimport random\n\n \nclass TransformerAgent(Agent):\n @staticmethod\n def add_cmdline_args(argparser):\n agent_args = argparser.add_argument_group('Agent parameters')\n agent_args.add_argument('-gpu', '--gpu', type=int, default=-1, \n help='which GPU to use')\n agent_args.add_argument('--no-cuda', type=bool, default=False,\n help='disable GPUs even if available. otherwise, will use GPUs if '\n 'available on the device.')\n agent_args.add_argument('--rank_candidates', type=bool, default=False,\n help='Whether the model should parse candidates for ranking.')\n agent_args.add_argument('--sample', type=bool, default=False,\n help='Sampling of beam from beam search')\n agent_args.add_argument('--wild_mode', type=bool, default=False,\n help='')\n agent_args.add_argument('--replace_repeat', type=bool, default=True,\n help='')\n agent_args.add_argument('--replace_ngram', type=bool, default=True,\n help='')\n agent_args.add_argument('--detokenize', type=bool, default=True,\n help='')\n agent_args.add_argument('--emoji_prob', type=float, default=0.5,\n help='')\n agent_args.add_argument('--ngram_size', type=int, default=3,\n help='')\n agent_args.add_argument('--add_questions', type=float, default=0.3,\n help='')\n agent_args.add_argument('--clean_emoji', type=bool, default=True,\n help='')\n agent_args.add_argument('--check_grammar', type=bool, default=True,\n help='')\n agent_args.add_argument('--correct_generative', type=bool, default=True,\n help='')\n agent_args.add_argument('--split_into_sentences', type=bool, default=True,\n help='')\n\n agent_args.add_argument('--max_seq_len', type=int, default=128,\n help='')\n agent_args.add_argument('--beam_size', type=int, default=1,\n help='')\n agent_args.add_argument('--diversity_coef', type=float, default=0,\n help='')\n agent_args.add_argument('--diversity_groups', type=int, default=1,\n help='')\n agent_args.add_argument('--annealing_topk', type=float, default=None,\n help='')\n agent_args.add_argument('--annealing', type=float, default=0.0,\n help='')\n agent_args.add_argument('--length_penalty', type=float, default=0.6,\n help='')\n \n return argparser\n\n def __init__(self, opt, shared=None):\n super(TransformerAgent, self).__init__(opt, shared)\n\n self.use_cuda = not self.opt.get('no_cuda') and torch.cuda.is_available()\n if self.use_cuda:\n torch.cuda.set_device(self.opt['gpu'])\n\n torch.set_grad_enabled(False)\n\n model_config = get_model_config()\n self.vocab = BPEVocab.from_files(model_config.bpe_vocab_path, model_config.bpe_codes_path)\n self.reply_checker = ReplyChecker(correct_generative=self.opt['correct_generative'],\n split_into_sentences=self.opt['split_into_sentences'])\n\n self.replace_repeat = self.opt['replace_repeat']\n self.replace_ngram = self.opt['replace_ngram']\n self.ngram_size = self.opt['ngram_size']\n self.detokenize = self.opt['detokenize']\n self.emoji_prob = self.opt['emoji_prob']\n self.add_questions = self.opt['add_questions']\n self.beam_size = self.opt['beam_size']\n\n self.clean_emoji = self.opt['clean_emoji']\n self.check_grammar = self.opt['check_grammar']\n\n # 'max_seq_len': 128,\n # 'beam_size': 1,\n # 'diversity_coef': 0,\n # 'diversity_groups': 1,\n # 'annealing_topk': None,\n # 'annealing': 0,\n # 'length_penalty': 0.6,\n\n if self.opt['annealing_topk'] is not None:\n assert self.opt['annealing_topk'] > self.opt['beam_size']\n\n assert self.opt['diversity_coef'] >= 0\n assert self.opt['beam_size'] % self.opt['diversity_groups'] == 0\n\n if shared is None:\n self.model = TransformerModel(n_layers=model_config.n_layers,\n n_embeddings=len(self.vocab),\n n_pos_embeddings=model_config.n_pos_embeddings,\n embeddings_size=model_config.embeddings_size,\n padding_idx=self.vocab.pad_id,\n n_heads=model_config.n_heads,\n dropout=model_config.dropout,\n embed_dropout=model_config.embed_dropout,\n attn_dropout=model_config.attn_dropout,\n ff_dropout=model_config.ff_dropout,\n bos_id=self.vocab.bos_id,\n eos_id=self.vocab.eos_id,\n max_seq_len=self.opt['max_seq_len'],\n beam_size=self.opt['beam_size'],\n length_penalty=self.opt['length_penalty'],\n n_segments=model_config.n_segments,\n sample=self.opt['sample'],\n annealing_topk=self.opt['annealing_topk'],\n annealing=self.opt['annealing'],\n diversity_coef=self.opt['diversity_coef'],\n diversity_groups=self.opt['diversity_groups'])\n self.retrieval_bot = RetrievalBot()\n\n state_dict = torch.load(model_config.checkpoint_path, map_location=lambda storage, loc: storage)\n if 'model' in state_dict:\n state_dict = state_dict['model']\n\n self.model.load_state_dict(state_dict)\n print('Weights loaded from {}'.format(model_config.checkpoint_path))\n\n if self.use_cuda:\n self.model = self.model.cuda()\n\n self.model.eval()\n\n else:\n self.model = shared['model']\n self.retrieval_bot = shared['retrieval']\n\n self.reset()\n\n def _preprocess_text(self, text):\n if self.clean_emoji:\n text = clean_emoji(text)\n\n if self.check_grammar:\n text = syntax_fix(text).lower()\n\n return text\n\n def _parse(self, text):\n # todo: fix grammar mistakes?\n persona_info = []\n dialog = []\n for subtext in text.split('\\n'):\n subtext = subtext.strip()\n \n if self.opt['wild_mode'] and len(self.history['info']) == 0 and len(self.history['dialog']) == 0:\n subtext = 'your persona: ' + subtext\n\n if subtext.startswith('your persona:'):\n subtext = subtext.replace('your persona:', '').strip()\n subtext = self._preprocess_text(subtext).strip()\n persona_info.append(subtext)\n else:\n subtext = self._preprocess_text(subtext).strip()\n dialog.append(subtext)\n\n return persona_info, dialog\n\n def observe(self, observation):\n if self.episode_done:\n self.reset()\n\n if 'text' in observation:\n text = observation['text']\n info, dialog = self._parse(text)\n\n if info:\n self.history['str_info'] = ' '.join(info)\n self.history['str_dialog'].extend(dialog)\n \n info = sum([self.vocab.string2ids(i) for i in info], [])\n self.history['info'].extend(info)\n\n for i, d in enumerate(dialog, 1):\n d = self.vocab.string2ids(d)\n if i % 2 == 1:\n d = [self.vocab.talker1_bos_id] + d + [self.vocab.talker1_eos_id]\n else:\n d = [self.vocab.talker2_bos_id] + d + [self.vocab.talker2_eos_id]\n\n self.history['dialog'].extend(d)\n\n observation['agent'] = self \n\n self.episode_done = observation['episode_done']\n self.observation = observation\n \n return observation\n \n def act(self):\n return self.batch_act([self.observation])[0]\n\n def _postprocess_text(self, reply, agent):\n str_reply = self.vocab.ids2string(reply)\n\n if self.replace_repeat:\n str_reply = agent.reply_checker.check_reply(str_reply,\n agent.history['str_dialog'][-1],\n agent.history['str_info'])\n\n if self.beam_size > 1 and random.uniform(0, 1) < self.add_questions and '?' not in str_reply:\n question = self.retrieval_bot.generate_question(list(agent.history['str_dialog']),\n agent.history['str_info'])\n if question is not None and question not in str_reply:\n str_reply = ' '.join([str_reply, question])\n\n if self.replace_ngram:\n str_reply = ngram_replaser(agent.history['str_info'], str_reply, n=self.ngram_size)\n\n reply = self.vocab.string2ids(str_reply)\n\n if self.detokenize:\n str_reply = detokenize(str_reply)\n\n if random.uniform(0, 1) < self.emoji_prob:\n str_reply = ' '.join([str_reply, pick_emoji(str_reply)])\n\n return str_reply, reply\n\n def batch_act(self, observations):\n def is_valid_history(history):\n return len(history['dialog'])\n\n def to_tensor(string):\n ids = [self.vocab.bos_id] + self.vocab.string2ids(string) + [self.vocab.eos_id]\n return torch.tensor(ids, dtype=torch.long)\n\n batch_reply = [{'id': self.getID(), 'text': '', 'text_candidates': []} for _ in range(len(observations))]\n valid_ids = [i for i, obs in enumerate(observations) if is_valid_history(obs['agent'].history)]\n batch_size = len(valid_ids)\n\n if batch_size == 0:\n return batch_reply\n\n try:\n valid_observations = [observations[i] for i in valid_ids]\n\n infos = [obs['agent'].history['info'][:self.model.n_pos_embeddings-3] for obs in valid_observations]\n infos = [([self.vocab.info_bos_id] + ifo + [self.vocab.info_eos_id] if len(ifo) else ifo) for ifo in infos]\n dialogs = [list(obs['agent'].history['dialog'])[-self.model.n_pos_embeddings+1:] for obs in valid_observations]\n contexts = []\n\n if max(map(len, infos)) > 0:\n infos = [torch.tensor(i, dtype=torch.long) for i in infos]\n infos = pad_sequence(infos, batch_first=True, padding_value=self.model.padding_idx)\n if self.use_cuda:\n infos = infos.cuda()\n contexts.append(infos)\n\n if max(map(len, dialogs)) > 0:\n dialogs = [torch.tensor(d, dtype=torch.long) for d in dialogs]\n dialogs = pad_sequence(dialogs, batch_first=True, padding_value=self.model.padding_idx)\n if self.use_cuda:\n dialogs = dialogs.cuda()\n contexts.append(dialogs)\n\n enc_contexts = [self.model.encode(c) for c in contexts]\n pred_texts = self.model.beam_search(enc_contexts)\n\n for i in range(batch_size):\n pred_text_str, pred_text = self._postprocess_text(pred_texts[i], valid_observations[i]['agent'])\n\n valid_observations[i]['agent'].history['dialog'].extend([self.vocab.talker2_bos_id] +\n pred_text +\n [self.vocab.talker2_eos_id])\n batch_reply[valid_ids[i]]['text'] = pred_text_str\n batch_reply[valid_ids[i]]['episode_done'] = valid_observations[i]['agent'].episode_done\n\n if self.opt['rank_candidates']:\n candidates = [list(obs.get('label_candidates', [])) for obs in valid_observations]\n lens_candidates = [len(c) for c in candidates]\n\n if max(lens_candidates) > 0:\n candidates = [c + ['' for _ in range(max(lens_candidates) - len(c))] for c in candidates]\n scores = [[] for _ in range(len(candidates))]\n\n for i in range(max(lens_candidates)):\n current_cands = [to_tensor(c[i])[:self.model.n_pos_embeddings-1] for c in candidates]\n current_cands = pad_sequence(current_cands, batch_first=True, padding_value=self.model.padding_idx)\n if self.use_cuda:\n current_cands = current_cands.cuda()\n\n logits = self.model.decode(current_cands[:, :-1], enc_contexts)\n log_probas = F.log_softmax(logits, dim=-1)\n log_probas = torch.gather(log_probas, -1, current_cands[:, 1:].unsqueeze(-1)).squeeze(-1)\n log_probas.masked_fill_(current_cands[:, 1:].eq(self.model.padding_idx), 0)\n\n current_lens = current_cands[:, 1:].ne(self.model.padding_idx).float().sum(dim=-1)\n current_scores = log_probas.sum(dim=-1) / current_lens\n\n for k, s in enumerate(current_scores):\n if i < lens_candidates[k]:\n scores[k].append(s.item())\n\n ranked_ids = [sorted(range(len(s)), key=lambda k: s[k], reverse=True) for s in scores]\n ranked_strings = [[c[i] for i in ids] for ids, c in zip(ranked_ids, candidates)]\n\n for i in range(batch_size):\n batch_reply[valid_ids[i]]['text_candidates'] = ranked_strings[i]\n\n except Exception as e:\n # raise e\n print(e)\n\n return batch_reply\n\n def share(self):\n shared = super(TransformerAgent, self).share()\n shared['opt'] = self.opt\n shared['model'] = self.model\n shared['retrieval'] = self.retrieval_bot\n\n return shared\n\n def reset(self):\n self.history = {'str_info': None, 'str_dialog': deque(DIALOG_SIZE * ['None'], maxlen=DIALOG_SIZE),\n 'info': [], 'dialog': deque(maxlen=self.model.n_pos_embeddings-1)}\n self.episode_done = True\n self.observation = None\n self.reply_checker.clean()\n"} +{"text": "package pflag\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// BytesHex adapts []byte for use as a flag. Value of flag is HEX encoded\ntype bytesHexValue []byte\n\n// String implements pflag.Value.String.\nfunc (bytesHex bytesHexValue) String() string {\n\treturn fmt.Sprintf(\"%X\", []byte(bytesHex))\n}\n\n// Set implements pflag.Value.Set.\nfunc (bytesHex *bytesHexValue) Set(value string) error {\n\tbin, err := hex.DecodeString(strings.TrimSpace(value))\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*bytesHex = bin\n\n\treturn nil\n}\n\n// Type implements pflag.Value.Type.\nfunc (*bytesHexValue) Type() string {\n\treturn \"bytesHex\"\n}\n\nfunc newBytesHexValue(val []byte, p *[]byte) *bytesHexValue {\n\t*p = val\n\treturn (*bytesHexValue)(p)\n}\n\nfunc bytesHexConv(sval string) (interface{}, error) {\n\n\tbin, err := hex.DecodeString(sval)\n\n\tif err == nil {\n\t\treturn bin, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"invalid string being converted to Bytes: %s %s\", sval, err)\n}\n\n// GetBytesHex return the []byte value of a flag with the given name\nfunc (f *FlagSet) GetBytesHex(name string) ([]byte, error) {\n\tval, err := f.getFlagType(name, \"bytesHex\", bytesHexConv)\n\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\treturn val.([]byte), nil\n}\n\n// BytesHexVar defines an []byte flag with specified name, default value, and usage string.\n// The argument p points to an []byte variable in which to store the value of the flag.\nfunc (f *FlagSet) BytesHexVar(p *[]byte, name string, value []byte, usage string) {\n\tf.VarP(newBytesHexValue(value, p), name, \"\", usage)\n}\n\n// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) {\n\tf.VarP(newBytesHexValue(value, p), name, shorthand, usage)\n}\n\n// BytesHexVar defines an []byte flag with specified name, default value, and usage string.\n// The argument p points to an []byte variable in which to store the value of the flag.\nfunc BytesHexVar(p *[]byte, name string, value []byte, usage string) {\n\tCommandLine.VarP(newBytesHexValue(value, p), name, \"\", usage)\n}\n\n// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash.\nfunc BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) {\n\tCommandLine.VarP(newBytesHexValue(value, p), name, shorthand, usage)\n}\n\n// BytesHex defines an []byte flag with specified name, default value, and usage string.\n// The return value is the address of an []byte variable that stores the value of the flag.\nfunc (f *FlagSet) BytesHex(name string, value []byte, usage string) *[]byte {\n\tp := new([]byte)\n\tf.BytesHexVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) BytesHexP(name, shorthand string, value []byte, usage string) *[]byte {\n\tp := new([]byte)\n\tf.BytesHexVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// BytesHex defines an []byte flag with specified name, default value, and usage string.\n// The return value is the address of an []byte variable that stores the value of the flag.\nfunc BytesHex(name string, value []byte, usage string) *[]byte {\n\treturn CommandLine.BytesHexP(name, \"\", value, usage)\n}\n\n// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash.\nfunc BytesHexP(name, shorthand string, value []byte, usage string) *[]byte {\n\treturn CommandLine.BytesHexP(name, shorthand, value, usage)\n}\n\n// BytesBase64 adapts []byte for use as a flag. Value of flag is Base64 encoded\ntype bytesBase64Value []byte\n\n// String implements pflag.Value.String.\nfunc (bytesBase64 bytesBase64Value) String() string {\n\treturn base64.StdEncoding.EncodeToString([]byte(bytesBase64))\n}\n\n// Set implements pflag.Value.Set.\nfunc (bytesBase64 *bytesBase64Value) Set(value string) error {\n\tbin, err := base64.StdEncoding.DecodeString(strings.TrimSpace(value))\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*bytesBase64 = bin\n\n\treturn nil\n}\n\n// Type implements pflag.Value.Type.\nfunc (*bytesBase64Value) Type() string {\n\treturn \"bytesBase64\"\n}\n\nfunc newBytesBase64Value(val []byte, p *[]byte) *bytesBase64Value {\n\t*p = val\n\treturn (*bytesBase64Value)(p)\n}\n\nfunc bytesBase64ValueConv(sval string) (interface{}, error) {\n\n\tbin, err := base64.StdEncoding.DecodeString(sval)\n\tif err == nil {\n\t\treturn bin, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"invalid string being converted to Bytes: %s %s\", sval, err)\n}\n\n// GetBytesBase64 return the []byte value of a flag with the given name\nfunc (f *FlagSet) GetBytesBase64(name string) ([]byte, error) {\n\tval, err := f.getFlagType(name, \"bytesBase64\", bytesBase64ValueConv)\n\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\treturn val.([]byte), nil\n}\n\n// BytesBase64Var defines an []byte flag with specified name, default value, and usage string.\n// The argument p points to an []byte variable in which to store the value of the flag.\nfunc (f *FlagSet) BytesBase64Var(p *[]byte, name string, value []byte, usage string) {\n\tf.VarP(newBytesBase64Value(value, p), name, \"\", usage)\n}\n\n// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) {\n\tf.VarP(newBytesBase64Value(value, p), name, shorthand, usage)\n}\n\n// BytesBase64Var defines an []byte flag with specified name, default value, and usage string.\n// The argument p points to an []byte variable in which to store the value of the flag.\nfunc BytesBase64Var(p *[]byte, name string, value []byte, usage string) {\n\tCommandLine.VarP(newBytesBase64Value(value, p), name, \"\", usage)\n}\n\n// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) {\n\tCommandLine.VarP(newBytesBase64Value(value, p), name, shorthand, usage)\n}\n\n// BytesBase64 defines an []byte flag with specified name, default value, and usage string.\n// The return value is the address of an []byte variable that stores the value of the flag.\nfunc (f *FlagSet) BytesBase64(name string, value []byte, usage string) *[]byte {\n\tp := new([]byte)\n\tf.BytesBase64VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte {\n\tp := new([]byte)\n\tf.BytesBase64VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// BytesBase64 defines an []byte flag with specified name, default value, and usage string.\n// The return value is the address of an []byte variable that stores the value of the flag.\nfunc BytesBase64(name string, value []byte, usage string) *[]byte {\n\treturn CommandLine.BytesBase64P(name, \"\", value, usage)\n}\n\n// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash.\nfunc BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte {\n\treturn CommandLine.BytesBase64P(name, shorthand, value, usage)\n}\n"} +{"text": "/* File : example.i */\n%module example\n\n%{\n#include \"example.h\"\n%}\n\n%include stl.i\n/* instantiate the required template specializations */\nnamespace std {\n %template(IntVector) vector;\n %template(DoubleVector) vector;\n}\n\n/* Let's just grab the original header file here */\n%include \"example.h\"\n\n"} +{"text": "\n\n\n\n \n\n CSS Writing Modes Test: line box height and padding on non-replaced inline box (mixed)\n\n \n\n \n \n \n \n\n \n \n\n \n\n \n\n \n\n

Test passes if there are 2 identical blue rectangles with \"123456\" rotated 90 degrees clockwise. The size of each blue rectangles must be identical and the two \"123456\" numbers must be enclosed by the two blue borders.

\n\n
123456
\n\n
123456
\n\n \n\n"} +{"text": "package com.example.get_it_example\n\nimport androidx.annotation.NonNull;\nimport io.flutter.embedding.android.FlutterActivity\nimport io.flutter.embedding.engine.FlutterEngine\nimport io.flutter.plugins.GeneratedPluginRegistrant\n\nclass MainActivity: FlutterActivity() {\n override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {\n GeneratedPluginRegistrant.registerWith(flutterEngine);\n }\n}\n"} +{"text": " SUBROUTINE CHPTRD( UPLO, N, AP, D, E, TAU, INFO )\n*\n* -- LAPACK routine (version 3.0) --\n* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,\n* Courant Institute, Argonne National Lab, and Rice University\n* September 30, 1994\n*\n* .. Scalar Arguments ..\n CHARACTER UPLO\n INTEGER INFO, N\n* ..\n* .. Array Arguments ..\n REAL D( * ), E( * )\n COMPLEX AP( * ), TAU( * )\n* ..\n*\n* Purpose\n* =======\n*\n* CHPTRD reduces a complex Hermitian matrix A stored in packed form to\n* real symmetric tridiagonal form T by a unitary similarity\n* transformation: Q**H * A * Q = T.\n*\n* Arguments\n* =========\n*\n* UPLO (input) CHARACTER*1\n* = 'U': Upper triangle of A is stored;\n* = 'L': Lower triangle of A is stored.\n*\n* N (input) INTEGER\n* The order of the matrix A. N >= 0.\n*\n* AP (input/output) COMPLEX array, dimension (N*(N+1)/2)\n* On entry, the upper or lower triangle of the Hermitian matrix\n* A, packed columnwise in a linear array. The j-th column of A\n* is stored in the array AP as follows:\n* if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;\n* if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.\n* On exit, if UPLO = 'U', the diagonal and first superdiagonal\n* of A are overwritten by the corresponding elements of the\n* tridiagonal matrix T, and the elements above the first\n* superdiagonal, with the array TAU, represent the unitary\n* matrix Q as a product of elementary reflectors; if UPLO\n* = 'L', the diagonal and first subdiagonal of A are over-\n* written by the corresponding elements of the tridiagonal\n* matrix T, and the elements below the first subdiagonal, with\n* the array TAU, represent the unitary matrix Q as a product\n* of elementary reflectors. See Further Details.\n*\n* D (output) REAL array, dimension (N)\n* The diagonal elements of the tridiagonal matrix T:\n* D(i) = A(i,i).\n*\n* E (output) REAL array, dimension (N-1)\n* The off-diagonal elements of the tridiagonal matrix T:\n* E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'.\n*\n* TAU (output) COMPLEX array, dimension (N-1)\n* The scalar factors of the elementary reflectors (see Further\n* Details).\n*\n* INFO (output) INTEGER\n* = 0: successful exit\n* < 0: if INFO = -i, the i-th argument had an illegal value\n*\n* Further Details\n* ===============\n*\n* If UPLO = 'U', the matrix Q is represented as a product of elementary\n* reflectors\n*\n* Q = H(n-1) . . . H(2) H(1).\n*\n* Each H(i) has the form\n*\n* H(i) = I - tau * v * v'\n*\n* where tau is a complex scalar, and v is a complex vector with\n* v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in AP,\n* overwriting A(1:i-1,i+1), and tau is stored in TAU(i).\n*\n* If UPLO = 'L', the matrix Q is represented as a product of elementary\n* reflectors\n*\n* Q = H(1) H(2) . . . H(n-1).\n*\n* Each H(i) has the form\n*\n* H(i) = I - tau * v * v'\n*\n* where tau is a complex scalar, and v is a complex vector with\n* v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in AP,\n* overwriting A(i+2:n,i), and tau is stored in TAU(i).\n*\n* =====================================================================\n*\n* .. Parameters ..\n COMPLEX ONE, ZERO, HALF\n PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ),\n $ ZERO = ( 0.0E+0, 0.0E+0 ),\n $ HALF = ( 0.5E+0, 0.0E+0 ) )\n* ..\n* .. Local Scalars ..\n LOGICAL UPPER\n INTEGER I, I1, I1I1, II\n COMPLEX ALPHA, TAUI\n* ..\n* .. External Subroutines ..\n EXTERNAL CAXPY, CHPMV, CHPR2, CLARFG, XERBLA\n* ..\n* .. External Functions ..\n LOGICAL LSAME\n COMPLEX CDOTC\n EXTERNAL LSAME, CDOTC\n* ..\n* .. Intrinsic Functions ..\n INTRINSIC REAL\n* ..\n* .. Executable Statements ..\n*\n* Test the input parameters\n*\n INFO = 0\n UPPER = LSAME( UPLO, 'U' )\n IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN\n INFO = -1\n ELSE IF( N.LT.0 ) THEN\n INFO = -2\n END IF\n IF( INFO.NE.0 ) THEN\n CALL XERBLA( 'CHPTRD', -INFO )\n RETURN\n END IF\n*\n* Quick return if possible\n*\n IF( N.LE.0 )\n $ RETURN\n*\n IF( UPPER ) THEN\n*\n* Reduce the upper triangle of A.\n* I1 is the index in AP of A(1,I+1).\n*\n I1 = N*( N-1 ) / 2 + 1\n AP( I1+N-1 ) = REAL( AP( I1+N-1 ) )\n DO 10 I = N - 1, 1, -1\n*\n* Generate elementary reflector H(i) = I - tau * v * v'\n* to annihilate A(1:i-1,i+1)\n*\n ALPHA = AP( I1+I-1 )\n CALL CLARFG( I, ALPHA, AP( I1 ), 1, TAUI )\n E( I ) = ALPHA\n*\n IF( TAUI.NE.ZERO ) THEN\n*\n* Apply H(i) from both sides to A(1:i,1:i)\n*\n AP( I1+I-1 ) = ONE\n*\n* Compute y := tau * A * v storing y in TAU(1:i)\n*\n CALL CHPMV( UPLO, I, TAUI, AP, AP( I1 ), 1, ZERO, TAU,\n $ 1 )\n*\n* Compute w := y - 1/2 * tau * (y'*v) * v\n*\n ALPHA = -HALF*TAUI*CDOTC( I, TAU, 1, AP( I1 ), 1 )\n CALL CAXPY( I, ALPHA, AP( I1 ), 1, TAU, 1 )\n*\n* Apply the transformation as a rank-2 update:\n* A := A - v * w' - w * v'\n*\n CALL CHPR2( UPLO, I, -ONE, AP( I1 ), 1, TAU, 1, AP )\n*\n END IF\n AP( I1+I-1 ) = E( I )\n D( I+1 ) = AP( I1+I )\n TAU( I ) = TAUI\n I1 = I1 - I\n 10 CONTINUE\n D( 1 ) = AP( 1 )\n ELSE\n*\n* Reduce the lower triangle of A. II is the index in AP of\n* A(i,i) and I1I1 is the index of A(i+1,i+1).\n*\n II = 1\n AP( 1 ) = REAL( AP( 1 ) )\n DO 20 I = 1, N - 1\n I1I1 = II + N - I + 1\n*\n* Generate elementary reflector H(i) = I - tau * v * v'\n* to annihilate A(i+2:n,i)\n*\n ALPHA = AP( II+1 )\n CALL CLARFG( N-I, ALPHA, AP( II+2 ), 1, TAUI )\n E( I ) = ALPHA\n*\n IF( TAUI.NE.ZERO ) THEN\n*\n* Apply H(i) from both sides to A(i+1:n,i+1:n)\n*\n AP( II+1 ) = ONE\n*\n* Compute y := tau * A * v storing y in TAU(i:n-1)\n*\n CALL CHPMV( UPLO, N-I, TAUI, AP( I1I1 ), AP( II+1 ), 1,\n $ ZERO, TAU( I ), 1 )\n*\n* Compute w := y - 1/2 * tau * (y'*v) * v\n*\n ALPHA = -HALF*TAUI*CDOTC( N-I, TAU( I ), 1, AP( II+1 ),\n $ 1 )\n CALL CAXPY( N-I, ALPHA, AP( II+1 ), 1, TAU( I ), 1 )\n*\n* Apply the transformation as a rank-2 update:\n* A := A - v * w' - w * v'\n*\n CALL CHPR2( UPLO, N-I, -ONE, AP( II+1 ), 1, TAU( I ), 1,\n $ AP( I1I1 ) )\n*\n END IF\n AP( II+1 ) = E( I )\n D( I ) = AP( II )\n TAU( I ) = TAUI\n II = I1I1\n 20 CONTINUE\n D( N ) = AP( II )\n END IF\n*\n RETURN\n*\n* End of CHPTRD\n*\n END\n"} +{"text": "\n *\n * This source file is subject to the MIT license that is bundled\n * with this source code in the file LICENSE.\n */\n\nnamespace SolidInvoice\\InstallBundle\\Listener;\n\nuse SolidInvoice\\InstallBundle\\Exception\\ApplicationInstalledException;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpFoundation\\RedirectResponse;\nuse Symfony\\Component\\HttpKernel\\Event\\RequestEvent;\nuse Symfony\\Component\\HttpKernel\\HttpKernel;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\nuse Symfony\\Component\\Routing\\Router;\nuse Symfony\\Component\\Routing\\RouterInterface;\n\n/**\n * Listener class to intercept requests\n * and redirect to the installer if necessary.\n */\nclass RequestListener implements EventSubscriberInterface\n{\n const INSTALLER_ROUTE = '_install_check_requirements';\n\n /**\n * Core routes.\n *\n * @var array\n */\n private $allowRoutes = [];\n\n private $installRoutes = [\n self::INSTALLER_ROUTE,\n '_install_config',\n '_install_install',\n '_install_setup',\n '_install_finish',\n ];\n\n /**\n * @var array\n */\n private $debugRoutes = [\n '_wdt',\n '_profiler',\n '_profiler_search',\n '_profiler_search_bar',\n '_profiler_search_results',\n '_profiler_router',\n ];\n\n /**\n * @var string\n */\n private $installed;\n\n /**\n * @var Router\n */\n private $router;\n\n /**\n * {@inheritdoc}\n */\n public static function getSubscribedEvents()\n {\n return [\n KernelEvents::REQUEST => ['onKernelRequest', 10],\n ];\n }\n\n public function __construct(?string $installed, RouterInterface $router, bool $debug = false)\n {\n $this->installed = $installed;\n $this->router = $router;\n $this->allowRoutes += $this->installRoutes;\n\n if (true === $debug) {\n $this->allowRoutes = array_merge($this->allowRoutes, $this->debugRoutes);\n }\n }\n\n public function onKernelRequest(RequestEvent $event)\n {\n if (HttpKernel::MASTER_REQUEST !== $event->getRequestType()) {\n return;\n }\n\n $route = $event->getRequest()->get('_route');\n\n if ($this->installed) {\n if (in_array($route, $this->installRoutes, true)) {\n throw new ApplicationInstalledException();\n }\n } elseif (!in_array($route, $this->allowRoutes, true)) {\n $response = new RedirectResponse($this->router->generate(self::INSTALLER_ROUTE));\n\n $event->setResponse($response);\n $event->stopPropagation();\n }\n }\n}\n"} +{"text": "# Codeception Test Suite Configuration\n\n# suite for acceptance tests.\n# perform tests in browser using the Selenium-like tools.\n# powered by Mink (http://mink.behat.org).\n# (tip: that's what your customer will see).\n# (tip: test your ajax and javascript by one of Mink drivers).\n\n# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.\n\nclass_name: AcceptanceTester\nmodules:\n enabled:\n - PhpBrowser\n - tests\\codeception\\common\\_support\\FixtureHelper\n# you can use WebDriver instead of PhpBrowser to test javascript and ajax.\n# This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium\n# \"restart\" option is used by the WebDriver to start each time per test-file new session and cookies,\n# it is useful if you want to login in your app in each test.\n# - WebDriver\n config:\n PhpBrowser:\n# PLEASE ADJUST IT TO THE ACTUAL ENTRY POINT WITHOUT PATH INFO\n url: http://localhost:8080\n# WebDriver:\n# url: http://localhost:8080\n# browser: firefox\n# restart: true\n"} +{"text": "\n\n\n\t\n\tPagination Layout - jQuery EasyUI Demo\n\t\n\t\n\t\n\t\n\t\n\n\n\t

Pagination Layout

\n\t

The pagination layout supports various types of pages which you can choose.

\n\t
\n\t
\n\t\t
\n\t
\n\t
\n\t\t\n\t
\n\t\n\n"} +{"text": "configuration Sample_xWebSite_WithSSLFlags\r\n{\r\n param\r\n (\r\n # Target nodes to apply the configuration\r\n [String[]] $NodeName = 'localhost',\r\n\r\n # Name of the website to create\r\n [Parameter(Mandatory)]\r\n [ValidateNotNullOrEmpty()]\r\n [String] $WebSiteName,\r\n\r\n # Source Path for Website content\r\n [Parameter(Mandatory)]\r\n [ValidateNotNullOrEmpty()]\r\n [String] $SourcePath,\r\n\r\n # Destination path for Website content\r\n [Parameter(Mandatory)]\r\n [ValidateNotNullOrEmpty()]\r\n [String] $DestinationPath\r\n )\r\n\r\n # Import the module that defines custom resources\r\n Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration\r\n\r\n Node $NodeName\r\n {\r\n # Install the IIS role\r\n WindowsFeature IIS\r\n {\r\n Ensure = \"Present\"\r\n Name = \"Web-Server\"\r\n }\r\n\r\n # Install the ASP .NET 4.5 role\r\n WindowsFeature AspNet45\r\n {\r\n Ensure = \"Present\"\r\n Name = \"Web-Asp-Net45\"\r\n }\r\n\r\n # Stop the default website\r\n xWebSite DefaultSite\r\n {\r\n Ensure = \"Present\"\r\n Name = \"Default Web Site\"\r\n State = \"Stopped\"\r\n ServerAutoStart = $false\r\n PhysicalPath = \"C:\\inetpub\\wwwroot\"\r\n DependsOn = \"[WindowsFeature]IIS\"\r\n }\r\n\r\n # Copy the website content\r\n File WebContent\r\n {\r\n Ensure = \"Present\"\r\n SourcePath = $SourcePath\r\n DestinationPath = $DestinationPath\r\n Recurse = $true\r\n Type = \"Directory\"\r\n DependsOn = \"[WindowsFeature]AspNet45\"\r\n }\r\n\r\n # Create the new Website\r\n # Have it set to the CertificateThumbprint\r\n # and set that the Server Name Indication is required\r\n xWebSite NewWebsite\r\n {\r\n Ensure = \"Present\"\r\n Name = $WebSiteName\r\n State = \"Started\"\r\n PhysicalPath = $DestinationPath\r\n DependsOn = \"[File]WebContent\"\r\n BindingInfo = MSFT_xWebBindingInformation\r\n {\r\n Protocol = 'https'\r\n Port = '443'\r\n CertificateStoreName = 'MY'\r\n CertificateThumbprint = 'BB84DE3EC423DDDE90C08AB3C5A828692089493C'\r\n HostName = $WebSiteName\r\n IPAddress = '*'\r\n SSLFlags = '1'\r\n }\r\n }\r\n }\r\n}\r\n"} +{"text": "package com.gh4a.utils;\n\nimport android.content.res.AssetManager;\nimport android.graphics.Typeface;\nimport android.os.Build;\nimport android.util.SparseArray;\n\nimport com.gh4a.Gh4Application;\n\npublic class TypefaceCache {\n public static final int TF_REGULAR = 0;\n public static final int TF_MEDIUM = 1;\n public static final int TF_BOLD = 2;\n public static final int TF_ITALIC = 3;\n public static final int TF_CONDENSED = 4;\n public static final int TF_BOLDCONDENSED = 5;\n\n private static final String[] FONT_FILENAMES = new String[] {\n \"fonts/Roboto-Regular.ttf\",\n \"fonts/Roboto-Medium.ttf\",\n \"fonts/Roboto-Bold.ttf\",\n \"fonts/Roboto-Italic.ttf\",\n \"fonts/Roboto-Condensed.ttf\",\n \"fonts/Roboto-BoldCondensed.ttf\"\n };\n\n private static final String[] FONT_FAMILIES = new String[] {\n \"sans-serif\",\n \"sans-serif-medium\",\n \"sans-serif\",\n \"sans-serif\",\n \"sans-serif-condensed\",\n \"sans-serif-condensed\"\n };\n private static final int[] FONT_STYLES = new int[] {\n Typeface.NORMAL,\n Typeface.NORMAL,\n Typeface.BOLD,\n Typeface.ITALIC,\n Typeface.NORMAL,\n Typeface.BOLD\n };\n\n private static final SparseArray sTypefaces = new SparseArray<>();\n\n public static Typeface getTypeface(int typeface, int style) {\n switch (style) {\n case Typeface.BOLD:\n switch (typeface) {\n case TF_REGULAR: typeface = TF_BOLD; break;\n case TF_CONDENSED: typeface = TF_BOLDCONDENSED; break;\n }\n break;\n case Typeface.ITALIC:\n switch (typeface) {\n case TF_REGULAR: typeface = TF_ITALIC; break;\n }\n break;\n }\n return getTypeface(typeface);\n }\n\n public static Typeface getTypeface(int typeface) {\n if (typeface < TF_REGULAR || typeface > TF_BOLDCONDENSED) {\n return null;\n }\n\n Typeface tf = sTypefaces.get(typeface);\n if (tf == null) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n // L has all typefaces we need, use system fonts\n tf = Typeface.create(FONT_FAMILIES[typeface], FONT_STYLES[typeface]);\n } else {\n // use our fonts\n AssetManager assets = Gh4Application.get().getAssets();\n tf = Typeface.createFromAsset(assets, FONT_FILENAMES[typeface]);\n }\n sTypefaces.put(typeface, tf);\n }\n\n return tf;\n }\n}\n"} +{"text": "/*\n * Copyright 2007-2017 Charles du Jeu - Abstrium SAS \n * This file is part of Pydio.\n *\n * Pydio is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Pydio is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Pydio. If not, see .\n *\n * The latest code can be found at .\n */\n\nimport {Component} from 'react'\nimport Pydio from 'pydio'\nimport Joyride from 'react-joyride'\nconst {PydioContextConsumer} = Pydio.requireLib('boot')\n\nclass TourGuide extends Component{\n\n render(){\n\n const message = (id) => {\n return this.props.getMessage('ajax_gui.tour.locale.' + id);\n }\n const locales = ['back','close','last','next','skip'];\n let locale = {};\n locales.forEach((k) => {\n locale[k] = message(k);\n })\n return (\n );\n\n }\n\n}\nTourGuide = PydioContextConsumer(TourGuide);\nexport {TourGuide as default}"} +{"text": "// ancestors\nparentof(\"douglas\", \"john\").\nparentof(\"john\", \"bob\").\nparentof(\"bob\", \"ebbon\").\n\nparentof(\"douglas\", \"jane\").\nparentof(\"jane\", \"jan\").\n\nancestorof(A, B) <- parentof(A, B).\nancestorof(A, C) <- ancestorof(A, B), parentof(B,C).\n\ngrandparentof(A, B) <- parentof(A, C), parentof(C, B).\n\ncousins(A,B) <- grandparentof(C,A), grandparentof(C,B).\n\nparentof[`arg](A, B) -> int[32](A), !string(B)."} +{"text": "package new\n\nfun f() {\n\n}\n"} +{"text": "package gitbucket.core.service\n\nimport gitbucket.core.model.Milestone\nimport gitbucket.core.model.Profile._\nimport gitbucket.core.model.Profile.profile.blockingApi._\nimport gitbucket.core.model.Profile.dateColumnType\n\ntrait MilestonesService {\n\n def createMilestone(\n owner: String,\n repository: String,\n title: String,\n description: Option[String],\n dueDate: Option[java.util.Date]\n )(implicit s: Session): Unit =\n Milestones insert Milestone(\n userName = owner,\n repositoryName = repository,\n title = title,\n description = description,\n dueDate = dueDate,\n closedDate = None\n )\n\n def updateMilestone(milestone: Milestone)(implicit s: Session): Unit =\n Milestones\n .filter(t => t.byPrimaryKey(milestone.userName, milestone.repositoryName, milestone.milestoneId))\n .map(t => (t.title, t.description, t.dueDate, t.closedDate))\n .update(milestone.title, milestone.description, milestone.dueDate, milestone.closedDate)\n\n def openMilestone(milestone: Milestone)(implicit s: Session): Unit =\n updateMilestone(milestone.copy(closedDate = None))\n\n def closeMilestone(milestone: Milestone)(implicit s: Session): Unit =\n updateMilestone(milestone.copy(closedDate = Some(currentDate)))\n\n def deleteMilestone(owner: String, repository: String, milestoneId: Int)(implicit s: Session): Unit = {\n Issues.filter(_.byMilestone(owner, repository, milestoneId)).map(_.milestoneId.?).update(None)\n Milestones.filter(_.byPrimaryKey(owner, repository, milestoneId)).delete\n }\n\n def getMilestone(owner: String, repository: String, milestoneId: Int)(implicit s: Session): Option[Milestone] =\n Milestones.filter(_.byPrimaryKey(owner, repository, milestoneId)).firstOption\n\n def getMilestonesWithIssueCount(owner: String, repository: String)(\n implicit s: Session\n ): List[(Milestone, Int, Int)] = {\n val counts = Issues\n .filter { t =>\n t.byRepository(owner, repository) && (t.milestoneId.? isDefined)\n }\n .groupBy { t =>\n t.milestoneId -> t.closed\n }\n .map { case (t1, t2) => t1._1 -> t1._2 -> t2.length }\n .list\n .toMap\n\n getMilestones(owner, repository).map { milestone =>\n (\n milestone,\n counts.getOrElse((milestone.milestoneId, false), 0),\n counts.getOrElse((milestone.milestoneId, true), 0)\n )\n }\n }\n\n def getMilestones(owner: String, repository: String)(implicit s: Session): List[Milestone] =\n Milestones\n .filter(_.byRepository(owner, repository))\n .sortBy(t => (t.dueDate.asc, t.closedDate.desc, t.milestoneId.desc))\n .list\n\n}\n"} +{"text": "import CFoo\nimport Foundation\n\nfunc use(_ t: T) {}\n\n@objc public class Foo : NSObject {\n @objc public func f() {\n let foo = CFoo(x: 23)\n let bar = FromBridgingHeader(y: 42)\n use(foo) // break here\n use(bar)\n }\n}\n"} +{"text": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"chrome/browser/chromeos/file_manager/url_util.h\"\n\n#include \n\n#include \"base/json/json_writer.h\"\n#include \"base/values.h\"\n#include \"chrome/browser/chromeos/file_manager/app_id.h\"\n#include \"net/base/escape.h\"\n\nnamespace file_manager {\nnamespace util {\nnamespace {\n\nconst char kAllowedPaths[] = \"allowedPaths\";\nconst char kNativePath[] = \"nativePath\";\nconst char kNativeOrDrivePath[] = \"nativeOrDrivePath\";\nconst char kAnyPath[] = \"anyPath\";\n\n// Returns a file manager URL for the given |path|.\nGURL GetFileManagerUrl(const char* path) {\n return GURL(std::string(\"chrome-extension://\") + kFileManagerAppId + path);\n}\n\n// Converts a numeric dialog type to a string.\nstd::string GetDialogTypeAsString(\n ui::SelectFileDialog::Type dialog_type) {\n std::string type_str;\n switch (dialog_type) {\n case ui::SelectFileDialog::SELECT_NONE:\n type_str = \"full-page\";\n break;\n\n case ui::SelectFileDialog::SELECT_FOLDER:\n type_str = \"folder\";\n break;\n\n case ui::SelectFileDialog::SELECT_UPLOAD_FOLDER:\n type_str = \"upload-folder\";\n break;\n\n case ui::SelectFileDialog::SELECT_SAVEAS_FILE:\n type_str = \"saveas-file\";\n break;\n\n case ui::SelectFileDialog::SELECT_OPEN_FILE:\n type_str = \"open-file\";\n break;\n\n case ui::SelectFileDialog::SELECT_OPEN_MULTI_FILE:\n type_str = \"open-multi-file\";\n break;\n\n default:\n NOTREACHED();\n }\n\n return type_str;\n}\n\n} // namespace\n\nGURL GetFileManagerMainPageUrl() {\n return GetFileManagerUrl(\"/main.html\");\n}\n\nGURL GetFileManagerMainPageUrlWithParams(\n ui::SelectFileDialog::Type type,\n const base::string16& title,\n const GURL& current_directory_url,\n const GURL& selection_url,\n const std::string& target_name,\n const ui::SelectFileDialog::FileTypeInfo* file_types,\n int file_type_index,\n const base::FilePath::StringType& default_extension) {\n base::DictionaryValue arg_value;\n arg_value.SetString(\"type\", GetDialogTypeAsString(type));\n arg_value.SetString(\"title\", title);\n arg_value.SetString(\"currentDirectoryURL\", current_directory_url.spec());\n arg_value.SetString(\"selectionURL\", selection_url.spec());\n arg_value.SetString(\"targetName\", target_name);\n arg_value.SetString(\"defaultExtension\", default_extension);\n\n if (file_types) {\n base::ListValue* types_list = new base::ListValue();\n for (size_t i = 0; i < file_types->extensions.size(); ++i) {\n base::ListValue* extensions_list = new base::ListValue();\n for (size_t j = 0; j < file_types->extensions[i].size(); ++j) {\n extensions_list->Append(\n new base::StringValue(file_types->extensions[i][j]));\n }\n\n base::DictionaryValue* dict = new base::DictionaryValue();\n dict->Set(\"extensions\", extensions_list);\n\n if (i < file_types->extension_description_overrides.size()) {\n base::string16 desc = file_types->extension_description_overrides[i];\n dict->SetString(\"description\", desc);\n }\n\n // file_type_index is 1-based. 0 means no selection at all.\n dict->SetBoolean(\"selected\",\n (static_cast(file_type_index) == (i + 1)));\n\n types_list->Set(i, dict);\n }\n arg_value.Set(\"typeList\", types_list);\n\n arg_value.SetBoolean(\"includeAllFiles\", file_types->include_all_files);\n }\n\n // If the caller cannot handle Drive path, the file chooser dialog need to\n // return resolved local native paths to the selected files.\n if (file_types) {\n switch (file_types->allowed_paths) {\n case ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH:\n arg_value.SetString(kAllowedPaths, kNativePath);\n break;\n case ui::SelectFileDialog::FileTypeInfo::NATIVE_OR_DRIVE_PATH:\n arg_value.SetString(kAllowedPaths, kNativeOrDrivePath);\n break;\n case ui::SelectFileDialog::FileTypeInfo::ANY_PATH:\n arg_value.SetString(kAllowedPaths, kAnyPath);\n break;\n }\n } else {\n arg_value.SetString(kAllowedPaths, kNativePath);\n }\n\n std::string json_args;\n base::JSONWriter::Write(arg_value, &json_args);\n\n std::string url = GetFileManagerMainPageUrl().spec() + '?' +\n net::EscapeUrlEncodedData(json_args,\n false); // Space to %20 instead of +.\n return GURL(url);\n}\n\n} // namespace util\n} // namespace file_manager\n"} +{"text": "@model SemanticBootstrap.Models.VerifyPhoneNumberViewModel\n@{\n ViewBag.Title = \"Verify Phone Number\";\n}\n\n

@ViewBag.Title.

\n\n@using (Html.BeginForm(\"VerifyPhoneNumber\", \"Manage\", FormMethod.Post, new { @class = \"form-horizontal\", role = \"form\" }))\n{\n @Html.AntiForgeryToken()\n @Html.Hidden(\"phoneNumber\", @Model.PhoneNumber)\n

Enter verification code

\n
@ViewBag.Status
\n
\n @Html.ValidationSummary(\"\", new { @class = \"text-danger\" })\n
\n @Html.LabelFor(m => m.Code, new { @class = \"col-md-2 control-label\" })\n
\n @Html.TextBoxFor(m => m.Code, new { @class = \"form-control\" })\n
\n
\n
\n
\n \n
\n
\n}\n\n@section Scripts {\n @Scripts.Render(\"~/bundles/jqueryval\")\n}\n"} +{"text": "// Copyright (c) 2007, Google Inc.\n// All rights reserved.\n// \n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n// \n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n// \n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// ---\n// Author: Craig Silverstein\n\n#ifndef TCMALLOC_TOOLS_TESTUTIL_H_\n#define TCMALLOC_TOOLS_TESTUTIL_H_\n\n// Run a function in a thread of its own and wait for it to finish.\n// The function you pass in must have the signature\n// void MyFunction();\nextern \"C\" void RunThread(void (*fn)());\n\n// Run a function X times, in X threads, and wait for them all to finish.\n// The function you pass in must have the signature\n// void MyFunction();\nextern \"C\" void RunManyThreads(void (*fn)(), int count);\n\n// The 'advanced' version: run a function X times, in X threads, and\n// wait for them all to finish. Give them all the specified stack-size.\n// (If you're curious why this takes a stacksize and the others don't,\n// it's because the one client of this fn wanted to specify stacksize. :-) )\n// The function you pass in must have the signature\n// void MyFunction(int idx);\n// where idx is the index of the thread (which of the X threads this is).\nextern \"C\" void RunManyThreadsWithId(void (*fn)(int), int count, int stacksize);\n\n// When compiled 64-bit and run on systems with swap several unittests will end\n// up trying to consume all of RAM+swap, and that can take quite some time. By\n// limiting the address-space size we get sufficient coverage without blowing\n// out job limits.\nvoid SetTestResourceLimit();\n\n#endif // TCMALLOC_TOOLS_TESTUTIL_H_\n"} +{"text": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\r\n/* vim:expandtab:shiftwidth=2:tabstop=2:\r\n */\r\n/* ***** BEGIN LICENSE BLOCK *****\r\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\r\n *\r\n * The contents of this file are subject to the Mozilla Public License Version\r\n * 1.1 (the \"License\"); you may not use this file except in compliance with\r\n * the License. You may obtain a copy of the License at\r\n * http://www.mozilla.org/MPL/\r\n *\r\n * Software distributed under the License is distributed on an \"AS IS\" basis,\r\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r\n * for the specific language governing rights and limitations under the\r\n * License.\r\n *\r\n * The Original Code is mozilla.org code.\r\n *\r\n * The Initial Developer of the Original Code is\r\n * Mozilla Foundation.\r\n * Portions created by the Initial Developer are Copyright (C) 2007\r\n * the Initial Developer. All Rights Reserved.\r\n *\r\n * Contributor(s):\r\n * Alexander Surkov (original author)\r\n *\r\n * Alternatively, the contents of this file may be used under the terms of\r\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\r\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\r\n * in which case the provisions of the GPL or the LGPL are applicable instead\r\n * of those above. If you wish to allow use of your version of this file only\r\n * under the terms of either the GPL or the LGPL, and not to allow others to\r\n * use your version of this file under the terms of the MPL, indicate your\r\n * decision by deleting the provisions above and replace them with the notice\r\n * and other provisions required by the GPL or the LGPL. If you do not delete\r\n * the provisions above, a recipient may use your version of this file under\r\n * the terms of any one of the MPL, the GPL or the LGPL.\r\n *\r\n * ***** END LICENSE BLOCK ***** */\r\n\r\n#ifndef _NSHTMLTABLEACCESSIBLEWRAP_H\r\n#define _NSHTMLTABLEACCESSIBLEWRAP_H\r\n\r\n#include \"nsHTMLTableAccessible.h\"\r\n#include \"CAccessibleTable.h\"\r\n\r\nclass nsHTMLTableAccessibleWrap : public nsHTMLTableAccessible,\r\n public CAccessibleTable\r\n{\r\npublic:\r\n nsHTMLTableAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference* aShell) :\r\n nsHTMLTableAccessible(aNode, aShell){}\r\n\r\n // IUnknown\r\n DECL_IUNKNOWN_INHERITED\r\n\r\n // nsISupports\r\n NS_DECL_ISUPPORTS_INHERITED\r\n};\r\n\r\nclass nsHTMLTableHeadAccessibleWrap : public nsHTMLTableHeadAccessible,\r\n public CAccessibleTable\r\n{\r\npublic:\r\n nsHTMLTableHeadAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference* aShell) :\r\n nsHTMLTableHeadAccessible(aNode, aShell){}\r\n\r\n // IUnknown\r\n DECL_IUNKNOWN_INHERITED\r\n\r\n // nsISupports\r\n NS_DECL_ISUPPORTS_INHERITED\r\n};\r\n\r\n#endif\r\n\r\n"} +{"text": "from __future__ import absolute_import\n\nfrom .util import invalid_schema_with_error_message\nfrom sentry.testutils import TestCase\nfrom sentry.api.validators.sentry_apps.schema import validate_ui_element_schema\n\n\nclass TestSchemaValidation(TestCase):\n def setUp(self):\n self.schema = {\n \"elements\": [\n {\n \"type\": \"issue-link\",\n \"link\": {\n \"uri\": \"/sentry/issues/link\",\n \"required_fields\": [\n {\n \"type\": \"select\",\n \"name\": \"assignee\",\n \"label\": \"Assignee\",\n \"uri\": \"/sentry/members\",\n }\n ],\n },\n \"create\": {\n \"uri\": \"/sentry/issues/create\",\n \"required_fields\": [\n {\"type\": \"text\", \"name\": \"title\", \"label\": \"Title\"},\n {\"type\": \"text\", \"name\": \"summary\", \"label\": \"Summary\"},\n ],\n \"optional_fields\": [\n {\n \"type\": \"select\",\n \"name\": \"points\",\n \"label\": \"Points\",\n \"options\": [\n [\"1\", \"1\"],\n [\"2\", \"2\"],\n [\"3\", \"3\"],\n [\"5\", \"5\"],\n [\"8\", \"8\"],\n ],\n },\n {\n \"type\": \"select\",\n \"name\": \"assignee\",\n \"label\": \"Assignee\",\n \"uri\": \"/sentry/members\",\n },\n ],\n },\n },\n {\n \"type\": \"alert-rule-action\",\n \"required_fields\": [\n {\"type\": \"text\", \"name\": \"channel\", \"label\": \"Channel\"},\n {\n \"type\": \"select\",\n \"name\": \"send_email\",\n \"label\": \"Send Email?\",\n \"options\": [[\"Yes\", \"yes\"], [\"No\", \"no\"]],\n },\n ],\n },\n {\n \"type\": \"issue-media\",\n \"title\": \"Feature Demo\",\n \"elements\": [{\"type\": \"video\", \"url\": \"/sentry/issues/video\"}],\n },\n {\"type\": \"stacktrace-link\", \"uri\": \"/sentry/issue\"},\n ]\n }\n\n def test_valid_schema_with_options(self):\n validate_ui_element_schema(self.schema)\n\n @invalid_schema_with_error_message(\"'elements' is a required property\")\n def test_invalid_schema_elements_missing(self):\n schema = {\"type\": \"nothing\"}\n validate_ui_element_schema(schema)\n\n @invalid_schema_with_error_message(\"'elements' should be an array of objects\")\n def test_invalid_schema_elements_not_array(self):\n schema = {\"elements\": {\"type\": \"issue-link\"}}\n validate_ui_element_schema(schema)\n\n @invalid_schema_with_error_message(\"Each element needs a 'type' field\")\n def test_invalid_schema_type_missing(self):\n schema = {\"elements\": [{\"key\": \"issue-link\"}]}\n validate_ui_element_schema(schema)\n\n @invalid_schema_with_error_message(\n \"Element has type 'other'. Type must be one of the following: ['issue-link', 'alert-rule-action', 'issue-media', 'stacktrace-link']\"\n )\n def test_invalid_schema_type_invalid(self):\n schema = {\"elements\": [{\"type\": \"other\"}]}\n validate_ui_element_schema(schema)\n\n @invalid_schema_with_error_message(\n \"'uri' is a required property for element of type 'stacktrace-link'\"\n )\n def test_invalid_chema_element_missing_uri(self):\n schema = {\n \"elements\": [{\"url\": \"/stacktrace/github/getsentry/sentry\", \"type\": \"stacktrace-link\"}]\n }\n validate_ui_element_schema(schema)\n"} +{"text": "/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n==============================================================================*/\n\n#define CPU_PROVIDED_IXDIM 2\n#include \"tensorflow/core/kernels/image/mirror_pad_op_cpu_impl.h\"\n#undef CPU_PROVIDED_IXDIM\n"} +{"text": "\\hypertarget{classcontains}{\n\\section{contains Class Reference}\n\\label{classcontains}\\index{contains@{contains}}\n}\n\n\nThe \\hyperlink{interface_g_d_u_limit}{GDULimit} environment resources. \n\n\n\\subsection{Detailed Description}\nThe \\hyperlink{interface_g_d_u_limit}{GDULimit} environment resources. \n\nThe documentation for this class was generated from the following file:\\begin{DoxyCompactItemize}\n\\item \nsrc/GDULimit.h\\end{DoxyCompactItemize}\n"} +{"text": "\n\n \n \n \n \n <%= yield %>\n \n"} +{"text": "\n\n\n\n\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\nThis text should appear ABOVE the green and red blocks.\n
\n\n\n"} +{"text": "\npackage require qsys\nsource ../scripts/adi_env.tcl\nsource ../scripts/adi_ip_intel.tcl\n\nset_module_property NAME axi_laser_driver\nset_module_property DESCRIPTION \"AXI Laser Driver IP for Lidar prototyping platform \"\nset_module_property VERSION 1.0\nset_module_property GROUP \"Analog Devices\"\nset_module_property DISPLAY_NAME axi_laser_driver\n\n# source files\n\nad_ip_files axi_laser_driver [list \\\n \"$ad_hdl_dir/library/util_cdc/sync_bits.v\" \\\n \"$ad_hdl_dir/library/util_cdc/sync_event.v\" \\\n \"$ad_hdl_dir/library/common/ad_rst.v\" \\\n \"$ad_hdl_dir/library/common/up_axi.v\" \\\n \"$ad_hdl_dir/library/common/up_clock_mon.v\" \\\n \"$ad_hdl_dir/library/common/util_pulse_gen.v\" \\\n \"$ad_hdl_dir/library/axi_pulse_gen/axi_pulse_gen_regmap.v\" \\\n \"$ad_hdl_dir/library/axi_pulse_gen/axi_pulse_gen_constr.sdc\" \\\n \"axi_laser_driver_constr.sdc\" \\\n \"axi_laser_driver_regmap.v\" \\\n \"axi_laser_driver.v\"]\n\n# IP parameters\n\nadd_parameter ID INTEGER 0\nset_parameter_property ID DEFAULT_VALUE 0\nset_parameter_property ID DISPLAY_NAME \"Core ID\"\nset_parameter_property ID UNITS None\nset_parameter_property ID HDL_PARAMETER true\n\nadd_parameter ASYNC_CLK_EN INTEGER 0\nset_parameter_property ASYNC_CLK_EN DEFAULT_VALUE 0\nset_parameter_property ASYNC_CLK_EN DISPLAY_NAME \"Asynchronous Clocks\"\nset_parameter_property ASYNC_CLK_EN DISPLAY_HINT boolean\nset_parameter_property ASYNC_CLK_EN ALLOWED_RANGES { \"0:Disabled\" \"1:Enabled\"}\nset_parameter_property ASYNC_CLK_EN HDL_PARAMETER true\n\nadd_parameter PULSE_WIDTH INTEGER 0\nset_parameter_property PULSE_WIDTH DEFAULT_VALUE 0\nset_parameter_property PULSE_WIDTH DISPLAY_NAME \"PWM pulse width\"\nset_parameter_property PULSE_WIDTH UNITS None\nset_parameter_property PULSE_WIDTH HDL_PARAMETER true\n\nadd_parameter PULSE_PERIOD INTEGER 0\nset_parameter_property PULSE_PERIOD DEFAULT_VALUE 0\nset_parameter_property PULSE_PERIOD DISPLAY_NAME \"PWM period\"\nset_parameter_property PULSE_PERIOD UNITS None\nset_parameter_property PULSE_PERIOD HDL_PARAMETER true\n\n# AXI4 Memory Mapped Interface\n\nad_ip_intf_s_axi s_axi_aclk s_axi_aresetn 15\n\n# Interrupt interface\n\nadd_interface interrupt_sender interrupt end\nset_interface_property interrupt_sender associatedAddressablePoint s_axi\nset_interface_property interrupt_sender associatedClock s_axi_clock\nset_interface_property interrupt_sender associatedReset s_axi_reset\nset_interface_property interrupt_sender ENABLED true\nset_interface_property interrupt_sender EXPORT_OF \"\"\nset_interface_property interrupt_sender PORT_NAME_MAP \"\"\nset_interface_property interrupt_sender CMSIS_SVD_VARIABLES \"\"\nset_interface_property interrupt_sender SVD_ADDRESS_GROUP \"\"\n\nadd_interface_port interrupt_sender irq irq Output 1\n\n# external clock and control/status ports\n\nad_interface clock ext_clk input 1\n\nad_interface signal driver_en_n output 1\nad_interface signal driver_pulse output 1\nad_interface signal driver_otw_n input 1\nad_interface reset driver_dp_reset output 1 if_ext_clk\nad_interface signal tia_chsel output 8\n\n"} +{"text": "\n\n\n\n\t\n\tHTML Compliant Output — CKEditor Sample\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\n\n\t

\n\t\tCKEditor Samples » Producing HTML Compliant Output\n\t

\n\t
\n\t\tThis sample is not maintained anymore. Check out the brand new samples in CKEditor SDK.\n\t
\n\t
\n\t\t

\n\t\t\tThis sample shows how to configure CKEditor to output valid\n\t\t\tHTML 4.01 code.\n\t\t\tTraditional HTML elements like <b>,\n\t\t\t<i>, and <font> are used in place of\n\t\t\t<strong>, <em>, and CSS styles.\n\t\t

\n\t\t

\n\t\t\tTo add a CKEditor instance outputting legacy HTML 4.01 code, load the editor using a standard\n\t\t\tJavaScript call, and define CKEditor features to use the HTML compliant elements and attributes.\n\t\t

\n\t\t

\n\t\t\tA snippet of the configuration code can be seen below; check the source of this page for\n\t\t\tfull definition:\n\t\t

\n
\nCKEDITOR.replace( 'textarea_id', {\n\tcoreStyles_bold: { element: 'b' },\n\tcoreStyles_italic: { element: 'i' },\n\n\tfontSize_style: {\n\t\telement: 'font',\n\t\tattributes: { 'size': '#(size)' }\n\t}\n\n\t...\n});
\n\t
\n\t
\n\t\t

\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t

\n\t\t

\n\t\t\t\n\t\t

\n\t
\n\t
\n\t\t
\n\t\t

\n\t\t\tCKEditor - The text editor for the Internet - http://ckeditor.com\n\t\t

\n\t\t

\n\t\t\tCopyright © 2003-2016, CKSource - Frederico\n\t\t\tKnabben. All rights reserved.\n\t\t

\n\t
\n\n\n"} +{"text": "APPLICATION_EXTENSION_API_ONLY = YES\nCONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/boost-for-react-native\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1\nPODS_BUILD_DIR = ${BUILD_DIR}\nPODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\nPODS_ROOT = ${SRCROOT}\nPODS_TARGET_SRCROOT = ${PODS_ROOT}/boost-for-react-native\nPRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}\nSKIP_INSTALL = YES\nUSE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES\n"} +{"text": "---\ntitle: Interactions and contrasts\nlayout: page\n---\n\n```{r options, echo=FALSE}\nlibrary(knitr)\nopts_chunk$set(fig.path=paste0(\"figure/\", sub(\"(.*).Rmd\",\"\\\\1\",basename(knitr:::knit_concord$get('infile'))), \"-\"))\n```\n\n## Interactions and Contrasts\n\nAs a running example to learn about more complex linear models, we will be using a dataset which compares the different frictional coefficients on the different legs of a spider. Specifically, we will be determining whether more friction comes from a pushing or pulling motion of the leg. The original paper from which the data was provided is:\n\nJonas O. Wolff & Stanislav N. Gorb, [Radial arrangement of Janus-like setae permits friction control in spiders](http://dx.doi.org/10.1038/srep01101), Scientific Reports, 22 January 2013.\n\nThe abstract of the paper says, \n\n> The hunting spider Cupiennius salei (Arachnida, Ctenidae) possesses hairy attachment pads (claw tufts) at its distal legs, consisting of directional branched setae... Friction of claw tufts on smooth glass was measured to reveal the functional effect of seta arrangement within the pad.\n\n[Figure 1](http://www.nature.com/articles/srep01101/figures/1) \nincludes some pretty cool electron microscope images of the tufts. We are interested in the comparisons in \n[Figure 4](http://www.nature.com/articles/srep01101/figures/4), \nwhere the pulling and pushing motions are compared for different leg pairs (for a diagram of pushing and pulling see the top of \n[Figure 3](http://www.nature.com/articles/srep01101/figures/3)). \n\nWe include the data in our dagdata package and can download it from [here](https://raw.githubusercontent.com/genomicsclass/dagdata/master/inst/extdata/spider_wolff_gorb_2013.csv).\n\n```{r,echo=FALSE}\nurl <- \"https://raw.githubusercontent.com/genomicsclass/dagdata/master/inst/extdata/spider_wolff_gorb_2013.csv\"\nfilename <- \"spider_wolff_gorb_2013.csv\"\nlibrary(downloader)\nif (!file.exists(filename)) download(url, filename)\n```\n\n```{r}\nspider <- read.csv(\"spider_wolff_gorb_2013.csv\", skip=1)\n```\n\n\n#### Initial visual inspection of the data\n\nEach measurement comes from one of our legs while it is either pushing or pulling. So we have two variables:\n\n```{r}\ntable(spider$leg,spider$type)\n```\n\n\nWe can make a boxplot summarizing the measurements for each of the eight pairs. This is similar to Figure 4 of the original paper:\n\n```{r spide_data, fig.cap=\"Comparison of friction coefficients of spiders' different leg pairs. The friction coefficient is calculated as the ratio of two forces (see paper Methods) so it is unitless.\"}\nboxplot(spider$friction ~ spider$type * spider$leg, \n col=c(\"grey90\",\"grey40\"), las=2, \n main=\"Comparison of friction coefficients of different leg pairs\")\n```\n\n\nWhat we can immediately see are two trends: \n\n* The pulling motion has higher friction than the pushing motion.\n* The leg pairs to the back of the spider (L4 being the last) have higher pulling friction.\n\nAnother thing to notice is that the groups have different spread around their average, what we call *within-group variance*. This is somewhat of a problem for the kinds of linear models we will explore below, since we will be assuming that around the population average values, the errors $\\varepsilon_i$ are distributed identically, meaning the same variance within each group. The consequence of ignoring the different variances for the different groups is that comparisons between those groups with small variances will be overly \"conservative\" (because the overall estimate of variance is larger than an estimate for just these groups), and comparisons between those groups with large variances will be overly confident. If the spread is related to the range of friction, such that groups with large friction values also have larger spread, a possibility is to transform the data with a function such as the `log` or `sqrt`. This looks like it could be useful here, since three of the four push groups (L1, L2, L3) have the smallest friction values and also the smallest spread.\n\nSome alternative tests for comparing groups without transforming the values first include: t-tests without the equal variance assumption using a \"Welch\" or \"Satterthwaite approximation\", or the Wilcoxon rank sum test mentioned previously. However here, for simplicity of illustration, we will fit a model that assumes equal variance and shows the different kinds of linear model designs using this dataset, setting aside the issue of different within-group variances.\n\n#### A linear model with one variable\n\nTo remind ourselves how the simple two-group linear model looks, we will subset the data to include only the L1 leg pair, and run `lm`:\n\n```{r}\nspider.sub <- spider[spider$leg == \"L1\",]\nfit <- lm(friction ~ type, data=spider.sub)\nsummary(fit)\n(coefs <- coef(fit))\n```\n\nThese two estimated coefficients are the mean of the pull observations (the first estimated coefficient) and the difference between the means of the two groups (the second coefficient). We can show this with R code:\n\n```{r}\ns <- split(spider.sub$friction, spider.sub$type)\nmean(s[[\"pull\"]])\nmean(s[[\"push\"]]) - mean(s[[\"pull\"]])\n```\n\nWe can form the design matrix, which was used inside `lm`:\n\n```{r}\nX <- model.matrix(~ type, data=spider.sub)\ncolnames(X)\nhead(X)\ntail(X)\n```\n\nNow we'll make a plot of the $\\mathbf{X}$ matrix by putting a black block for the 1's and a white block for the 0's. This plot will be more interesting for the linear models later on in this script. Along the y-axis is the sample number (the row number of the `data`) and along the x-axis is the column of the design matrix $\\mathbf{X}$. If you have installed the *rafalib* library, you can make this plot with the `imagemat` function:\n\n```{r model_matrix_image, fig.cap=\"Model matrix for linear model with one variable.\"}\nlibrary(rafalib)\nimagemat(X, main=\"Model matrix for linear model with one variable\")\n```\n\n#### Examining the estimated coefficients\n\nNow we show the coefficient estimates from the linear model in a diagram with arrows (code not shown).\n\n```{r spider_main_coef, fig.cap=\"Diagram of the estimated coefficients in the linear model. The green arrow indicates the Intercept term, which goes from zero to the mean of the reference group (here the 'pull' samples). The orange arrow indicates the difference between the push group and the pull group, which is negative in this example. The circles show the individual samples, jittered horizontally to avoid overplotting.\",echo=FALSE}\nset.seed(1) #same jitter in stripchart\nstripchart(split(spider.sub$friction, spider.sub$type), \n vertical=TRUE, pch=1, method=\"jitter\", las=2, xlim=c(0,3), ylim=c(0,2))\na <- -0.25\nlgth <- .1\nlibrary(RColorBrewer)\ncols <- brewer.pal(3,\"Dark2\")\nabline(h=0)\narrows(1+a,0,1+a,coefs[1],lwd=3,col=cols[1],length=lgth)\nabline(h=coefs[1],col=cols[1])\narrows(2+a,coefs[1],2+a,coefs[1]+coefs[2],lwd=3,col=cols[2],length=lgth)\nabline(h=coefs[1]+coefs[2],col=cols[2])\nlegend(\"right\",names(coefs),fill=cols,cex=.75,bg=\"white\")\n```\n\n#### A linear model with two variables\n\nNow we'll continue and examine the full dataset, including the observations from all leg pairs. In order to model both the leg pair differences (L1, L2, L3, L4) and the push vs. pull difference, we need to include both terms in the R formula. Let's see what kind of design matrix will be formed with two variables in the formula:\n\n```{r model_matrix_image2, fig.cap=\"Image of the model matrix for a formula with type + leg\"}\nX <- model.matrix(~ type + leg, data=spider)\ncolnames(X)\nhead(X)\nimagemat(X, main=\"Model matrix for linear model with two factors\")\n```\n\nThe first column is the intercept, and so it has 1's for all samples. The second column has 1's for the push samples, and we can see that there are four groups of them. Finally, the third, fourth and fifth columns have 1's for the L2, L3 and L4 samples. The L1 samples do not have a column, because *L1* is the reference level for `leg`. Similarly, there is no *pull* column, because *pull* is the reference level for the `type` variable.\n\nTo estimate coefficients for this model, we use `lm` with the formula `~ type + leg`. We'll save the linear model to `fitTL` standing for a *fit* with *Type* and *Leg*.\n\n\n```{r}\nfitTL <- lm(friction ~ type + leg, data=spider)\nsummary(fitTL)\n(coefs <- coef(fitTL))\n```\n\nR uses the name `coefficient` to denote the component containing the least squares **estimates**. It is important to remember that the coefficients are parameters that we do not observe, but only estimate.\n\n#### Mathematical representation\n\nThe model we are fitting above can be written as\n\n$$\nY_i = \\beta_0 + \\beta_1 x_{i,1} + \\beta_2 x_{i,2} + \\beta_3 x_{i,3} + \\beta_4 x_{i,4} + \\varepsilon_i, i=1,\\dots,N\n$$\n\nwith the $x$ all indicator variables denoting push or pull and which leg. For example, a push on leg 3 will have $x_{i,1}$ and $x_{i,3}$ equal to 1 and the rest would be 0. Throughout this section we will refer to the $\\beta$ s with the effects they represent. For example we call $\\beta_0$ the intercept, $\\beta_1$ the pull effect, $\\beta_2$ the L2 effect, etc. We do not observe the coefficients, e.g. $\\beta_1$, directly, but estimate them with, e.g. $\\hat{\\beta}_4$.\n\nWe can now form the matrix $\\mathbf{X}$ depicted above and obtain the least square estimates with:\n\n$$ \\hat{\\boldsymbol{\\beta}} = (\\mathbf{X}^\\top \\mathbf{X})^{-1} \\mathbf{X}^\\top \\mathbf{Y} $$\n\n```{r}\nY <- spider$friction\nX <- model.matrix(~ type + leg, data=spider)\nbeta.hat <- solve(t(X) %*% X) %*% t(X) %*% Y\nt(beta.hat)\ncoefs\n```\n\nWe can see that these values agree with the output of `lm`.\n\n#### Examining the estimated coefficients\n\nWe can make the same plot as before, with arrows for each of the estimated coefficients in the model (code not shown). \n\n```{r spider_interactions, fig.cap=\"Diagram of the estimated coefficients in the linear model. As before, the teal-green arrow represents the Intercept, which fits the mean of the reference group (here, the pull samples for leg L1). The purple, pink, and yellow-green arrows represent differences between the three other leg groups and L1. The orange arrow represents the difference between the push and pull samples for all groups.\",echo=FALSE}\nspider$group <- factor(paste0(spider$leg, spider$type))\nstripchart(split(spider$friction, spider$group), \n vertical=TRUE, pch=1, method=\"jitter\", las=2, xlim=c(0,11), ylim=c(0,2))\ncols <- brewer.pal(5,\"Dark2\")\nabline(h=0)\narrows(1+a,0,1+a,coefs[1],lwd=3,col=cols[1],length=lgth)\nabline(h=coefs[1],col=cols[1])\narrows(3+a,coefs[1],3+a,coefs[1]+coefs[3],lwd=3,col=cols[3],length=lgth)\narrows(5+a,coefs[1],5+a,coefs[1]+coefs[4],lwd=3,col=cols[4],length=lgth)\narrows(7+a,coefs[1],7+a,coefs[1]+coefs[5],lwd=3,col=cols[5],length=lgth)\narrows(2+a,coefs[1],2+a,coefs[1]+coefs[2],lwd=3,col=cols[2],length=lgth)\nsegments(3+a,coefs[1]+coefs[3],4+a,coefs[1]+coefs[3],lwd=3,col=cols[3])\narrows(4+a,coefs[1]+coefs[3],4+a,coefs[1]+coefs[3]+coefs[2],lwd=3,col=cols[2],length=lgth)\nsegments(5+a,coefs[1]+coefs[4],6+a,coefs[1]+coefs[4],lwd=3,col=cols[4])\narrows(6+a,coefs[1]+coefs[4],6+a,coefs[1]+coefs[4]+coefs[2],lwd=3,col=cols[2],length=lgth)\nsegments(7+a,coefs[1]+coefs[5],8+a,coefs[1]+coefs[5],lwd=3,col=cols[5])\narrows(8+a,coefs[1]+coefs[5],8+a,coefs[1]+coefs[5]+coefs[2],lwd=3,col=cols[2],length=lgth)\nlegend(\"right\",names(coefs),fill=cols,cex=.75,bg=\"white\")\n```\n\nIn this case, the fitted means for each group, derived from the fitted coefficients, do not line up with those we obtain from simply taking the average from each of the eight possible groups. The reason is that our model uses five coefficients, instead of eight. We are **assuming** that the effects are additive. However, as we demonstrate in more detail below, this particular dataset is better described with a model including interactions.\n \n```{r}\ns <- split(spider$friction, spider$group)\nmean(s[[\"L1pull\"]])\ncoefs[1]\nmean(s[[\"L1push\"]])\ncoefs[1] + coefs[2]\n```\n\nHere we can demonstrate that the push vs. pull estimated coefficient, `coefs[2]`, is a weighted average of the difference of the means for each group. Furthermore, the weighting is determined by the sample size of each group. The math works out simply here because the sample size is equal for the push and pull subgroups within each leg pair. If the sample sizes were not equal for push and pull within each leg pair, the weighting is more complicated but uniquely determined by a formula involving the sample size of each subgroup, the total sample size, and the number of coefficients. This can be worked out from $(\\mathbf{X}^\\top \\mathbf{X})^{-1} \\mathbf{X}^\\top$.\n\n```{r}\nmeans <- sapply(s, mean)\n##the sample size of push or pull groups for each leg pair\nns <- sapply(s, length)[c(1,3,5,7)]\n(w <- ns/sum(ns))\nsum(w * (means[c(2,4,6,8)] - means[c(1,3,5,7)]))\ncoefs[2]\n```\n\n#### Contrasting coefficients\n\nSometimes, the comparison we are interested in is represented directly by a single coefficient in the model, such as the push vs. pull difference, which was `coefs[2]` above. However, sometimes, we want to make a comparison which is not a single coefficient, but a combination of coefficients, which is called a _contrast_. To introduce the concept of _contrasts_, first consider the comparisons which we can read off from the linear model summary:\n\n```{r}\ncoefs\n```\n\nHere we have the intercept estimate, the push vs. pull estimated effect across all leg pairs, and the estimates for the L2 vs. L1 effect, the L3 vs. L1 effect, and the L4 vs. L1 effect. What if we want to compare two groups and one of those groups is not L1? The solution to this question is to use *contrasts*. \n\nA *contrast* is a combination of estimated coefficient: $\\mathbf{c^\\top} \\hat{\\boldsymbol{\\beta}}$, where $\\mathbf{c}$ is a column vector with as many rows as the number of coefficients in the linear model. If $\\mathbf{c}$ has a 0 for one or more of its rows, then the corresponding estimated coefficients in $\\hat{\\boldsymbol{\\beta}}$ are not involved in the contrast.\n\nIf we want to compare leg pairs L3 and L2, this is equivalent to contrasting two coefficients from the linear model because, in this contrast, the comparison to the reference level *L1* cancels out:\n\n$$ (\\mbox{L3} - \\mbox{L1}) - (\\mbox{L2} - \\mbox{L1}) = \\mbox{L3} - \\mbox{L2 }$$\n\nAn easy way to make these contrasts of two groups is to use the `contrast` function from the *contrast* package. We just need to specify which groups we want to compare. We have to pick one of *pull* or *push* types, although the answer will not differ, as we will see below.\n\n```{r,message=FALSE,warning=FALSE}\nlibrary(contrast) #Available from CRAN\nL3vsL2 <- contrast(fitTL,list(leg=\"L3\",type=\"pull\"),list(leg=\"L2\",type=\"pull\"))\nL3vsL2\n```\n\nThe first column `Contrast` gives the L3 vs. L2 estimate from the model we fit above.\n\nWe can show that the least squares estimates of a linear combination of coefficients is the same linear combination of the estimates. \nTherefore, the effect size estimate is just the difference between two estimated coefficients. The contrast vector used by `contrast` is stored as a variable called `X` within the resulting object (not to be confused with our original $\\mathbf{X}$, the design matrix).\n\n```{r}\ncoefs[4] - coefs[3]\n(cT <- L3vsL2$X)\ncT %*% coefs\n```\n\nWhat about the standard error and t-statistic? As before, the t-statistic is the estimate divided by the standard error. The standard error of the contrast estimate is formed by multiplying the contrast vector $\\mathbf{c}$ on either side of the estimated covariance matrix, $\\hat{\\Sigma}$, our estimate for $\\mathrm{var}(\\hat{\\boldsymbol{\\beta}})$:\n\n$$ \\sqrt{\\mathbf{c^\\top} \\hat{\\boldsymbol{\\Sigma}} \\mathbf{c}} $$\n\nwhere we saw the covariance of the coefficients earlier:\n\n$$ \n\\boldsymbol{\\Sigma} = \\sigma^2 (\\mathbf{X}^\\top \\mathbf{X})^{-1}\n$$\n\nWe estimate $\\sigma^2$ with the sample estimate $\\hat{\\sigma}^2$ described above and obtain:\n\n```{r}\nSigma.hat <- sum(fitTL$residuals^2)/(nrow(X) - ncol(X)) * solve(t(X) %*% X)\nsignif(Sigma.hat, 2)\nsqrt(cT %*% Sigma.hat %*% t(cT))\nL3vsL2$SE\n```\n\nWe would have obtained the same result for a contrast of L3 and L2 had we picked `type=\"push\"`. The reason it does not change the contrast is because it leads to addition of the `typepush` effect on both sides of the difference, which cancels out:\n\n```{r}\nL3vsL2.equiv <- contrast(fitTL,list(leg=\"L3\",type=\"push\"),list(leg=\"L2\",type=\"push\"))\nL3vsL2.equiv$X\n```\n\n## Linear Model with Interactions\n\nIn the previous linear model, we assumed that the push vs. pull effect was the same for all of the leg pairs (the same orange arrow). You can easily see that this does not capture the trends in the data that well. That is, the tips of the arrows did not line up perfectly with the group averages. For the L1 leg pair, the push vs. pull estimated coefficient was too large, and for the L3 leg pair, the push vs. pull coefficient was somewhat too small.\n\n_Interaction terms_ will help us overcome this problem by introducing additional coefficients to compensate for differences in the push vs. pull effect across the 4 groups. As we already have a push vs. pull term in the model, we only need to add three more terms to have the freedom to find leg-pair-specific push vs. pull differences. As we will see, interaction terms are added to the design matrix by multiplying the columns of the design matrix representing existing terms. \n\nWe can rebuild our linear model with an interaction between `type` and `leg`, by including an extra term in the formula `type:leg`. The `:` symbol adds an interaction between the two variables surrounding it. An equivalent way to specify this model is `~ type*leg`, which will expand to the formula `~ type + leg + type:leg`, with main effects for `type`, `leg` and an interaction term `type:leg`.\n\n```{r model_matrix_with_interaction_image, fig.cap=\"Image of model matrix with interactions.\"}\nX <- model.matrix(~ type + leg + type:leg, data=spider)\ncolnames(X)\nhead(X)\nimagemat(X, main=\"Model matrix for linear model with interactions\")\n```\n\nColumns 6-8 (`typepush:legL2`, `typepush:legL3`, and `typepush:legL4`) are the product of the 2nd column (`typepush`) and columns 3-5 (the three `leg` columns). Looking at the last column, for example, the `typepush:legL4` column is adding an extra coefficient $\\beta_{\\textrm{push,L4}}$ to those samples which are both push samples and leg pair L4 samples. This accounts for a possible difference when the mean of samples in the L4-push group are not at the location which would be predicted by adding the estimated intercept, the estimated push coefficient `typepush`, and the estimated L4 coefficient `legL4`.\n\nWe can run the linear model using the same code as before:\n\n```{r}\nfitX <- lm(friction ~ type + leg + type:leg, data=spider)\nsummary(fitX)\ncoefs <- coef(fitX)\n```\n\n#### Examining the estimated coefficients\n\nHere is where the plot with arrows really helps us interpret the coefficients. The estimated interaction coefficients (the yellow, brown and silver arrows) allow leg-pair-specific differences in the push vs. pull difference. The orange arrow now represents the estimated push vs. pull difference only for the reference leg pair, which is L1. If an estimated interaction coefficient is large, this means that the push vs. pull difference for that leg pair is very different than the push vs. pull difference in the reference leg pair.\n\nNow, as we have eight terms in the model and eight parameters, you can check that the tips of the arrowheads are exactly equal to the group means (code not shown).\n\n```{r spider_interactions2, fig.cap=\"Diagram of the estimated coefficients in the linear model. In the design with interaction terms, the orange arrow now indicates the push vs. pull difference only for the reference group (L1), while three new arrows (yellow, brown and grey) indicate the additional push vs. pull differences in the non-reference groups (L2, L3 and L4) with respect to the reference group.\",echo=FALSE}\nstripchart(split(spider$friction, spider$group), \n vertical=TRUE, pch=1, method=\"jitter\", las=2, xlim=c(0,11), ylim=c(0,2))\ncols <- brewer.pal(8,\"Dark2\")\nabline(h=0)\narrows(1+a,0,1+a,coefs[1],lwd=3,col=cols[1],length=lgth)\nabline(h=coefs[1],col=cols[1])\narrows(2+a,coefs[1],2+a,coefs[1]+coefs[2],lwd=3,col=cols[2],length=lgth)\narrows(3+a,coefs[1],3+a,coefs[1]+coefs[3],lwd=3,col=cols[3],length=lgth)\narrows(5+a,coefs[1],5+a,coefs[1]+coefs[4],lwd=3,col=cols[4],length=lgth)\narrows(7+a,coefs[1],7+a,coefs[1]+coefs[5],lwd=3,col=cols[5],length=lgth)\n#now the interactions:\nsegments(3+a,coefs[1]+coefs[3],4+a,coefs[1]+coefs[3],lwd=3,col=cols[3])\narrows(4+a,coefs[1]+coefs[3],4+a,coefs[1]+coefs[3]+coefs[2],lwd=3,col=cols[2],length=lgth)\narrows(4+a,coefs[1]+coefs[2]+coefs[3],4+a,coefs[1]+coefs[2]+coefs[3]+coefs[6],lwd=3,col=cols[6],length=lgth)\n\nsegments(5+a,coefs[1]+coefs[4],6+a,coefs[1]+coefs[4],lwd=3,col=cols[4])\narrows(6+a,coefs[1]+coefs[4],6+a,coefs[1]+coefs[4]+coefs[2],lwd=3,col=cols[2],length=lgth)\narrows(6+a,coefs[1]+coefs[4]+coefs[2],6+a,coefs[1]+coefs[4]+coefs[2]+coefs[7],lwd=3,col=cols[7],length=lgth)\n\nsegments(7+a,coefs[1]+coefs[5],8+a,coefs[1]+coefs[5],lwd=3,col=cols[5])\narrows(8+a,coefs[1]+coefs[5],8+a,coefs[1]+coefs[5]+coefs[2],lwd=3,col=cols[2],length=lgth)\narrows(8+a,coefs[1]+coefs[5]+coefs[2],8+a,coefs[1]+coefs[5]+coefs[2]+coefs[8],lwd=3,col=cols[8],length=lgth)\nlegend(\"right\",names(coefs),fill=cols,cex=.75,bg=\"white\")\n```\n\n#### Contrasts\n\nAgain we will show how to combine estimated coefficients from the model using contrasts. For some simple cases, we can use the contrast package. Suppose we want to know the push vs. pull effect for the L2 leg pair samples. We can see from the arrow plot that this is the orange arrow plus the yellow arrow. We can also specify this comparison with the `contrast` function:\n\n```{r,message=FALSE,message=FALSE}\nlibrary(contrast) ##Available from CRAN\nL2push.vs.pull <- contrast(fitX,\n list(leg=\"L2\", type = \"push\"), \n list(leg=\"L2\", type = \"pull\"))\nL2push.vs.pull\ncoefs[2] + coefs[6] ##we know this is also orange + yellow arrow\n```\n\n\n#### Differences of differences\n\nThe question of whether the push vs. pull difference is *different* in L2 compared to L1, is answered by a single term in the model: the `typepush:legL2` estimated coefficient corresponding to the yellow arrow in the plot. A p-value for whether this coefficient is actually equal to zero can be read off from the table printed with `summary(fitX)` above. Similarly, we can read off the p-values for the differences of differences for L3 vs. L1 and for L4 vs. L1.\n\nSuppose we want to know if the push vs. pull difference is *different* in L3 compared to L2. By examining the arrows in the diagram above, we can see that the push vs. pull effect for a leg pair other than L1 is the `typepush` arrow plus the interaction term for that group.\n\nIf we work out the math for comparing across two non-reference leg pairs, this is:\n\n$$\n(\\mbox{typepush} + \\mbox{typepush:legL3}) - (\\mbox{typepush} + \\mbox{typepush:legL2})\n$$\n\n...which simplifies to:\n\n$$\n= \\mbox{typepush:legL3} - \\mbox{typepush:legL2}\n$$\n\nWe can't make this contrast using the `contrast` function shown before, but we can make this comparison using the `glht` (for \"general linear hypothesis test\") function from the *multcomp* package. We need to form a 1-row matrix which has a -1 for the `typepush:legL2` coefficient and a +1 for the `typepush:legL3` coefficient. We provide this matrix to the `linfct` (linear function) argument, and obtain a summary table for this contrast of estimated interaction coefficients.\n\nNote that there are other ways to perform contrasts using base R, and this is just our preferred way.\n\n```{r,message=FALSE}\nlibrary(multcomp) ##Available from CRAN\nC <- matrix(c(0,0,0,0,0,-1,1,0), 1)\nL3vsL2interaction <- glht(fitX, linfct=C)\nsummary(L3vsL2interaction)\ncoefs[7] - coefs[6] ##we know this is also brown - yellow\n```\n\n## Analysis of Variance\n\nSuppose that we want to know if the push vs. pull difference is different across leg pairs in general. We do not want to compare any two leg pairs in particular, but rather we want to know if the three interaction terms which represent differences in the push vs. pull difference across leg pairs are larger than we would expect them to be if the push vs. pull difference was in fact equal across all leg pairs.\n\nSuch a question can be answered by an _analysis of variance_, which is often abbreviated as ANOVA. ANOVA compares the reduction in the sum of squares of the residuals for models of different complexity. The model with eight coefficients is more complex than the model with five coefficients where we assumed the push vs. pull difference was equal across leg pairs. The least complex model would only use a single coefficient, an intercept. Under certain assumptions we can also perform inference that determines the probability of improvements as large as what we observed. Let's first print the result of an ANOVA in R and then examine the results in detail:\n\n```{r}\nanova(fitX)\n```\n\nThe first line tells us that adding a variable `type` (push or pull) to the design is very useful (reduces the sum of squared residuals) compared to a model with only an intercept. We can see that it is useful, because this single coefficient reduces the sum of squares by 42.783. The original sum of squares of the model with just an intercept is:\n\n```{r}\nmu0 <- mean(spider$friction)\n(initial.ss <- sum((spider$friction - mu0)^2))\n```\n\nNote that this initial sum of squares is just a scaled version of the sample variance:\n\n```{r}\nN <- nrow(spider)\n(N - 1) * var(spider$friction)\n```\n\nLet's see exactly how we get this 42.783. We need to calculate the sum of squared residuals for the model with only the type information. We can do this by calculating the residuals, squaring these, summing these within groups and then summing across the groups.\n\n```{r}\ns <- split(spider$friction, spider$type)\nafter.type.ss <- sum( sapply(s, function(x) {\n residual <- x - mean(x) \n sum(residual^2)\n }) )\n```\n\nThe reduction in sum of squared residuals from introducing the `type` coefficient is therefore:\n\n```{r}\n(type.ss <- initial.ss - after.type.ss)\n```\n\nThrough [simple arithmetic](http://en.wikipedia.org/wiki/Partition_of_sums_of_squares#Proof), this reduction can be shown to be equivalent to the sum of squared differences between the fitted values for the models with formula `~type` and `~1`:\n\n```{r}\nsum(sapply(s, length) * (sapply(s, mean) - mu0)^2)\n```\n\n\nKeep in mind that the order of terms in the formula, and therefore rows in the ANOVA table, is important: each row considers the reduction in the sum of squared residuals after adding coefficients *compared to the model in the previous row*.\n\nThe other columns in the ANOVA table show the \"degrees of freedom\" with each row. As the `type` variable introduced only one term in the model, the `Df` column has a 1. Because the `leg` variable introduced three terms in the model (`legL2`, `legL3` and `legL4`), the `Df` column has a 3.\n\nFinally, there is a column which lists the *F value*. The F value is the *mean of squares* for the inclusion of the terms of interest (the sum of squares divided by the degrees of freedom) divided by the mean squared residuals (from the bottom row):\n\n$$ r_i = Y_i - \\hat{Y}_i $$\n\n$$ \\mbox{Mean Sq Residuals} = \\frac{1}{N - p} \\sum_{i=1}^N r_i^2 $$\n\nwhere $p$ is the number of coefficients in the model (here eight, including the intercept term).\n\nUnder the null hypothesis (the true value of the additional coefficient(s) is 0), we have a theoretical result for what the distribution of the F value will be for each row. The assumptions needed for this approximation to hold are similar to those of the t-distribution approximation we described in earlier chapters. We either need a large sample size so that CLT applies or we need the population data to follow a normal approximation. \n\nAs an example of how one interprets these p-values, let's take the last row `type:leg` which specifies the three interaction coefficients. Under the null hypothesis that the true value for these three additional terms is actually 0, e.g. $\\beta_{\\textrm{push,L2}} = 0, \\beta_{\\textrm{push,L3}} = 0, \\beta_{\\textrm{push,L4}} = 0$, then we can calculate the chance of seeing such a large F-value for this row of the ANOVA table. Remember that we are only concerned with large values here, because we have a ratio of sum of squares, the F-value can only be positive. The p-value in the last column for the `type:leg` row can be interpreted as: under the null hypothesis that there are no differences in the push vs. pull difference across leg pair, this is the probability of an estimated interaction coefficient explaining so much of the observed variance. If this p-value is small, we would consider rejecting the null hypothesis that the push vs. pull difference is the same across leg pairs.\n\nThe [F distribution](http://en.wikipedia.org/wiki/F-distribution) has two parameters: one for the degrees of freedom of the numerator (the terms of interest) and one for the denominator (the residuals). In the case of the interaction coefficients row, this is 3, the number of interaction coefficients divided by 274, the number of samples minus the total number of coefficients.\n\n#### A different specification of the same model\n\nNow we show an alternate specification of the same model, wherein we assume that each combination of type and leg has its own mean value (and so that the push vs. pull effect is not the same for each leg pair). This specification is in some ways simpler, as we will see, but it does not allow us to build the ANOVA table as above, because it does not split interaction coefficients out in the same way. \n\nWe start by constructing a factor variable with a level for each unique combination of `type` and `leg`. We include a `0 +` in the formula because we do not want to include an intercept in the model matrix.\n\n```{r matrix_model_image_group_variable, fig.cap=\"Image of model matrix for linear model with group variable. This model, also with eight terms, gives a unique fitted value for each combination of type and leg.\"}\n##earlier, we defined the 'group' column:\nspider$group <- factor(paste0(spider$leg, spider$type))\nX <- model.matrix(~ 0 + group, data=spider)\ncolnames(X)\nhead(X)\nimagemat(X, main=\"Model matrix for linear model with group variable\")\n```\n\nWe can run the linear model with the familiar call:\n\n```{r}\nfitG <- lm(friction ~ 0 + group, data=spider)\nsummary(fitG)\ncoefs <- coef(fitG)\n```\n\n#### Examining the estimated coefficients\n\nNow we have eight arrows, one for each group. The arrow tips align directly with the mean of each group:\n\n```{r estimated_group_variables, fig.cap=\"Diagram of the estimated coefficients in the linear model, with each term representing the mean of a combination of type and leg.\",echo=FALSE}\nstripchart(split(spider$friction, spider$group), \n vertical=TRUE, pch=1, method=\"jitter\", las=2, xlim=c(0,11), ylim=c(0,2))\ncols <- brewer.pal(8,\"Dark2\")\nabline(h=0)\nfor (i in 1:8) {\n arrows(i+a,0,i+a,coefs[i],lwd=3,col=cols[i],length=lgth)\n}\nlegend(\"right\",names(coefs),fill=cols,cex=.75,bg=\"white\")\n```\n\n#### Simple contrasts using the contrast package\n\nWhile we cannot perform an ANOVA with this formulation, we can easily contrast the estimated coefficients for individual groups using the `contrast` function:\n\n```{r}\ngroupL2push.vs.pull <- contrast(fitG,\n list(group = \"L2push\"), \n list(group = \"L2pull\"))\ngroupL2push.vs.pull\ncoefs[4] - coefs[3]\n```\n\n#### Differences of differences when there is no intercept\n\nWe can also make pair-wise comparisons of the estimated push vs. pull difference across leg pair. For example, if we want to compare the push vs. pull difference in leg pair L3 vs. leg pair L2:\n\n$$ (\\mbox{L3push} - \\mbox{L3pull}) - (\\mbox{L2push} - \\mbox{L2pull}) $$\n\n$$ = \\mbox{L3 push} + \\mbox{L2pull} - \\mbox{L3pull} - \\mbox{L2push} $$\n\n```{r}\nC <- matrix(c(0,0,1,-1,-1,1,0,0), 1)\ngroupL3vsL2interaction <- glht(fitG, linfct=C)\nsummary(groupL3vsL2interaction)\nnames(coefs)\n(coefs[6] - coefs[5]) - (coefs[4] - coefs[3])\n```\n\n"} +{"text": "/**\n * Copyright (c) 2006-2020 LOVE Development Team\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n * claim that you wrote the original software. If you use this software\n * in a product, an acknowledgment in the product documentation would be\n * appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n * misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n **/\n\n#ifndef LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H\n#define LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H\n\n// LOVE\n#include \"common/runtime.h\"\n#include \"wrap_Joint.h\"\n#include \"PrismaticJoint.h\"\n\nnamespace love\n{\nnamespace physics\n{\nnamespace box2d\n{\n\nPrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx);\nextern \"C\" int luaopen_prismaticjoint(lua_State *L);\n\n} // box2d\n} // physics\n} // love\n\n#endif // LOVE_PHYSICS_BOX2D_WRAP_PRISMATIC_JOINT_H\n"} +{"text": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n *\n */\npackage org.mozilla.javascript.tests;\n\nimport junit.framework.TestCase;\n\nimport org.mozilla.javascript.Context;\nimport org.mozilla.javascript.ContextAction;\nimport org.mozilla.javascript.Scriptable;\n\n/**\n * Tests for global functions parseFloat and parseInt.\n * @author Marc Guillemot\n */\npublic class GlobalParseXTest extends TestCase {\n\n\t/**\n\t * Test for bug #501972\n\t * https://bugzilla.mozilla.org/show_bug.cgi?id=501972\n\t * Leading whitespaces should be ignored with following white space chars\n\t * (see ECMA spec 15.1.2.3)\n\t * , , , , , , , , , \n\t */\n public void testParseFloatAndIntWhiteSpaces() {\n \ttestParseFloatWhiteSpaces(\"\\\\u00A0 \"); // \n\n \ttestParseFloatWhiteSpaces(\"\\\\t \");\n \ttestParseFloatWhiteSpaces(\"\\\\u00A0 \"); // \n \ttestParseFloatWhiteSpaces(\"\\\\u000C \"); // \n \ttestParseFloatWhiteSpaces(\"\\\\u000B \"); // \n \ttestParseFloatWhiteSpaces(\"\\\\u000D \"); // \n \ttestParseFloatWhiteSpaces(\"\\\\u000A \"); // \n \ttestParseFloatWhiteSpaces(\"\\\\u2028 \"); // \n \ttestParseFloatWhiteSpaces(\"\\\\u2029 \"); // \n }\n\n private void testParseFloatWhiteSpaces(final String prefix) {\n assertEvaluates(\"789\", \"String(parseInt('\" + prefix + \"789 '))\");\n assertEvaluates(\"7.89\", \"String(parseFloat('\" + prefix + \"7.89 '))\");\n }\n\n\t/**\n\t * Test for bug #531436\n\t * https://bugzilla.mozilla.org/show_bug.cgi?id=531436\n\t * Trailing noise should be ignored\n\t * (see ECMA spec 15.1.2.3)\n\t */\n public void testParseFloatTrailingNoise() {\n \ttestParseFloat(\"7890\", \"789e1\");\n \ttestParseFloat(\"7890\", \"789E1\");\n \ttestParseFloat(\"7890\", \"789E+1\");\n \ttestParseFloat(\"7890\", \"789E+1e\");\n \ttestParseFloat(\"789\", \"7890E-1\");\n \ttestParseFloat(\"789\", \"7890E-1e\");\n\n \ttestParseFloat(\"789\", \"789hello\");\n \ttestParseFloat(\"789\", \"789e\");\n \ttestParseFloat(\"789\", \"789E\");\n \ttestParseFloat(\"789\", \"789e+\");\n \ttestParseFloat(\"789\", \"789Efgh\");\n \ttestParseFloat(\"789\", \"789efgh\");\n \ttestParseFloat(\"789\", \"789e-\");\n \ttestParseFloat(\"789\", \"789e-hello\");\n \ttestParseFloat(\"789\", \"789e+hello\");\n \ttestParseFloat(\"789\", \"789+++hello\");\n \ttestParseFloat(\"789\", \"789-e-+hello\");\n \ttestParseFloat(\"789\", \"789e+e++hello\");\n \ttestParseFloat(\"789\", \"789e-e++hello\");\n }\n\n private void testParseFloat(final String expected, final String value) {\n assertEvaluates(expected, \"String(parseFloat('\" + value + \"'))\");\n }\n\n private void assertEvaluates(final Object expected, final String source) {\n final ContextAction action = new ContextAction() {\n public Object run(Context cx) {\n final Scriptable scope = cx.initStandardObjects();\n final Object rep = cx.evaluateString(scope, source, \"test.js\",\n 0, null);\n assertEquals(expected, rep);\n return null;\n }\n };\n Utils.runWithAllOptimizationLevels(action);\n }\n }\n"} +{"text": "#include \n#include \n#include \n#include \n\nstatic void read_png_data(png_structp pngPtr, png_bytep data, png_size_t length)\n{\n G_FILE* file = (G_FILE*)png_get_io_ptr(pngPtr);\n g_fread(data, 1, length, file);\n}\n\nstatic void write_png_data(png_structp pngPtr, png_bytep data, png_size_t length)\n{\n G_FILE* file = (G_FILE*)png_get_io_ptr(pngPtr);\n g_fwrite(data, 1, length, file);\n}\n\nstatic void flush_png_data(png_structp pngPtr)\n{\n G_FILE* file = (G_FILE*)png_get_io_ptr(pngPtr);\n g_fflush(file);\n}\n\nextern \"C\" {\n\nint gimage_parsePng(const char *pathname, int *width, int *height, int *comp)\n{\n G_FILE* fp = g_fopen(pathname, \"rb\");\n\n if (!fp)\n return GIMAGE_CANNOT_OPEN_FILE;\n\n #define HEADERSIZE 8\n unsigned char header[HEADERSIZE];\n if (g_fread(header, 1, HEADERSIZE, fp) != HEADERSIZE)\n {\n g_fclose(fp);\n return GIMAGE_UNRECOGNIZED_FORMAT;\n }\n\n if (png_sig_cmp(header, 0, HEADERSIZE) != 0)\n {\n g_fclose(fp);\n return GIMAGE_UNRECOGNIZED_FORMAT;\n }\n\n png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);\n\n png_infop info_ptr = png_create_info_struct(png_ptr);\n\n if (setjmp(png_jmpbuf(png_ptr)))\n {\n png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n g_fclose(fp);\n return GIMAGE_ERROR_WHILE_READING;\n }\n\n png_set_read_fn(png_ptr, fp, read_png_data);\n\n png_set_sig_bytes(png_ptr, HEADERSIZE);\n png_read_info(png_ptr, info_ptr);\n\n // Strip 16 bit/color files down to 8 bits/color\n png_set_strip_16(png_ptr);\n\n // Pack 1, 2, 4 bit into bytes\n png_set_packing(png_ptr);\n\n // Auto-convert 1-, 2-, and 4- bit images to 8 bits, palette to RGB,\n // and transparency to alpha\n png_set_expand(png_ptr);\n\n // Update the information struct appropriately\n png_read_update_info(png_ptr, info_ptr);\n\n if (width)\n *width = png_get_image_width(png_ptr, info_ptr);\n\n if (height)\n *height = png_get_image_height(png_ptr, info_ptr);\n\n if (comp)\n *comp = png_get_channels(png_ptr, info_ptr);\n\n png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n g_fclose(fp);\n\n return GIMAGE_NO_ERROR;\n}\n\nint gimage_loadPng(const char *pathname, void *buf)\n{\n G_FILE* fp = g_fopen(pathname, \"rb\");\n\n if (!fp)\n return GIMAGE_CANNOT_OPEN_FILE;\n\n #define HEADERSIZE 8\n unsigned char header[HEADERSIZE];\n if (g_fread(header, 1, HEADERSIZE, fp) != HEADERSIZE)\n {\n g_fclose(fp);\n return GIMAGE_UNRECOGNIZED_FORMAT;\n }\n\n if (png_sig_cmp(header, 0, HEADERSIZE) != 0)\n {\n g_fclose(fp);\n return GIMAGE_UNRECOGNIZED_FORMAT;\n }\n\n png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);\n\n png_infop info_ptr = png_create_info_struct(png_ptr);\n\n if (setjmp(png_jmpbuf(png_ptr)))\n {\n png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n g_fclose(fp);\n return GIMAGE_ERROR_WHILE_READING;\n }\n\n png_set_read_fn(png_ptr, fp, read_png_data);\n\n png_set_sig_bytes(png_ptr, HEADERSIZE);\n png_read_info(png_ptr, info_ptr);\n\n // Strip 16 bit/color files down to 8 bits/color\n png_set_strip_16(png_ptr);\n\n // Pack 1, 2, 4 bit into bytes\n png_set_packing(png_ptr);\n\n // Auto-convert 1-, 2-, and 4- bit images to 8 bits, palette to RGB,\n // and transparency to alpha\n png_set_expand(png_ptr);\n\n // Update the information struct appropriately\n png_read_update_info(png_ptr, info_ptr);\n\n png_uint_32 width = png_get_image_width(png_ptr, info_ptr);\n png_uint_32 height = png_get_image_height(png_ptr, info_ptr);\n png_byte channels = png_get_channels(png_ptr, info_ptr);\n\n std::vector row_pointers(height);\n\n for (png_uint_32 i = 0; i < height; ++i)\n row_pointers[i] = (unsigned char*)buf + (i * width * channels);\n\n png_read_image(png_ptr, &row_pointers[0]);\n\n // If one has no need for the post-IDAT chunk data, the second argument can be NULL\n png_read_end(png_ptr, NULL);\n\n png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n g_fclose(fp);\n\n return GIMAGE_NO_ERROR;\n}\n\nint gimage_savePng(const char *filename, int width, int height, unsigned char *data)\n{\n png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);\n if (!png)\n return GIMAGE_ERROR_WHILE_WRITING;\n\n png_infop info = png_create_info_struct(png);\n if (!info) {\n png_destroy_write_struct(&png, &info);\n return GIMAGE_ERROR_WHILE_WRITING;\n }\n\n G_FILE* fp = g_fopen(filename, \"wb\");\n\n if (!fp) {\n png_destroy_write_struct(&png, &info);\n return GIMAGE_CANNOT_OPEN_FILE;\n }\n\n png_set_write_fn(png, fp, write_png_data, flush_png_data);\n png_set_IHDR(png, info, width, height, 8 /* depth */, PNG_COLOR_TYPE_RGBA, PNG_INTERLACE_NONE,\n PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);\n png_colorp palette = (png_colorp)png_malloc(png, PNG_MAX_PALETTE_LENGTH * sizeof(png_color));\n if (!palette) {\n g_fclose(fp);\n png_destroy_write_struct(&png, &info);\n return false;\n }\n png_set_PLTE(png, info, palette, PNG_MAX_PALETTE_LENGTH);\n png_write_info(png, info);\n png_set_packing(png);\n\n png_bytepp rows = (png_bytepp)png_malloc(png, height * sizeof(png_bytep));\n for (int i = 0; i < height; ++i)\n rows[i] = (png_bytep)(data + i * width * 4);\n\n png_write_image(png, rows);\n png_write_end(png, info);\n png_free(png, palette);\n png_destroy_write_struct(&png, &info);\n\n g_fclose(fp);\n png_free(png,rows);\n return GIMAGE_NO_ERROR;\n}\n\n}\n"} +{"text": "/*\n * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\npackage java.lang.invoke;\n\nimport jdk.internal.vm.annotation.ForceInline;\n\n// This class is auto-generated by java.lang.invoke.VarHandles$GuardMethodGenerator. Do not edit.\nfinal class VarHandleGuards {\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard_L_L(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LL_V(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard_LL_L(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LLL_Z(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard_LLL_L(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_L_I(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LI_V(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_LI_I(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LII_Z(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_LII_I(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_L_J(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LJ_V(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_LJ_J(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_LJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_L_F(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LF_V(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_LF_F(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LFF_Z(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_LFF_F(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_L_D(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LD_V(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_LD_D(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LDD_Z(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_LDD_D(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard__L(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_L_V(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LL_Z(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard__I(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_I_V(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_I_I(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_II_Z(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_II_I(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard__J(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_J_V(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_J_J(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_JJ_Z(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_JJ_J(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard__F(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_F_V(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_F_F(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_FF_Z(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_FF_F(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard__D(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_D_V(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_D_D(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_DD_Z(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_DD_D(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard_LI_L(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LIL_V(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard_LIL_L(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LILL_Z(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static Object guard_LILL_L(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n return ad.returnType.cast(r);\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LII_V(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LIII_Z(VarHandle handle, Object arg0, int arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_LIII_I(VarHandle handle, Object arg0, int arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_LI_J(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LIJ_V(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_LIJ_J(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LIJJ_Z(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_LIJJ_J(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_LI_F(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LIF_V(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_LIF_F(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LIFF_Z(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static float guard_LIFF_F(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_LI_D(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LID_V(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_LID_D(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LIDD_Z(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static double guard_LIDD_D(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_LJ_I(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LJI_V(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_LJI_I(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LJII_Z(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static int guard_LJII_I(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static void guard_LJJ_V(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else if (handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {\n MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static boolean guard_LJJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n @ForceInline\n @LambdaForm.Compiled\n final static long guard_LJJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {\n if (handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {\n return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));\n }\n else {\n MethodHandle mh = handle.getMethodHandle(ad.mode);\n return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle, arg0, arg1, arg2, arg3);\n }\n }\n\n}\n"} +{"text": "/*\n * Copyright (C) 2014 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.wearable.geofencing;\n\nimport com.google.android.gms.common.ConnectionResult;\nimport com.google.android.gms.common.api.GoogleApiClient;\nimport com.google.android.gms.wearable.DataApi;\nimport com.google.android.gms.wearable.Wearable;\n\nimport android.app.IntentService;\nimport android.app.NotificationManager;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport android.support.wearable.activity.ConfirmationActivity;\nimport android.util.Log;\n\nimport java.util.concurrent.TimeUnit;\n\nimport static com.example.android.wearable.geofencing.Constants.ACTION_CHECK_IN;\nimport static com.example.android.wearable.geofencing.Constants.ACTION_DELETE_DATA_ITEM;\nimport static com.example.android.wearable.geofencing.Constants.CONNECTION_TIME_OUT_MS;\nimport static com.example.android.wearable.geofencing.Constants.NOTIFICATION_ID;\nimport static com.example.android.wearable.geofencing.Constants.TAG;\n\n/**\n * Handles \"Check In\" action on the location-based notification. Also deletes orphan DataItems\n * when a notification is dismissed from the wearable.\n */\npublic class CheckInAndDeleteDataItemsService extends IntentService\n implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {\n\n private GoogleApiClient mGoogleApiClient;\n\n public CheckInAndDeleteDataItemsService() {\n super(CheckInAndDeleteDataItemsService.class.getSimpleName());\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addApi(Wearable.API)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .build();\n }\n\n @Override\n protected void onHandleIntent(Intent intent) {\n if (ACTION_CHECK_IN.equals(intent.getAction())) {\n // In a real app, code for checking in would go here. For this sample, we will simply\n // display a success animation.\n startConfirmationActivity(ConfirmationActivity.SUCCESS_ANIMATION,\n getString(R.string.check_in_success));\n // Dismiss the check-in notification.\n ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancel(NOTIFICATION_ID);\n } else if (!ACTION_DELETE_DATA_ITEM.equals(intent.getAction())) {\n // The only possible actions should be checking in or dismissing the notification\n // (which causes an intent with ACTION_DELETE_DATA_ITEM).\n Log.e(TAG, \"Unrecognized action: \" + intent.getAction());\n return;\n }\n // Regardless of the action, delete the DataItem (we are only be handling intents\n // if the notification is dismissed or if the user has chosen to check in, either of which\n // would be completed at this point).\n mGoogleApiClient.blockingConnect(CONNECTION_TIME_OUT_MS, TimeUnit.MILLISECONDS);\n Uri dataItemUri = intent.getData();\n if (mGoogleApiClient.isConnected()) {\n DataApi.DeleteDataItemsResult result = Wearable.DataApi\n .deleteDataItems(mGoogleApiClient, dataItemUri).await();\n if (!result.getStatus().isSuccess()) {\n Log.e(TAG, \"CheckInAndDeleteDataItemsService.onHandleIntent: \"\n + \"Failed to delete dataItem: \" + dataItemUri);\n } else if (Log.isLoggable(TAG, Log.DEBUG)) {\n Log.d(TAG, \"Successfully deleted data item: \" + dataItemUri);\n }\n } else {\n Log.e(TAG, \"Failed to delete data item: \" + dataItemUri\n + \" - Client disconnected from Google Play Services\");\n }\n mGoogleApiClient.disconnect();\n }\n\n /**\n * Helper method to create confirmation animations on the wearable.\n * @param animationType Defined by constants in ConfirmationActivity.\n * @param message The message to display with the animation.\n */\n private void startConfirmationActivity(int animationType, String message) {\n Intent confirmationActivity = new Intent(this, ConfirmationActivity.class)\n .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION)\n .putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, animationType)\n .putExtra(ConfirmationActivity.EXTRA_MESSAGE, message);\n startActivity(confirmationActivity);\n }\n\n @Override\n public void onConnected(Bundle connectionHint) {\n }\n\n @Override\n public void onConnectionSuspended(int cause) {\n }\n\n @Override\n public void onConnectionFailed(ConnectionResult result) {\n }\n\n}\n"} +{"text": " {\n [key: string]: IconProvider;\n}\n\nexport interface IconPack {\n name: string;\n icons: Icons;\n}\n\nexport interface IconProvider {\n toReactElement(props?: T): React.ReactElement;\n}\n"} +{"text": "//! \\file ImageRBP.cs\n//! \\date 2017 Dec 11\n//! \\brief DiceSystem image format.\n//\n// Copyright (C) 2017 by morkt\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n//\n\nusing System.ComponentModel.Composition;\nusing System.IO;\nusing System.Windows.Media;\n\n// [000623][Marimo] Setsunai\n\nnamespace GameRes.Formats.Dice\n{\n internal class RbpMetaData : ImageMetaData\n {\n public int DataOffset;\n }\n\n [Export(typeof(ImageFormat))]\n public class RbpFormat : ImageFormat\n {\n public override string Tag { get { return \"RBP\"; } }\n public override string Description { get { return \"DiceSystem image format\"; } }\n public override uint Signature { get { return 0x31504252; } } // 'RBP1'\n\n public override ImageMetaData ReadMetaData (IBinaryStream file)\n {\n var header = file.ReadHeader (0x14);\n return new RbpMetaData {\n BPP = header.ToInt32 (4) == 1 ? 24 : 32,\n Width = header.ToUInt32 (8),\n Height = header.ToUInt32 (0xC),\n DataOffset = header.ToInt32 (0x10),\n };\n }\n\n public override ImageData Read (IBinaryStream file, ImageMetaData info)\n {\n var meta = (RbpMetaData)info;\n file.Position = meta.DataOffset;\n int stride = 4 * (int)meta.Width;\n var pixels = new byte[stride * (int)meta.Height];\n if (24 == meta.BPP)\n {\n for (int i = 0; i < pixels.Length; i += 4)\n {\n int pixel = file.ReadInt24();\n pixels[i ] = (byte) (pixel << 3);\n pixels[i+1] = (byte)((pixel >> 3) & 0xFC);\n pixels[i+2] = (byte)((pixel >> 8) & 0xF8);\n pixels[i+3] = (byte)((pixel >> 16) * 0xFF / 0x3F);\n }\n }\n else\n {\n file.Read (pixels, 0, pixels.Length);\n for (int i = 3; i < pixels.Length; i += 4)\n {\n byte alpha = pixels[i];\n if (alpha != 0)\n pixels[i] = (byte)(alpha * 0xFF / 0x3F);\n }\n }\n return ImageData.Create (info, PixelFormats.Bgra32, null, pixels, stride);\n }\n\n public override void Write (Stream file, ImageData image)\n {\n throw new System.NotImplementedException (\"RbpFormat.Write not implemented\");\n }\n }\n}\n"} +{"text": "/dts-v1/;\n\n#include \"bcm63268.dtsi\"\n\n#include \n\n/ {\n\tmodel = \"Broadcom BCM963268BU_P300 reference board\";\n\tcompatible = \"brcm,bcm963268bu_p300\", \"brcm,bcm63268\";\n\n\tchosen {\n\t\tbootargs = \"rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200\";\n\t\tstdout-path = \"serial0:115200n8\";\n\t};\n\n\tgpio-keys-polled {\n\t\tcompatible = \"gpio-keys-polled\";\n\t\t#address-cells = <1>;\n\t\t#size-cells = <0>;\n\t\tpoll-interval = <20>;\n\t\tdebounce-interval = <60>;\n\n\t\treset {\n\t\t\tlabel = \"reset\";\n\t\t\tgpios = <&pinctrl 32 0>;\n\t\t\tlinux,code = ;\n\t\t};\n\n\t\twps {\n\t\t\tlabel = \"wps\";\n\t\t\tgpios = <&pinctrl 33 0>;\n\t\t\tlinux,code = ;\n\t\t};\n };\n};\n\n&hsspi {\n\tstatus = \"ok\";\n\n\tflash@0 {\n\t\tcompatible = \"jedec,spi-nor\";\n\t\tspi-max-frequency = <20000000>;\n\t\tspi-tx-bus-width = <2>;\n\t\tspi-rx-bus-width = <2>;\n\t\treg = <0>;\n\n\t\t#address-cells = <1>;\n\t\t#size-cells = <1>;\n\n\t\tlinux,part-probe = \"bcm63xxpart\";\n\n\t\tpartitions {\n\t\t\tcompatible = \"brcm,bcm963xx-cfe-nor-partitions\";\n\t\t};\n\t};\n};\n\n&uart0 {\n\tstatus = \"ok\";\n};\n"} +{"text": "@import \"twbs-222/bootstrap.less\";\n\n@import \"mixins.less\";\n@import \"variables.less\";\n@import \"font-site.less\";\n\n.text-align-right { text-align: right; }\n.text-align-center { text-align: center; }\n\n.navbar .brand {\n// padding: 11px 20px 9px;\n color: @white;\n font-family: @serifFontFamily;\n .icon-flag { padding-right: 3px; }\n}\n\n.navbar .nav > li > a { padding: 12px 10px 9px; }\n\nh1, h2, h3, h4, h5, h6 { font-family: @serifFontFamily; }\n\n#iconCarousel {\n a { color: @white; }\n// border: solid 1px @white;\n @size: 280px;\n font-size: @size;\n text-align: center;\n line-height: @size + 5;\n text-shadow: 2px 2px 3px @grayDarker;\n .carousel-control {\n top: @size + 33px;\n .square(23px);\n border-width: 3px;\n font-size: 17px;\n line-height: 25px;\n left: @size / 2 - 23;\n &.right {\n left: auto;\n right: @size / 2 - 23;\n }\n }\n}\n\n//a[href^='http://'] {\n// &:after {\n// font-family: FontAwesome;\n// content: \"\\0020 \\f08e\";\n// &:hover {\n// text-decoration: none;\n// }\n// }\n//}\n\n.jumbotron {\n background: @red;\n border-bottom: 1px solid @redDark;\n padding: 90px 0 48px;\n// #gradient > .radial( lighten(@red, 10%), @red);\n// background-color: @red;\n &, h1 { color: @white; }\n\n// &:after {\n// content:'';\n// display:block;\n// position:absolute;\n// top:0;\n// right:0;\n// bottom:0;\n// left:0;\n// background:url(../img/grain-tm400.png);\n// opacity:.5;\n// }\n\n h1 {\n font-size: 80px;\n letter-spacing: -2px;\n line-height: 1;\n }\n p {\n margin-top: 15px;\n margin-bottom: 30px;\n font-size: 30px;\n line-height: 1.3;\n }\n text-shadow: 2px 2px 2px @grayDark;\n ul {\n margin-left: 50px;\n li {\n &.icon-large:before {\n text-indent: -2em;\n vertical-align: baseline;\n }\n font-size: 15px;\n line-height: 30px;\n text-shadow: 1px 1px 1px @grayDark;\n }\n }\n// a { color: #fffeb8; }\n .btn-large {\n//// .buttonBackground(@white, #bbb);\n font-family: @serifFontFamily;\n//// color: @grayDark;\n// margin-top: 15px;\n font-weight: bold;\n font-size: 18px;\n padding: 13px 23px 13px 22px;\n// padding-left: 24px + 40;\n margin-right: 10px;\n// .border-radius(8px);\n// position: relative;\n text-align: left;\n// i {\n// position: absolute;\n// top: 8px;\n// left: 15px;\n// font-size: 46px;\n// }\n }\n .hero-content {\n// width: 620px;\n text-align: center;\n }\n .shameless-self-promotion {\n font-size: 12px;\n margin-top: 15px;\n color: mix(@white, @red, 50%);\n text-shadow: none;\n }\n}\n\n.btn-github {\n .buttonBackground(@white, mix(@grayLighter, @grayLight, 50%));\n}\n\n.btn-primary, .btn-github {\n color: @grayDark;\n text-shadow: 0 -1px 0 rgba(255,255,255,.25);\n &:hover {\n text-shadow: 0 -1px 0 rgba(255,255,255,.25);\n color: @grayDark;\n }\n}\n\nsection {\n padding-top: 40px;\n}\n\n#social-buttons {\n padding: 22px 0;\n text-align: center;\n background-color: #f5f5f5;\n border-top: 1px solid #fff;\n border-bottom: 1px solid #ddd;\n .btn {\n// font-family: @serifFontFamily;\n font-weight: bold;\n// font-size: @baseFontSize;\n padding: 0px 5px;\n line-height: @baseLineHeight - 3;\n }\n .count.btn {\n background: @white;\n font-weight: normal;\n }\n .watch, .fork {\n margin-right: 30px;\n }\n}\n\n.the-icons {\n list-style-type: none;\n margin: 0;\n li {\n cursor: pointer;\n line-height: 32px;\n height: 32px;\n padding-left: 12px;\n .border-radius(6px);\n// vertical-align: middle;\n\n [class^=\"icon-\"],\n [class*=\" icon-\"] {\n width: 32px;\n font-size: 14px;\n }\n &:hover {\n background-color: lighten(@errorBackground, 6%);\n [class^=\"icon-\"], [class*=\" icon-\"] {\n *font-size: 28px;\n *vertical-align: middle;\n }\n\n [class^=\"icon-\"]:before,\n [class*=\" icon-\"]:before {\n font-size: 28px;\n vertical-align: -5px;\n }\n }\n }\n}\n\n\n#why, #whats-new {\n .row {\n margin-bottom: 20px;\n }\n h4 {\n// line-height: 28px;\n [class^=\"icon-\"],\n [class*=\" icon-\"] {\n vertical-align: -10%;\n font-size: 28px;\n// width: 30px;\n// height: 30px;\n margin-right: 5px;\n }\n }\n}\n\n#examples {\n .btn-toolbar {\n margin-top: 0;\n margin-bottom: 20px;\n }\n}\n\n#integration {\n .row { margin-bottom: 40px; }\n}\n\n#examples, #code {\n form {\n margin-bottom: 25px;\n input {\n line-height: 1; // fixes a safari placeholder alignment issue\n }\n }\n\n .rating {\n unicode-bidi: bidi-override;\n direction: rtl;\n\n font-size: 30px;\n span.star {\n font-family: FontAwesome;\n font-weight: normal;\n font-style: normal;\n display: inline-block;\n &:hover {\n cursor: pointer;\n }\n }\n span.star:before {\n content: \"\\f006\"; // empty star\n padding-right: 5px;\n color: @grayLight;\n }\n\n span.star:hover:before, span.star:hover ~ span.star:before {\n content: \"\\f005\"; // solid star\n color: #e3cf7a;\n }\n }\n}\n\n#kyruus {\n color: @gray;\n font-size: 18px;\n &, li { line-height: 25px; }\n p {\n margin-bottom: 22px;\n strong { color: @grayDarker; }\n }\n ul {\n margin-top: 5px;\n margin-bottom: 22px;\n li { margin-top: 10px; }\n i {\n margin-top: 5px;\n// margin-right: .4em;\n// color: mix(@grayLight, @grayLighter, 50%);\n color: mix(@blue, @blueDark, 50%);\n }\n }\n .border {\n .icon-medkit { font-size: 224px; }\n border: solid 10px @grayLighter;\n padding: 1em 1.5em;\n margin-left: .2em;\n .border-radius(10px);\n a:hover .icon-medkit { text-decoration: none; }\n// a:hover i { text-decoration: underline; }\n }\n a {\n font-weight: bold;\n color: mix(@blue, @blueDark, 50%);\n &:hover {\n color: @blueDark;\n }\n }\n}\n\n.modal {\n width: 560px;\n max-height: 610px;\n .modal-body {\n *overflow: hidden; // ie7 fix\n max-height: none;\n padding-bottom: 0;\n .row { margin-bottom: 15px; }\n div.thumbnail {\n text-align: center;\n div { margin: 8px; }\n }\n .icon6 {\n width: 330px;\n > div.thumbnail > div { .icon-size(280px); }\n }\n .icon5 {\n width: 180px;\n > div.thumbnail > div { .icon-size(140px); }\n }\n .icon4 {\n width: 215px;\n > div.thumbnail > div { .icon-size(112px); }\n }\n .icon3 {\n width: 120px;\n > div.thumbnail > div { .icon-size(56px); }\n }\n .icon2 {\n width: 75px;\n > div.thumbnail > div { .icon-size(28px); }\n }\n .icon1 {\n width: 60px;\n > div.thumbnail > div { .icon-size(14px); }\n }\n }\n}\n\n.label,\n.badge {\n background-color: @grayLighter;\n}\n\n.well.well-transparent {\n background-color: transparent;\n}\n\nfooter {\n// #gradient > .vertical(@navbarInverseBackgroundHighlight, @navbarInverseBackground);\n background-color: @red;\n border-top: 1px solid mix(@red, @redDark, 50%);\n a {\n color: @white;\n text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n &:hover {\n color: @white;\n }\n\n }\n\n color: mix(@red, @white, 35%);\n text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n margin-top: 60px;\n padding-top: 45px;\n padding-bottom: 60px;\n *zoom: 1; // ie7 hack\n ul {\n// margin-left: 30px;\n line-height: 25px;\n }\n}\n"} +{"text": "/*\n * Copyright 2015 Linaro Ltd.\n * Copyright (C) 2014 ZTE Corporation.\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License version 2 as\n * published by the Free Software Foundation.\n */\n\n#ifndef __ZTE_CLK_H\n#define __ZTE_CLK_H\n#include \n#include \n\n#define PNAME(x) static const char *x[]\n\n#define CLK_HW_INIT(_name, _parent, _ops, _flags)\t\t\t\\\n\t&(struct clk_init_data) {\t\t\t\t\t\\\n\t\t.flags\t\t= _flags,\t\t\t\t\\\n\t\t.name\t\t= _name,\t\t\t\t\\\n\t\t.parent_names\t= (const char *[]) { _parent },\t\t\\\n\t\t.num_parents\t= 1,\t\t\t\t\t\\\n\t\t.ops\t\t= _ops,\t\t\t\t\t\\\n\t}\n\n#define CLK_HW_INIT_PARENTS(_name, _parents, _ops, _flags)\t\t\\\n\t&(struct clk_init_data) {\t\t\t\t\t\\\n\t\t.flags\t\t= _flags,\t\t\t\t\\\n\t\t.name\t\t= _name,\t\t\t\t\\\n\t\t.parent_names\t= _parents,\t\t\t\t\\\n\t\t.num_parents\t= ARRAY_SIZE(_parents),\t\t\t\\\n\t\t.ops\t\t= _ops,\t\t\t\t\t\\\n\t}\n\nstruct zx_pll_config {\n\tunsigned long rate;\n\tu32 cfg0;\n\tu32 cfg1;\n};\n\nstruct clk_zx_pll {\n\tstruct clk_hw hw;\n\tvoid __iomem *reg_base;\n\tconst struct zx_pll_config *lookup_table; /* order by rate asc */\n\tint count;\n\tspinlock_t *lock;\n\tu8 pd_bit;\t\t/* power down bit */\n\tu8 lock_bit;\t\t/* pll lock flag bit */\n};\n\n#define PLL_RATE(_rate, _cfg0, _cfg1)\t\\\n{\t\t\t\t\t\\\n\t.rate = _rate,\t\t\t\\\n\t.cfg0 = _cfg0,\t\t\t\\\n\t.cfg1 = _cfg1,\t\t\t\\\n}\n\n#define ZX_PLL(_name, _parent, _reg, _table, _pd, _lock)\t\t\\\n{\t\t\t\t\t\t\t\t\t\\\n\t.reg_base\t= (void __iomem *) _reg,\t\t\t\\\n\t.lookup_table\t= _table,\t\t\t\t\t\\\n\t.count\t\t= ARRAY_SIZE(_table),\t\t\t\t\\\n\t.pd_bit\t\t= _pd,\t\t\t\t\t\t\\\n\t.lock_bit\t= _lock,\t\t\t\t\t\\\n\t.hw.init\t = CLK_HW_INIT(_name, _parent, &zx_pll_ops,\t\\\n\t\t\t\tCLK_GET_RATE_NOCACHE),\t\t\t\\\n}\n\n/*\n * The pd_bit is not available on ZX296718, so let's pass something\n * bigger than 31, e.g. 0xff, to indicate that.\n */\n#define ZX296718_PLL(_name, _parent, _reg, _table)\t\t\t\\\nZX_PLL(_name, _parent, _reg, _table, 0xff, 30)\n\nstruct zx_clk_gate {\n\tstruct clk_gate gate;\n\tu16\t\tid;\n};\n\n#define GATE(_id, _name, _parent, _reg, _bit, _flag, _gflags)\t\t\\\n{\t\t\t\t\t\t\t\t\t\\\n\t.gate = {\t\t\t\t\t\t\t\\\n\t\t.reg = (void __iomem *) _reg,\t\t\t\t\\\n\t\t.bit_idx = (_bit),\t\t\t\t\t\\\n\t\t.flags = _gflags,\t\t\t\t\t\\\n\t\t.lock = &clk_lock,\t\t\t\t\t\\\n\t\t.hw.init = CLK_HW_INIT(_name,\t\t\t\t\\\n\t\t\t\t\t_parent,\t\t\t\\\n\t\t\t\t\t&clk_gate_ops,\t\t\t\\\n\t\t\t\t\t_flag | CLK_IGNORE_UNUSED),\t\\\n\t},\t\t\t\t\t\t\t\t\\\n\t.id\t= _id,\t\t\t\t\t\t\t\\\n}\n\nstruct zx_clk_fixed_factor {\n\tstruct clk_fixed_factor factor;\n\tu16\tid;\n};\n\n#define FFACTOR(_id, _name, _parent, _mult, _div, _flag)\t\t\\\n{\t\t\t\t\t\t\t\t\t\\\n\t.factor = {\t\t\t\t\t\t\t\\\n\t\t.div\t\t= _div,\t\t\t\t\t\\\n\t\t.mult\t\t= _mult,\t\t\t\t\\\n\t\t.hw.init\t= CLK_HW_INIT(_name,\t\t\t\\\n\t\t\t\t\t _parent,\t\t\t\\\n\t\t\t\t\t &clk_fixed_factor_ops,\t\\\n\t\t\t\t\t _flag),\t\t\t\\\n\t},\t\t\t\t\t\t\t\t\\\n\t.id = _id,\t\t\t\t\t\t\t\\\n}\n\nstruct zx_clk_mux {\n\tstruct clk_mux mux;\n\tu16\tid;\n};\n\n#define MUX_F(_id, _name, _parent, _reg, _shift, _width, _flag, _mflag)\t\\\n{\t\t\t\t\t\t\t\t\t\\\n\t.mux = {\t\t\t\t\t\t\t\\\n\t\t.reg\t\t= (void __iomem *) _reg,\t\t\\\n\t\t.mask\t\t= BIT(_width) - 1,\t\t\t\\\n\t\t.shift\t\t= _shift,\t\t\t\t\\\n\t\t.flags\t\t= _mflag,\t\t\t\t\\\n\t\t.lock\t\t= &clk_lock,\t\t\t\t\\\n\t\t.hw.init\t= CLK_HW_INIT_PARENTS(_name,\t\t\\\n\t\t\t\t\t\t _parent,\t\t\\\n\t\t\t\t\t\t &clk_mux_ops,\t\\\n\t\t\t\t\t\t _flag),\t\t\\\n\t},\t\t\t\t\t\t\t\t\\\n\t.id = _id,\t\t\t\t\t\t\t\\\n}\n\n#define MUX(_id, _name, _parent, _reg, _shift, _width)\t\t\t\\\nMUX_F(_id, _name, _parent, _reg, _shift, _width, 0, 0)\n\nstruct zx_clk_div {\n\tstruct clk_divider div;\n\tu16\tid;\n};\n\n#define DIV_T(_id, _name, _parent, _reg, _shift, _width, _flag, _table)\t\\\n{\t\t\t\t\t\t\t\t\t\\\n\t.div = {\t\t\t\t\t\t\t\\\n\t\t.reg\t\t= (void __iomem *) _reg,\t\t\\\n\t\t.shift\t\t= _shift,\t\t\t\t\\\n\t\t.width\t\t= _width,\t\t\t\t\\\n\t\t.flags\t\t= 0,\t\t\t\t\t\\\n\t\t.table\t\t= _table,\t\t\t\t\\\n\t\t.lock\t\t= &clk_lock,\t\t\t\t\\\n\t\t.hw.init\t= CLK_HW_INIT(_name,\t\t\t\\\n\t\t\t\t\t _parent,\t\t\t\\\n\t\t\t\t\t &clk_divider_ops,\t\t\\\n\t\t\t\t\t _flag),\t\t\t\\\n\t},\t\t\t\t\t\t\t\t\\\n\t.id = _id,\t\t\t\t\t\t\t\\\n}\n\nstruct clk_zx_audio_divider {\n\tstruct clk_hw\t\t\t\thw;\n\tvoid __iomem\t\t\t\t*reg_base;\n\tunsigned int\t\t\t\trate_count;\n\tspinlock_t\t\t\t\t*lock;\n\tu16\t\t\t\t\tid;\n};\n\n#define AUDIO_DIV(_id, _name, _parent, _reg)\t\t\t\t\\\n{\t\t\t\t\t\t\t\t\t\\\n\t.reg_base\t= (void __iomem *) _reg,\t\t\t\\\n\t.lock\t\t= &clk_lock,\t\t\t\t\t\\\n\t.hw.init\t= CLK_HW_INIT(_name,\t\t\t\t\\\n\t\t\t\t _parent,\t\t\t\t\\\n\t\t\t\t &zx_audio_div_ops,\t\t\\\n\t\t\t\t 0),\t\t\t\t\\\n\t.id = _id,\t\t\t\t\t\t\t\\\n}\n\nstruct clk *clk_register_zx_pll(const char *name, const char *parent_name,\n\tunsigned long flags, void __iomem *reg_base,\n\tconst struct zx_pll_config *lookup_table, int count, spinlock_t *lock);\n\nstruct clk_zx_audio {\n\tstruct clk_hw hw;\n\tvoid __iomem *reg_base;\n};\n\nstruct clk *clk_register_zx_audio(const char *name,\n\t\t\t\t const char * const parent_name,\n\t\t\t\t unsigned long flags, void __iomem *reg_base);\n\nextern const struct clk_ops zx_pll_ops;\nextern const struct clk_ops zx_audio_div_ops;\n\n#endif\n"} +{"text": "fragment NameRendererFragment on User {\n id\n nameRendererForContext(context: HEADER) @match {\n ...PlainUserNameRenderer_name @module(name: \"PlainUserNameRenderer.react\")\n ...MarkdownUserNameRenderer_name\n @module(name: \"MarkdownUserNameRenderer.react\")\n }\n}\n\nfragment PlainUserNameRenderer_name on PlainUserNameRenderer {\n plaintext\n data {\n text\n }\n}\n\nfragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {\n markdown\n data {\n markup\n }\n}\n"} +{"text": "/*\nCopyright 2017 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// This file was automatically generated by lister-gen\n\npackage v1alpha1\n\n// PriorityClassListerExpansion allows custom methods to be added to\n// PriorityClassLister.\ntype PriorityClassListerExpansion interface{}\n"} +{"text": "DlangTokenType.ID ('write')\nDlangTokenType.( ('(')\nDlangTokenType.DOUBLE_QUOTED_STRING ('\"1\"')\nDlangTokenType.) (')')\nDlangTokenType.; (';')\nWHITE_SPACE ('\\n')\nDlangTokenType.{ ('{')\nWHITE_SPACE ('\\n')\nWHITE_SPACE (' ')\nDlangTokenType.ID ('write')\nDlangTokenType.( ('(')\nDlangTokenType.DOUBLE_QUOTED_STRING ('\"2\"')\nDlangTokenType.) (')')\nDlangTokenType.; (';')\nWHITE_SPACE ('\\n')\nWHITE_SPACE (' ')\nDlangTokenType.scope ('scope')\nDlangTokenType.( ('(')\nDlangTokenType.ID ('exit')\nDlangTokenType.) (')')\nWHITE_SPACE (' ')\nDlangTokenType.ID ('write')\nDlangTokenType.( ('(')\nDlangTokenType.DOUBLE_QUOTED_STRING ('\"3\"')\nDlangTokenType.) (')')\nDlangTokenType.; (';')\nWHITE_SPACE ('\\n')\nWHITE_SPACE (' ')\nDlangTokenType.scope ('scope')\nDlangTokenType.( ('(')\nDlangTokenType.ID ('exit')\nDlangTokenType.) (')')\nWHITE_SPACE (' ')\nDlangTokenType.ID ('write')\nDlangTokenType.( ('(')\nDlangTokenType.DOUBLE_QUOTED_STRING ('\"4\"')\nDlangTokenType.) (')')\nDlangTokenType.; (';')\nWHITE_SPACE ('\\n')\nWHITE_SPACE (' ')\nDlangTokenType.ID ('write')\nDlangTokenType.( ('(')\nDlangTokenType.DOUBLE_QUOTED_STRING ('\"5\"')\nDlangTokenType.) (')')\nDlangTokenType.; (';')\nWHITE_SPACE ('\\n')\nDlangTokenType.} ('}')\nWHITE_SPACE ('\\n')\nDlangTokenType.ID ('writeln')\nDlangTokenType.( ('(')\nDlangTokenType.) (')')\nDlangTokenType.; (';')\n"} +{"text": "query FeedRepositoryQuery($type: FeedType!, $limit: Int!) {\n feed(type: $type, limit: $limit) {\n repository {\n name\n }\n }\n}\n"} +{"text": "require('../modules/core.dict');\nrequire('../modules/core.get-iterator-method');\nrequire('../modules/core.get-iterator');\nrequire('../modules/core.is-iterable');\nrequire('../modules/core.delay');\nrequire('../modules/core.function.part');\nrequire('../modules/core.object.is-object');\nrequire('../modules/core.object.classof');\nrequire('../modules/core.object.define');\nrequire('../modules/core.object.make');\nrequire('../modules/core.number.iterator');\nrequire('../modules/core.regexp.escape');\nrequire('../modules/core.string.escape-html');\nrequire('../modules/core.string.unescape-html');\nmodule.exports = require('../modules/_core');\n"} +{"text": "select @@global.performance_schema_max_file_classes;\n@@global.performance_schema_max_file_classes\n123\nselect @@session.performance_schema_max_file_classes;\nERROR HY000: Variable 'performance_schema_max_file_classes' is a GLOBAL variable\nshow global variables like 'performance_schema_max_file_classes';\nVariable_name\tValue\nperformance_schema_max_file_classes\t123\nshow session variables like 'performance_schema_max_file_classes';\nVariable_name\tValue\nperformance_schema_max_file_classes\t123\nselect * from performance_schema.global_variables\nwhere variable_name='performance_schema_max_file_classes';\nVARIABLE_NAME\tVARIABLE_VALUE\nperformance_schema_max_file_classes\t123\nselect * from performance_schema.session_variables\nwhere variable_name='performance_schema_max_file_classes';\nVARIABLE_NAME\tVARIABLE_VALUE\nperformance_schema_max_file_classes\t123\nset global performance_schema_max_file_classes=1;\nERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable\nset session performance_schema_max_file_classes=1;\nERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable\n"} +{"text": "Sample code provided with the SVG sources\n=========================================\n\nThere are a few code samples for SVG usage in the folder _Samples_ under the project root.\nAll of these samples are included in the solution provided with the source code for easier usage.\nThe following samples are currently available:\n\nSVGViewer\n---------\nThis is a form-based .NET application that is able to read an SVG file and display it, along with it's\nsource XML. It also allows to edit the XML, so it can be used to see how arbitrary SVG code will be \ndisplayed using the library. \n\nApart from being useful as a tool, the source code shows how to load an SVG image, render it, and\nsave it in another format (PNG in this case). You will find the relevant code in _SvgViewer.cs_\n\nSvgSample\n---------\nThis is a small command line application that reads in a sample SVG, changes the style of one of it's\nelements, and saves it to a PNG file. It shows how to access and alter an element of the SVG source tree.\n\n\nXMLOutputTester\n---------------\nThis is a simple form-based application that shows how to create a new SVG document from scratch (in this\nexample representing a filled circle), display it's XML source and save it to a file.\n\n\nEntities\n--------\nAnother small command line application that loads an example file that references entities not present\nin the file, and provides these entities with matching styles dynamically in the `SvgDocument.Open` call.\n\nSvgConsole\n----------\nThis is a simple command-line application to convert one or many input SVG files to PNG images. It shows how to open a SVG document and create bitmap, and how to save resulting bitmap to a PNG file.\n\n---\nAs you can see, there are currently very few code samples. We encourage you to add your own sample code\nin pull requests, or provide code snippets that can be made into samples.\n\nThis project lives from public contributions, and we appreciate any help!\n\n---\n"} +{"text": "# Linux Crash Dumping\n\nOfficial builds of Chrome support crash dumping and reporting using the Google\ncrash servers. This is a guide to how this works.\n\n[TOC]\n\n## Breakpad\n\nBreakpad is an open source library which we use for crash reporting across all\nthree platforms (Linux, Mac and Windows). For Linux, a substantial amount of\nwork was required to support cross-process dumping. At the time of writing this\ncode is currently forked from the upstream breakpad repo. While this situation\nremains, the forked code lives in `third_party/breakpad/linux`. The upstream\nrepo is mirrored in `third_party/breakpad/breakpad`.\n\nThe code currently supports i386 only. Getting x86-64 to work should only be a\nminor amount of work.\n\n### Minidumps\n\nBreakpad deals in a file format called 'minidumps'. This is a Microsoft format\nand thus is defined by in-memory structures which are dumped, raw, to disk. The\nmain header file for this file format is\n`third_party/breakpad/breakpad/src/google_breakpad/common/minidump_format.h`.\n\nAt the top level, the minidump file format is a list of key-value pairs. Many of\nthe keys are defined by the minidump format and contain cross-platform\nrepresentations of stacks, threads etc. For Linux we also define a number of\ncustom keys containing `/proc/cpuinfo`, `lsb-release` etc. These are defined in\n`third_party/breakpad/breakpad/linux/minidump_format_linux.h`.\n\n### Catching exceptions\n\nExceptional conditions (such as invalid memory references, floating point\nexceptions, etc) are signaled by synchronous signals to the thread which caused\nthem. Synchronous signals are always run on the thread which triggered them as\nopposed to asynchronous signals which can be handled by any thread in a\nthread-group which hasn't masked that signal.\n\nAll the signals that we wish to catch are synchronous except SIGABRT, and we can\nalways arrange to send SIGABRT to a specific thread. Thus, we find the crashing\nthread by looking at the current thread in the signal handler.\n\nThe signal handlers run on a pre-allocated stack in case the crash was triggered\nby a stack overflow.\n\nOnce we have started handling the signal, we have to assume that the address\nspace is compromised. In order not to fall prey to this and crash (again) in the\ncrash handler, we observe some rules:\n\n1. We don't enter the dynamic linker. This, observably, can trigger crashes in\n the crash handler. Unfortunately, entering the dynamic linker is very easy\n and can be triggered by calling a function from a shared library who's\n resolution hasn't been cached yet. Since we can't know which functions have\n been cached we avoid calling any of these functions with one exception:\n `memcpy`. Since the compiler can emit calls to `memcpy` we can't really\n avoid it.\n1. We don't allocate memory via malloc as the heap may be corrupt. Instead we\n use a custom allocator (in `breadpad/linux/memory.h`) which gets clean pages\n directly from the kernel.\n\nIn order to avoid calling into libc we have a couple of header files which wrap\nthe system calls (`linux_syscall_support.h`) and reimplement a tiny subset of\nlibc (`linux_libc_support.h`).\n\n### Self dumping\n\nThe simple case occurs when the browser process crashes. Here we catch the\nsignal and `clone` a new process to perform the dumping. We have to use a new\nprocess because a process cannot ptrace itself.\n\nThe dumping process then ptrace attaches to all the threads in the crashed\nprocess and writes out a minidump to `/tmp`. This is generic breakpad code.\n\nThen we reach the Chrome specific parts in `chrome/app/breakpad_linux.cc`. Here\nwe construct another temporary file and write a MIME wrapping of the crash dump\nready for uploading. We then fork off `wget` to upload the file. Based on Debian\npopcorn, `wget` is very commonly installed (much more so than `libcurl`) and\n`wget` handles the HTTPS gubbins for us.\n\n### Renderer dumping\n\nIn the case of a crash in the renderer, we don't want the renderer handling the\ncrash dumping itself. In the future we will sandbox the renderer and allowing it\nthe authority to crash dump itself is too much.\n\nThus, we split the crash dumping in two parts: the gathering of information\nwhich is done in process and the external dumping which is done out of process.\nIn the case above, the latter half was done in a `clone`d child. In this case,\nthe browser process handles it.\n\nWhen renderers are forked off, they have a `UNIX DGRAM` socket in file\ndescriptor 4. The signal handler then calls into Chrome specific code\n(`chrome/renderer/render_crash_handler_linux.cc`) when it would otherwise\n`clone`. The Chrome specific code sends a datagram to the socket which contains:\n\n* Information which is only available to the signal handler (such as the\n `ucontext` structure).\n* A file descriptor to a pipe which it then blocks on reading from.\n* A `CREDENTIALS` structure giving its PID.\n\nThe kernel enforces that the renderer isn't lying in the `CREDENTIALS` structure\nso it can't ask the browser to crash dump another process.\n\nThe browser then performs the ptrace and minidump writing which would otherwise\nbe performed in the `clone`d process and does the MIME wrapping the uploading as\nnormal.\n\nOnce the browser has finished getting information from the crashed renderer via\nptrace, it writes a byte to the file descriptor which was passed from the\nrenderer. The renderer than wakes up (because it was blocking on reading from\nthe other end) and rethrows the signal to itself. It then appears to crash\n'normally' and other parts of the browser notice the abnormal termination and\ndisplay the sad tab.\n\n## How to test Breakpad support in Chromium\n\n* Build Chromium as normal.\n* Run the browser with the environment variable\n [CHROME_HEADLESS=1](https://crbug.com/19663). This enables crash dumping but\n prevents crash dumps from being uploaded and deleted.\n\n ```shell\n env CHROME_HEADLESS=1 ./out/Debug/chrome-wrapper\n ```\n* Visit the special URL `chrome://crash` to trigger a crash in the renderer\n process.\n* A crash dump file should appear in the directory\n `~/.config/chromium/Crash Reports`.\n"} +{"text": "# -*- coding: utf-8 -*-\n\"\"\"Module used to launch rating dialogues and send ratings to Trakt\"\"\"\n\nimport xbmc\nimport xbmcaddon\nimport xbmcgui\nfrom resources.lib import utilities\nfrom resources.lib import kodiUtilities\nfrom resources.lib import globals\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n__addon__ = xbmcaddon.Addon(\"script.trakt\")\n\ndef ratingCheck(media_type, items_to_rate, watched_time, total_time):\n \"\"\"Check if a video should be rated and if so launches the rating dialog\"\"\"\n logger.debug(\"Rating Check called for '%s'\" % media_type)\n if not kodiUtilities.getSettingAsBool(\"rate_%s\" % media_type):\n logger.debug(\"'%s' is configured to not be rated.\" % media_type)\n return\n if items_to_rate is None:\n logger.debug(\"Summary information is empty, aborting.\")\n return\n watched = (watched_time / total_time) * 100\n if watched >= kodiUtilities.getSettingAsFloat(\"rate_min_view_time\"):\n rateMedia(media_type, items_to_rate)\n else:\n logger.debug(\"'%s' does not meet minimum view time for rating (watched: %0.2f%%, minimum: %0.2f%%)\" % (media_type, watched, kodiUtilities.getSettingAsFloat(\"rate_min_view_time\")))\n\ndef rateMedia(media_type, itemsToRate, unrate=False, rating=None):\n \"\"\"Launches the rating dialog\"\"\"\n for summary_info in itemsToRate:\n if not utilities.isValidMediaType(media_type):\n logger.debug(\"Not a valid media type\")\n return\n elif 'user' not in summary_info:\n logger.debug(\"No user data\")\n return\n\n s = utilities.getFormattedItemName(media_type, summary_info)\n\n logger.debug(\"Summary Info %s\" % summary_info)\n\n if unrate:\n rating = None\n\n if summary_info['user']['ratings']['rating'] > 0:\n rating = 0\n\n if not rating is None:\n logger.debug(\"'%s' is being unrated.\" % s)\n __rateOnTrakt(rating, media_type, summary_info, unrate=True)\n else:\n logger.debug(\"'%s' has not been rated, so not unrating.\" % s)\n\n return\n\n rerate = kodiUtilities.getSettingAsBool('rate_rerate')\n if rating is not None:\n if summary_info['user']['ratings']['rating'] == 0:\n logger.debug(\"Rating for '%s' is being set to '%d' manually.\" % (s, rating))\n __rateOnTrakt(rating, media_type, summary_info)\n else:\n if rerate:\n if not summary_info['user']['ratings']['rating'] == rating:\n logger.debug(\"Rating for '%s' is being set to '%d' manually.\" % (s, rating))\n __rateOnTrakt(rating, media_type, summary_info)\n else:\n kodiUtilities.notification(kodiUtilities.getString(32043), s)\n logger.debug(\"'%s' already has a rating of '%d'.\" % (s, rating))\n else:\n kodiUtilities.notification(kodiUtilities.getString(32041), s)\n logger.debug(\"'%s' is already rated.\" % s)\n return\n\n if summary_info['user']['ratings'] and summary_info['user']['ratings']['rating']:\n if not rerate:\n logger.debug(\"'%s' has already been rated.\" % s)\n kodiUtilities.notification(kodiUtilities.getString(32041), s)\n return\n else:\n logger.debug(\"'%s' is being re-rated.\" % s)\n\n gui = RatingDialog(\n \"script-trakt-RatingDialog.xml\",\n __addon__.getAddonInfo('path'),\n media_type,\n summary_info,\n rerate\n )\n\n gui.doModal()\n if gui.rating:\n rating = gui.rating\n if rerate:\n if summary_info['user']['ratings'] and summary_info['user']['ratings']['rating'] > 0 and rating == summary_info['user']['ratings']['rating']:\n rating = 0\n\n if rating == 0 or rating == \"unrate\":\n __rateOnTrakt(rating, gui.media_type, gui.media, unrate=True)\n else:\n __rateOnTrakt(rating, gui.media_type, gui.media)\n else:\n logger.debug(\"Rating dialog was closed with no rating.\")\n\n del gui\n #Reset rating and unrate for multi part episodes\n unrate=False\n rating=None\n\ndef __rateOnTrakt(rating, media_type, media, unrate=False):\n logger.debug(\"Sending rating (%s) to Trakt.tv\" % rating)\n\n params = media\n if utilities.isMovie(media_type):\n key = 'movies'\n params['rating'] = rating\n if 'movieid' in media:\n kodiUtilities.kodiJsonRequest({\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"VideoLibrary.SetMovieDetails\", \"params\": {\"movieid\": media['movieid'], \"userrating\": rating}})\n elif utilities.isShow(media_type):\n key = 'shows'\n params['rating'] = rating\n if 'tvshowid' in media:\n kodiUtilities.kodiJsonRequest({\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"VideoLibrary.SetTVShowDetails\", \"params\": {\"tvshowid\": media['tvshowid'], \"userrating\": rating}})\n elif utilities.isSeason(media_type):\n key = 'shows'\n params['seasons'] = [{'rating': rating, 'number': media['season']}]\n elif utilities.isEpisode(media_type):\n key = 'episodes'\n params['rating'] = rating\n if 'episodeid' in media:\n kodiUtilities.kodiJsonRequest({\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"VideoLibrary.SetEpisodeDetails\", \"params\": {\"episodeid\": media['episodeid'], \"userrating\": rating}})\n else:\n return\n root = {key: [params]}\n\n if not unrate:\n data = globals.traktapi.addRating(root)\n else:\n data = globals.traktapi.removeRating(root)\n\n if data:\n s = utilities.getFormattedItemName(media_type, media)\n if 'not_found' in data and not data['not_found']['movies'] and not data['not_found']['episodes'] and not data['not_found']['shows']:\n\n if not unrate:\n kodiUtilities.notification(kodiUtilities.getString(32040), s)\n else:\n kodiUtilities.notification(kodiUtilities.getString(32042), s)\n else:\n kodiUtilities.notification(kodiUtilities.getString(32044), s)\n\nclass RatingDialog(xbmcgui.WindowXMLDialog):\n buttons = {\n 11030: 1,\n 11031: 2,\n 11032: 3,\n 11033: 4,\n 11034: 5,\n 11035: 6,\n 11036: 7,\n 11037: 8,\n 11038: 9,\n 11039: 10\n }\n\n focus_labels = {\n 11030: 32028,\n 11031: 32029,\n 11032: 32030,\n 11033: 32031,\n 11034: 32032,\n 11035: 32033,\n 11036: 32034,\n 11037: 32035,\n 11038: 32036,\n 11039: 32027\n }\n\n def __init__(self, xmlFile, resourcePath, media_type, media, rerate):\n self.media_type = media_type\n self.media = media\n self.rating = None\n self.rerate = rerate\n self.default_rating = kodiUtilities.getSettingAsInt('rating_default')\n\n def __new__(cls, xmlFile, resourcePath, media_type, media, rerate):\n return super(RatingDialog, cls).__new__(cls, xmlFile, resourcePath)\n\n def onInit(self):\n s = utilities.getFormattedItemName(self.media_type, self.media)\n self.getControl(10012).setLabel(s)\n\n rateID = 11029 + self.default_rating\n if self.rerate and self.media['user']['ratings'] and int(self.media['user']['ratings']['rating']) > 0:\n rateID = 11029 + int(self.media['user']['ratings']['rating'])\n self.setFocus(self.getControl(rateID))\n\n def onClick(self, controlID):\n if controlID in self.buttons:\n self.rating = self.buttons[controlID]\n self.close()\n\n def onFocus(self, controlID):\n if controlID in self.focus_labels:\n s = kodiUtilities.getString(self.focus_labels[controlID])\n\n if self.rerate:\n if self.media['user']['ratings'] and self.media['user']['ratings']['rating'] == self.buttons[controlID]:\n if utilities.isMovie(self.media_type):\n s = kodiUtilities.getString(32037)\n elif utilities.isShow(self.media_type):\n s = kodiUtilities.getString(32038)\n elif utilities.isEpisode(self.media_type):\n s = kodiUtilities.getString(32039)\n elif utilities.isSeason(self.media_type):\n s = kodiUtilities.getString(32132)\n else:\n pass\n\n self.getControl(10013).setLabel(s)\n else:\n self.getControl(10013).setLabel('')\n"} +{"text": "/*\nTEST_OUTPUT:\n---\nfail_compilation/fail20448.d(16): Error: returning `p.x` escapes a reference to local variable `p`\nfail_compilation/fail20448.d(22): Error: template instance `fail20448.member!\"x\"` error instantiating\n---\n*/\n\nstruct S\n{\n int x, y;\n}\n\nref int member(string mem)(S p)\n{\n return p.x;\n}\n\nvoid main()\n{\n S p;\n p.member!\"x\" = 2;\n}\n"} +{"text": "\n \n \n \n November 15, 1996\n Dear Personal Donor:\n In the short while since Goodwill helped him find his job, Robert has\n learned to thoroughly clean a motel room in about 40 minutes. His job\n objectives call for him to do it in 30.\n He has no time to waste.\n Neither do we. With the help of friends like you, Goodwill has\n continued to adapt our services to meet the human needs of our changing\n society.\n We don't waste time as we are helping the community. And we don't\n waste money. The gift that I am asking you to make will be used to\n continue our mission of helping people prepare for, find and keep\n jobs.\n In their December, 1995 review of the nation's best charities, U.S.\n News & World Report called Goodwill one of the five \"Standout Good\n Guys.\" The magazine stated that Goodwill (as well as the other standouts)\n is \"uniquely effective, innovative or valuable.\"\n While I appreciate U.S. News & World Report's endorsement, the\n true value of your support is measured by the way Goodwill takes on\n problems that affect all of us.\n Every time we help someone find a solution to their employment\n barrier, the positive effects radiate throughout our community: The\n business community welcomes not only another worker, but a consumer with\n increased purchasing power. Parents act as role models of\n self-sufficiency instead of dependency. Tax dollars that would have been\n spent on public assistance are saved.\n You and I know that solutions to difficult problems don't just happen.\n At Goodwill, it is the hard work of staff and those who benefit from our\n services that produces the kind of inspiring results I see every day:\n A Goodwill staff member addresses a group of welfare recipients: \"You\n can earn the money to support yourself and your family,\" she says. \"You\n can get off welfare. I know you can... I did.\"\n A participant in a Goodwill program rushes back from a job interview\n to share the results with his classmates in our desktop publishing\n training program. once his tears have subsided, he confirms what his\n classmates have already figured out: he just received a job offer -- his\n first in five years.\n Addressing a meeting at a neighborhood center, a Goodwill staff member\n tells the audience how Goodwill can help them find and keep jobs. On his\n way home, he shares the story with four people at a street corner. At the\n next corner he tells five more.\n In order to develop job skills, a man with some serious disabilities\n begins working in Goodwill's industrial division. It takes a long time\n for him to gain the self-confidence to work elsewhere in the community.\n Eventually, he turns your support into a payoff for all of us. He proudly\n leaves Goodwill to support himself.\n These people and their successes are real. Just like the respect we've\n earned from U.S. News & World Report. Just like the impact Goodwill's\n work has on our community.\n Real work. Real results. A real difference in people's lives -- in all\n of our lives.\n The people who can benefit most directly from your generosity have no\n time to waste. Neither do the rest of us who feel the positive results of\n their success. Your support helps provide real solutions.\n Please use the enclosed response card and envelope to give generously\n to Goodwill today.\n Sincerely,\n \n \n Jack Dustman Board Member and Former Chairman\n \n \n \n"} +{"text": "description=VCD NTSC\nframe_rate_num=30000\nframe_rate_den=1001\nwidth=352\nheight=240\nprogressive=1\nsample_aspect_num=10\nsample_aspect_den=11\ndisplay_aspect_num=4\ndisplay_aspect_den=3\ncolorspace=601\n"} +{"text": "from os.path import dirname\n\ndef load_tests(loader, standard_tests, pattern):\n this_dir = dirname(__file__)\n top_dir = dirname(dirname(this_dir))\n package_tests = loader.discover(start_dir=this_dir, pattern='test*.py',\n top_level_dir=top_dir)\n standard_tests.addTests(package_tests)\n return standard_tests\n"} +{"text": "/***************************************************************************\n* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *\n* Martin Renou *\n* Copyright (c) QuantStack *\n* *\n* Distributed under the terms of the BSD 3-Clause License. *\n* *\n* The full license is in the file LICENSE, distributed with this software. *\n****************************************************************************/\n\n#ifndef XFRAME_XAXIS_FUNCTION_HPP\n#define XFRAME_XAXIS_FUNCTION_HPP\n\n#include \"xtensor/xoptional.hpp\"\n#include \"xtensor/xgenerator.hpp\"\n\n#include \"xframe_expression.hpp\"\n#include \"xframe_utils.hpp\"\n#include \"xaxis_meta.hpp\"\n#include \"xaxis_expression_leaf.hpp\"\n\nnamespace xf\n{\n /******************\n * xaxis_function *\n ******************/\n\n /**\n * @class xaxis_function\n * @brief An expression of xaxis\n *\n * The xaxis_function class is used for creating an expression on named axis, e.g.\n * `auto expr = not_equal(axis1, 2) && axis2 < 2`.\n *\n * @tparam F the function type.\n * @tparam R the result type.\n * @tparam CT the function argument types.\n * @sa xaxis_expression_leaf\n * @sa xnamed_axis\n */\n template \n class xaxis_function : public xt::xexpression>\n {\n public:\n\n using self_type = xaxis_function;\n using functor_type = std::remove_reference_t;\n\n using value_type = R;\n using reference = value_type;\n using const_reference = value_type;\n using pointer = value_type*;\n using const_pointer = const value_type*;\n using name_type = detail::common_name_type_t>...>;\n using size_type = xt::common_size_type_t>...>;\n\n template \n using selector_sequence_type = detail::xselector_sequence_t, N>;\n\n using expression_tag = xaxis_expression_tag;\n\n template ::value>>\n xaxis_function(Func&& f, CT... e) noexcept;\n\n template \n const_reference operator()(const selector_sequence_type& selector) const;\n\n private:\n\n template \n const_reference evaluate(std::index_sequence, const selector_sequence_type& selector) const;\n\n std::tuple...> m_e;\n functor_type m_f;\n };\n\n /*********************************\n * xaxis_function implementation *\n *********************************/\n\n /**\n * Builds an axis function.\n * @param f the function to apply.\n * @param e the function arguments.\n */\n template \n template \n inline xaxis_function::xaxis_function(Func&& f, CT... e) noexcept\n : m_e(detail::get_axis_closure(std::forward(e))...),\n m_f(std::forward(f))\n {\n }\n\n /**\n * Returns an evaluation of the xaxis_function.\n * Example:\n * \\code{.cpp}\n * auto axis1 = named_axis(\"abs\", axis(16));\n * auto axis2 = named_axis(\"ord\", axis({'a', 'c', 'i'}));\n *\n * auto func1 = axis1 < 5 && not_equal(axis2, 'i');\n *\n * // This will evaluate the xaxis_function for `axis1.label(10) == 9` and `axis2.label(1) == 'c'``\n * func1({{\"abs\", 10}, {\"ord\", 1}});\n * \\endcode\n *\n * @param selector a selector_sequence_type for selecting the position\n * where you want to evaluate the function.\n * @return the evaluation of the xaxis_function\n */\n template \n template \n inline auto xaxis_function::operator()(const selector_sequence_type& selector) const -> const_reference\n {\n return evaluate(std::make_index_sequence(), selector);\n }\n\n template \n template \n inline auto xaxis_function::evaluate(std::index_sequence, const selector_sequence_type& selector) const -> const_reference\n {\n#ifdef _MSC_VER\n return m_f(std::get(m_e).operator()(selector)...);\n#else\n return m_f(std::get(m_e).template operator()(selector)...);\n#endif\n }\n\n /**********************\n * axis_function_mask *\n **********************/\n\n namespace detail\n {\n template \n class axis_function_mask_impl\n {\n public:\n\n using axis_function_type = std::remove_reference_t;\n\n using value_type = typename axis_function_type::value_type;\n using name_type = typename axis_function_type::name_type;\n using size_type = typename axis_function_type::size_type;\n\n template \n using selector_sequence_type = detail::xselector_sequence_t, N>;\n\n axis_function_mask_impl(AF&& axis_function, DM&& dim_mapping)\n : m_axis_function(std::forward(axis_function)),\n m_dimension_mapping(std::forward(dim_mapping))\n {\n }\n\n template \n inline value_type operator()(Args... args) const\n {\n auto selector = make_selector(std::make_index_sequence(), args...);\n#ifdef _MSC_VER\n return m_axis_function.operator()(selector);\n#else\n return m_axis_function.template operator()(selector);\n#endif\n }\n\n template \n inline value_type element(It first, It last) const\n {\n // TODO avoid dynamic allocation\n auto selector = selector_sequence_type();\n std::size_t i = 0;\n for (It it = first; it != last; ++it)\n {\n selector.push_back(std::make_pair(m_dimension_mapping.label(i++), static_cast(*it)));\n }\n#ifdef _MSC_VER\n return m_axis_function.operator()(selector);\n#else\n return m_axis_function.template operator()(selector);\n#endif\n }\n\n private:\n\n AF m_axis_function;\n DM m_dimension_mapping;\n\n template \n inline selector_sequence_type make_selector(std::index_sequence, Args&&... args) const\n {\n return {std::make_pair(m_dimension_mapping.label(I), static_cast(args))...};\n }\n };\n }\n\n template \n inline auto axis_function_mask(AF&& axis_function, DM&& dim_mapping, const S& shape) noexcept\n {\n return xt::detail::make_xgenerator(\n detail::axis_function_mask_impl(std::forward(axis_function), std::forward(dim_mapping)),\n shape\n );\n }\n}\n\n#endif\n"} +{"text": "/*\n * Copyright 2016-present Open Networking Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.onosproject.rest.resources;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.ArrayNode;\nimport com.fasterxml.jackson.databind.node.ObjectNode;\nimport org.onosproject.cluster.NodeId;\nimport org.onosproject.cluster.RoleInfo;\nimport org.onosproject.mastership.MastershipAdminService;\nimport org.onosproject.mastership.MastershipService;\nimport org.onosproject.net.DeviceId;\nimport org.onosproject.net.MastershipRole;\nimport org.onosproject.net.device.DeviceService;\nimport org.onosproject.rest.AbstractWebResource;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.PUT;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\nimport javax.ws.rs.core.Response;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Set;\n\nimport static org.onlab.util.Tools.nullIsNotFound;\nimport static org.onlab.util.Tools.readTreeFromStream;\n\n/**\n * Manage the mastership of ONOS instances.\n */\n@Path(\"mastership\")\npublic final class MastershipWebResource extends AbstractWebResource {\n\n private static final String DEVICE_IDS = \"deviceIds\";\n private static final String DEVICE_ID = \"deviceId\";\n private static final String NODE_ID = \"nodeId\";\n\n private static final String DEVICE_ID_INVALID = \"Invalid deviceId for setting role\";\n private static final String NODE_ID_INVALID = \"Invalid nodeId for setting role\";\n\n private static final String DEVICE_ID_NOT_FOUND = \"Device Id is not found\";\n private static final String NODE_ID_NOT_FOUND = \"Node id is not found\";\n private static final String ROLE_INFO_NOT_FOUND = \"Role info is not found\";\n private static final String MASTERSHIP_ROLE_NOT_FOUND = \"Mastership role is not found\";\n\n /**\n * Returns the role of the local node for the specified device.\n *\n * @param deviceId device identifier\n * @return 200 OK with role of the current node\n * @onos.rsModel MastershipRole\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"{deviceId}/local\")\n public Response getLocalRole(@PathParam(\"deviceId\") String deviceId) {\n MastershipService mastershipService = get(MastershipService.class);\n MastershipRole role = mastershipService.getLocalRole(DeviceId.deviceId(deviceId));\n ObjectNode root = codec(MastershipRole.class).encode(role, this);\n return ok(root).build();\n }\n\n /**\n * Returns the current master for a given device.\n *\n * @param deviceId device identifier\n * @return 200 OK with the identifier of the master controller for the device\n * @onos.rsModel NodeId\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"{deviceId}/master\")\n public Response getMasterFor(@PathParam(\"deviceId\") String deviceId) {\n MastershipService mastershipService = get(MastershipService.class);\n NodeId id = nullIsNotFound(mastershipService.getMasterFor(\n DeviceId.deviceId(deviceId)), NODE_ID_NOT_FOUND);\n\n ObjectNode root = mapper().createObjectNode();\n root.put(NODE_ID, id.id());\n return ok(root).build();\n }\n\n /**\n * Returns controllers connected to a given device, in order of\n * preference. The first entry in the list is the current master.\n *\n * @param deviceId device identifier\n * @return 200 OK with a list of controller identifiers\n * @onos.rsModel RoleInfo\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"{deviceId}/role\")\n public Response getNodesFor(@PathParam(\"deviceId\") String deviceId) {\n MastershipService mastershipService = get(MastershipService.class);\n RoleInfo info = nullIsNotFound(mastershipService.getNodesFor(\n DeviceId.deviceId(deviceId)), ROLE_INFO_NOT_FOUND);\n ObjectNode root = codec(RoleInfo.class).encode(info, this);\n return ok(root).build();\n }\n\n /**\n * Returns the devices for which a controller is master.\n *\n * @param nodeId controller identifier\n * @return 200 OK with a set of device identifiers\n * @onos.rsModel DeviceIds\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"{nodeId}/device\")\n public Response getDeviceOf(@PathParam(\"nodeId\") String nodeId) {\n MastershipService mastershipService = get(MastershipService.class);\n ObjectNode root = mapper().createObjectNode();\n ArrayNode devicesNode = root.putArray(DEVICE_IDS);\n\n Set devices = mastershipService.getDevicesOf(NodeId.nodeId(nodeId));\n if (devices != null) {\n devices.forEach(id -> devicesNode.add(id.toString()));\n }\n\n return ok(root).build();\n }\n\n /**\n * Returns the mastership status of the local controller for a given\n * device forcing master selection if necessary.\n *\n * @param deviceId device identifier\n * @return 200 OK with the role of this controller instance\n * @onos.rsModel MastershipRole\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"{deviceId}/request\")\n public Response requestRoleFor(@PathParam(\"deviceId\") String deviceId) {\n MastershipService mastershipService = get(MastershipService.class);\n DeviceService deviceService = get(DeviceService.class);\n DeviceId id = DeviceId.deviceId(deviceId);\n nullIsNotFound(deviceService.getDevice(id), DEVICE_ID_NOT_FOUND);\n\n MastershipRole role = nullIsNotFound(mastershipService.requestRoleForSync(id),\n MASTERSHIP_ROLE_NOT_FOUND);\n ObjectNode root = codec(MastershipRole.class).encode(role, this);\n return ok(root).build();\n }\n\n /**\n * Abandons mastership of the specified device on the local node thus\n * forcing selection of a new master. If the local node is not a master\n * for this device, no master selection will occur.\n *\n * @param deviceId device identifier\n * @return status of the request - CREATED if the JSON is correct\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"{deviceId}/relinquish\")\n public Response relinquishMastership(@PathParam(\"deviceId\") String deviceId) {\n MastershipService mastershipService = get(MastershipService.class);\n DeviceId id = DeviceId.deviceId(deviceId);\n mastershipService.relinquishMastershipSync(id);\n return Response.created(id.uri()).build();\n }\n\n /**\n * Applies the current mastership role for the specified device.\n *\n * @param stream JSON representation of device, node, mastership info\n * @return status of the request - CREATED if the JSON is correct,\n * BAD_REQUEST if the JSON is invalid\n * @onos.rsModel MastershipPut\n */\n @PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public Response setRole(InputStream stream) {\n MastershipAdminService mastershipAdminService = get(MastershipAdminService.class);\n\n try {\n ObjectNode jsonTree = readTreeFromStream(mapper(), stream);\n JsonNode deviceIdJson = jsonTree.get(DEVICE_ID);\n JsonNode nodeIdJson = jsonTree.get(NODE_ID);\n MastershipRole role = codec(MastershipRole.class).decode(jsonTree, this);\n\n if (deviceIdJson == null) {\n throw new IllegalArgumentException(DEVICE_ID_INVALID);\n }\n\n if (nodeIdJson == null) {\n throw new IllegalArgumentException(NODE_ID_INVALID);\n }\n\n mastershipAdminService.setRoleSync(NodeId.nodeId(nodeIdJson.asText()),\n DeviceId.deviceId(deviceIdJson.asText()), role);\n\n return Response.ok().build();\n } catch (IOException e) {\n throw new IllegalArgumentException(e);\n }\n }\n\n /**\n * Balances the mastership to be shared as evenly as possibly by all\n * online instances.\n *\n * @return status of the request - OK if the request is successfully processed\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response balanceRoles() {\n MastershipAdminService mastershipAdminService = get(MastershipAdminService.class);\n mastershipAdminService.balanceRoles();\n return Response.ok().build();\n }\n}\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.ambari.server.utils;\n\nimport javax.xml.bind.annotation.XmlElement;\n\npublic class JaxbMapKeyMap {\n @XmlElement public String key;\n @XmlElement public JaxbMapKeyVal[] value;\n\n private JaxbMapKeyMap() {}\n\n public JaxbMapKeyMap(String key, JaxbMapKeyVal[] value)\n {\n this.key = key;\n this.value = value;\n }\n}\n"} +{"text": "//: [Previous](@previous)\n\nimport UIKit\nimport PlaygroundSupport\n\nlet hostView = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 480))\nhostView.backgroundColor = UIColor.white\nPlaygroundPage.current.liveView = hostView\n\nlet makeView = { (color: UIColor) -> UIView in\n let view = UIView(frame: .zero)\n view.translatesAutoresizingMaskIntoConstraints = false\n view.backgroundColor = color\n return view\n}\n\nlet iconImageView = UIImageView(image: UIImage(named: \"IconFojusi\"))\niconImageView.layer.cornerRadius = 20\niconImageView.clipsToBounds = true\n\nlet appNameLabel = UILabel(frame: .zero)\nappNameLabel.font = UIFont.boldSystemFont(ofSize: 15)\nappNameLabel.text = \"Fojusi\"\n//appNameLabel.backgroundColor = UIColor.yellow\n\nlet devNameLabel = UILabel(frame: .zero)\ndevNameLabel.font = UIFont.systemFont(ofSize: 13)\ndevNameLabel.text = \"Dominik Hauser\"\n//devNameLabel.backgroundColor = UIColor.red\n\nlet buyButton = UIButton(type: .system)\nbuyButton.setTitle(\"0,99 €\", for: UIControl.State.normal)\nbuyButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 13)\nbuyButton.layer.cornerRadius = 5\nbuyButton.layer.borderColor = buyButton.tintColor.cgColor\nbuyButton.layer.borderWidth = 1\n\nlet headerView = UIView(frame: .zero)\n//headerView.backgroundColor = UIColor.brownColor()\n\nlet metaDataStackView = UIStackView(arrangedSubviews: [appNameLabel, devNameLabel])\nmetaDataStackView.axis = .vertical\n\nlet leftHeaderStackView = UIStackView(arrangedSubviews: [metaDataStackView, buyButton])\nleftHeaderStackView.axis = .vertical\nleftHeaderStackView.distribution = UIStackView.Distribution.equalCentering\n\nlet headerStackView = UIStackView(arrangedSubviews: [iconImageView, leftHeaderStackView])\nheaderStackView.translatesAutoresizingMaskIntoConstraints = false\n// headerStackView.alignment = .Top\nheaderStackView.isLayoutMarginsRelativeArrangement = true\nheaderStackView.spacing = 10\nheaderView.addSubview(headerStackView)\n\nlet mainStackView = UIStackView(arrangedSubviews: [headerView])\nmainStackView.translatesAutoresizingMaskIntoConstraints = false\nhostView.addSubview(mainStackView)\n\nNSLayoutConstraint.activate(\n [\n mainStackView.leadingAnchor.constraint(equalTo: hostView.leadingAnchor),\n mainStackView.trailingAnchor.constraint(equalTo: hostView.trailingAnchor),\n mainStackView.topAnchor.constraint(equalTo: hostView.topAnchor),\n mainStackView.bottomAnchor.constraint(equalTo: hostView.bottomAnchor),\n headerStackView.leadingAnchor.constraint(equalTo: headerView.leadingAnchor, constant: 10),\n headerStackView.trailingAnchor.constraint(equalTo: headerView.trailingAnchor, constant: -10),\n headerStackView.topAnchor.constraint(equalTo: headerView.topAnchor, constant: 10),\n iconImageView.widthAnchor.constraint(equalToConstant: 100),\n iconImageView.heightAnchor.constraint(equalToConstant: 100),\n ])\n\n//: [Next](@next)\n"} +{"text": "\n\nwiderface\n58--Hockey_58_Hockey_icehockey_puck_58_384.jpg\n\nwider face Database\nPASCAL VOC2007\nflickr\n-1\n\n\nyanyu\nyanyu\n\n\n1024\n680\n3\n\n0\n\nface\nUnspecified\n1\n0\n\n348\n575\n380\n607\n\n\n\nface\nUnspecified\n1\n0\n\n420\n495\n452\n529\n\n\n\nface\nUnspecified\n1\n0\n\n531\n442\n563\n475\n\n\n\nface\nUnspecified\n1\n0\n\n508\n336\n532\n362\n\n\n\nface\nUnspecified\n1\n0\n\n555\n305\n582\n334\n\n\n\nface\nUnspecified\n1\n0\n\n11\n514\n38\n538\n\n\n\nface\nUnspecified\n1\n0\n\n230\n212\n250\n236\n\n\n\nface\nUnspecified\n1\n0\n\n545\n259\n568\n281\n\n\n\nface\nUnspecified\n1\n0\n\n607\n227\n633\n257\n\n\n\nface\nUnspecified\n1\n0\n\n603\n194\n624\n224\n\n\n\nface\nUnspecified\n1\n0\n\n656\n184\n681\n207\n\n\n\nface\nUnspecified\n1\n0\n\n738\n127\n765\n155\n\n\n\nface\nUnspecified\n1\n0\n\n774\n66\n794\n89\n\n\n\nface\nUnspecified\n1\n0\n\n831\n58\n848\n82\n\n\n\nface\nUnspecified\n1\n0\n\n841\n26\n865\n51\n\n\n\nface\nUnspecified\n1\n0\n\n853\n4\n875\n22\n\n\n\n"} +{"text": ".. _install:\n\nInstall and configure\n~~~~~~~~~~~~~~~~~~~~~\n\nThis section describes how to install and configure the Messaging service,\ncode-named zaqar.\n\nThis section assumes that you already have a working OpenStack environment with\nat least Identity service installed.\n\nNote that installation and configuration vary by distribution.\n\n.. toctree::\n\n install-obs.rst\n install-rdo.rst\n install-ubuntu.rst\n\nPossible Minimum Scalable HA Setup\n----------------------------------\n\nScalable HA (High availability) setup is out of scope in this chapter.\n\nFor a HA setup, a load balancer has to be placed in front of the web servers.\n\nTo provide high availability with minimum administration overhead for storage\nuse ``MongoDB`` driver and for transport use ``wsgi`` driver.\n\nTo have a small footprint while providing HA, you can use two web servers which\nwill host the application and three ``MongoDB`` servers (configured as\nreplica-set) which will host Messaging service's management store and\nmessage store databases. At larger scale, the management store database and the\nmessage store database are advised to be hosted on different ``MongoDB``\nreplica sets.\n"} +{"text": "/**\n * Marlin 3D Printer Firmware\n * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]\n *\n * Based on Sprinter and grbl.\n * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n *\n */\n#pragma once\n\n/**\n * Sainsmart 2-in-1 pin assignments\n */\n\n#if HOTENDS > 2 || E_STEPPERS > 2\n #error \"Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue.\"\n#endif\n\n#define BOARD_INFO_NAME \"Sainsmart\"\n\n//\n// Heaters / Fans\n//\n#define RAMPS_D10_PIN 9 // E\n#define RAMPS_D9_PIN 7 // F PART FAN in front of board next to Extruder heat\n // RAMPS_D8_PIN 8 // B\n#define MOSFET_D_PIN 10 // F / E\n\n#include \"pins_RAMPS.h\"\n"} +{"text": "fileFormatVersion: 2\nguid: 0afec21454700d3479c4f9767f9382f9\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []\n executionOrder: 0\n icon: {instanceID: 0}\n userData: \n"} +{"text": "package tc.oc.pgm.filters.query;\n\nimport tc.oc.pgm.tracker.damage.DamageInfo;\n\npublic interface IDamageQuery extends IPlayerEventQuery {\n\n IPlayerQuery getVictim();\n\n DamageInfo getDamageInfo();\n}\n"} +{"text": "\n\n \n \n \n Dummy Tests\n \n \n\n {{content-for \"head\"}}\n {{content-for \"test-head\"}}\n\n \n \n \n\n {{content-for \"head-footer\"}}\n {{content-for \"test-head-footer\"}}\n \n \n {{content-for \"body\"}}\n {{content-for \"test-body\"}}\n\n \n \n \n \n \n\n {{content-for \"body-footer\"}}\n {{content-for \"test-body-footer\"}}\n \n\n"} +{"text": "---\ntitle: \"Migration Guide to the .NET Framework 4.8, 4.7, 4.6, and 4.5\"\ndescription: A guide for migrating to newer .NET Framework versions that includes resources for new features and application compatibility.\nms.date: \"04/18/2019\"\nhelpviewer_keywords: \n - \".NET Framework, migrating applications to\"\n - \"migration, .NET Framework\"\nms.assetid: 02d55147-9b3a-4557-a45f-fa936fadae3b\n---\n# Migrate to .NET Framework 4.8, 4.7, 4.6, and 4.5\n\nIf you created your app using an earlier version of .NET Framework, you can generally upgrade it to .NET Framework 4.5 and its point releases (4.5.1 and 4.5.2), .NET Framework 4.6 and its point releases (4.6.1 and 4.6.2), .NET Framework 4.7 and its point releases (4.7.1 and 4.7.2), or .NET Framework 4.8 easily. Open your project in Visual Studio. If your project was created in an earlier version of Visual Studio, the **Project Compatibility** dialog box automatically opens. For more information about upgrading a project in Visual Studio, see [Port, Migrate, and Upgrade Visual Studio Projects](/visualstudio/porting/port-migrate-and-upgrade-visual-studio-projects) and [Visual Studio 2019 Platform Targeting and Compatibility](/visualstudio/releases/2019/compatibility).\n\n However, some changes in .NET Framework require changes to your code. You may also want to take advantage of functionality that is new in .NET Framework 4.5 and its point releases, in .NET Framework 4.6 and its point releases, in .NET Framework 4.7 and its point releases, or in .NET Framework 4.8. Making these types of changes to your app for a new version of .NET Framework is typically referred to as *migration*. If your app doesn't have to be migrated, you can run it in .NET Framework 4.5 or a later version without recompiling it.\n\n## Migration resources\n\nReview the following documents before you migrate your app from earlier versions of .NET Framework to version 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, or 4.8:\n\n- See [Versions and Dependencies](versions-and-dependencies.md) to understand the CLR version underlying each version of the .NET Framework and to review guidelines for targeting your apps successfully.\n\n- Review [Application compatibility](application-compatibility.md) to find out about runtime and retargeting changes that might affect your app and how to handle them.\n\n- Review [What's Obsolete in the Class Library](../whats-new/whats-obsolete.md) to determine any types or members in your code that have been made obsolete, and the recommended alternatives.\n\n- See [What's New](../whats-new/index.md) for descriptions of new features that you may want to add to your app.\n\n## See also\n\n- [Application compatibility](application-compatibility.md)\n- [Migrating from the .NET Framework 1.1](migrating-from-the-net-framework-1-1.md)\n- [Version Compatibility](version-compatibility.md)\n- [Versions and Dependencies](versions-and-dependencies.md)\n- [How to: Configure an app to support .NET Framework 4 or later versions](how-to-configure-an-app-to-support-net-framework-4-or-4-5.md)\n- [What's New](../whats-new/index.md)\n- [What's Obsolete in the Class Library](../whats-new/whats-obsolete.md)\n- [.NET Framework official support policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-framework)\n- [.NET Framework 4 migration issues](net-framework-4-migration-issues.md)\n"} +{"text": "\n\n\n\n\n\n \n \n\n\n\n\n\n\nMozilla Bug 159346\n

\n\n
\n
\n\n\n\n\n
\n"} +{"text": "import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\nclass Html extends Component {\n render() {\n return (\n \n {this.props.children}\n \n );\n }\n}\n\nHtml.propTypes = {\n children: PropTypes.array.isRequired\n};\n\nexport default Html;\n"} +{"text": "{\n \"format_version\": \"1.8.0\",\n \"minecraft:client_entity\": {\n \"description\": {\n \"identifier\": \"{{PROJ_PREFIX}}:{{IDENTIFIER}}\",\n \"materials\": { \"default\": \"salmon\" },\n \"textures\": {\n \"default\": \"textures/entity/fish/{{IDENTIFIER}}\"\n },\n \"geometry\": {\n \"default\": \"geometry.{{IDENTIFIER}}\"\n },\n \"scripts\": {\n \"pre_animation\": [\n \"variable.ZRot = !query.is_in_water ? Math.cos((query.time_stamp + query.frame_alpha) * 14.32) * 90 : 0.0;\",\n \"variable.AnimationAmountBlend = Math.lerp(variable.AnimationAmountPrev, variable.AnimationAmount, query.frame_alpha);\"\n ]\n },\n \"animations\": {\n \"flop\": \"animation.{{IDENTIFIER}}.flop\",\n \"swim\": \"animation.{{IDENTIFIER}}.swim\"\n },\n \"animation_controllers\": [\n {\n \"general\": \"controller.animation.salmon.general\"\n }\n ],\n \"render_controllers\": [ \"controller.render.{{IDENTIFIER}}\" ],\n \"spawn_egg\": {\n \"texture\": \"spawn_egg\",\n \"texture_index\": 47\n }\n }\n }\n}"} +{"text": "/*\n * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or\n * its licensors.\n *\n * For complete copyright and license terms please see the LICENSE at the root of this\n * distribution (the \"License\"). All use of this software is governed by the License,\n * or, if provided, by the license below or the license accompanying this file. Do not\n * remove or modify any license notices. This file is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n */\n\n#include \"WhiteBox_precompiled.h\"\n\n#include \"Util/WhiteBoxTextureUtil.h\"\n#include \"WhiteBoxTestFixtures.h\"\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nnamespace UnitTest\n{\n std::random_device rd;\n std::mt19937 gen(rd());\n\n // rngs for the first and subsequent significant figures of the random numbers\n std::uniform_real_distribution<> rndFirstSigFig(1.0, 10.0);\n std::uniform_real_distribution<> rndOtherSigFigs(0.0, 1.0);\n\n // generate noise after the specified decimal place with the first significant\n // figure always being one decimal place after afterDecimalPlace\n float GenerateNoiseWithSignificantFigures(AZ::u32 afterDecimalPlace)\n {\n // number of significant figures of randomness to generate\n const double numSigFigs = 8;\n\n // scaling factor to push the noise back into the desired range\n const double sigFactor = std::pow(10.0, numSigFigs + afterDecimalPlace);\n\n // random value for first guaranteed significant digit\n const double firstSigFig = azlossy_cast(rndFirstSigFig(gen)) * std::pow(10.0, numSigFigs - 1);\n\n // random value for the other significant digits\n const double otherSigFigs = azlossy_cast(rndOtherSigFigs(gen) * std::pow(10.0, numSigFigs - 1));\n\n // unscaled random value with rndSigFigs significant figures\n const double fixedLengthRandom = firstSigFig + otherSigFigs;\n\n // scaled random value to push the noise into the desired significant digit range\n const float noise = fixedLengthRandom / sigFactor;\n\n return noise;\n }\n\n // generates a vector of Vector3s with noise for in specified range decimal places\n std::vector GenerateNoiseForSignificantFigureRange(AZ::u32 startDecimalPlace, AZ::u32 endDecimalPlace)\n {\n std::vector noise(endDecimalPlace - startDecimalPlace + 1);\n\n for (AZ::u32 decimal = startDecimalPlace, i = 0; decimal <= endDecimalPlace; decimal++, i++)\n {\n float x = GenerateNoiseWithSignificantFigures(decimal);\n float y = GenerateNoiseWithSignificantFigures(decimal);\n float z = GenerateNoiseWithSignificantFigures(decimal);\n noise[i] = Vector3{x, y, z};\n }\n\n return noise;\n }\n\n // vector of noise vectors with between 3 and 6 significat figures\n const std::vector Noise = GenerateNoiseForSignificantFigureRange(3, 6);\n\n // noise source permutations to be applied to each test\n const std::vector Source = {\n NoiseSource::None, NoiseSource::XComponent, NoiseSource::YComponent, NoiseSource::ZComponent,\n NoiseSource::XYComponent, NoiseSource::XZComponent, NoiseSource::YZComponent, NoiseSource::XYZComponent};\n\n enum CubeVertex : AZ::u32\n {\n FrontTopLeft,\n FrontTopRight,\n BackTopLeft,\n BackTopRight,\n FrontBottomLeft,\n FrontBottomRight,\n BackBottomLeft,\n BackBottomRight\n };\n\n const std::vector UnitCube = {\n AZ::Vector3(-0.5f, 0.5f, 0.5f), // FrontTopLeft\n AZ::Vector3(0.5f, 0.5f, 0.5f), // FrontTopRight\n AZ::Vector3(-0.5f, -0.5f, 0.5f), // BackTopLeft\n AZ::Vector3(0.5f, -0.5f, 0.5f), // BackTopRight\n AZ::Vector3(-0.5f, 0.5f, -0.5f), // FrontBottomLeft\n AZ::Vector3(0.5f, 0.5f, -0.5f), // FrontBottomRight\n AZ::Vector3(-0.5f, -0.5f, -0.5f), // BackBottomLeft\n AZ::Vector3(0.5f, -0.5f, -0.5f) // BackBottomRight\n };\n\n // returns a vector with noise applied to it as determined by the source\n AZ::Vector3 GenerateNoiseyVector(const AZ::Vector3& in, const Vector3& noise, NoiseSource source)\n {\n switch (source)\n {\n case NoiseSource::None:\n return in;\n case NoiseSource::XComponent:\n return AZ::Vector3(in.GetX() + noise.x, in.GetY(), in.GetZ());\n case NoiseSource::YComponent:\n return AZ::Vector3(in.GetX(), in.GetY() + noise.y, in.GetZ());\n case NoiseSource::ZComponent:\n return AZ::Vector3(in.GetX(), in.GetY(), in.GetZ() + noise.z);\n case NoiseSource::XYComponent:\n return AZ::Vector3(in.GetX() + noise.x, in.GetY() + noise.y, in.GetZ());\n case NoiseSource::XZComponent:\n return AZ::Vector3(in.GetX() + noise.x, in.GetY(), in.GetZ() + noise.z);\n case NoiseSource::YZComponent:\n return AZ::Vector3(in.GetX(), in.GetY() + noise.y, in.GetZ() + noise.z);\n case NoiseSource::XYZComponent:\n return AZ::Vector3(in.GetX() + noise.x, in.GetY() + noise.y, in.GetZ() + noise.z);\n\n default:\n return in;\n }\n }\n\n // returns a quaternion with the specified rotation\n AZ::Quaternion GetQuaternionFromRotation(Rotation rotation)\n {\n static const AZ::Quaternion qXAxis = AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisX(), 45);\n static const AZ::Quaternion qZAxis = AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisZ(), 45);\n static const AZ::Quaternion qXZAxis = qXAxis + qZAxis;\n\n switch (rotation)\n {\n case Rotation::Identity:\n return AZ::Quaternion::CreateIdentity();\n case Rotation::XAxis:\n return qXAxis;\n case Rotation::ZAxis:\n return qZAxis;\n case Rotation::XZAxis:\n return qXZAxis;\n default:\n return AZ::Quaternion::CreateIdentity();\n }\n }\n\n TEST_P(WhiteBoxUVTestFixture, FrontFaceCorners)\n {\n using WhiteBox::CreatePlanarUVFromVertex;\n const auto& [noise, source, rotation] = GetParam();\n\n const AZ::Quaternion qRotation = GetQuaternionFromRotation(rotation);\n const AZ::Vector3 normal = GenerateNoiseyVector(qRotation * AZ::Vector3(0.0f, -1.0f, 0.0f), noise, source);\n\n const AZ::Vector2 uv00 = CreatePlanarUVFromVertex(normal, UnitCube[FrontTopLeft]);\n const AZ::Vector2 uv10 = CreatePlanarUVFromVertex(normal, UnitCube[FrontTopRight]);\n const AZ::Vector2 uv01 = CreatePlanarUVFromVertex(normal, UnitCube[FrontBottomLeft]);\n const AZ::Vector2 uv11 = CreatePlanarUVFromVertex(normal, UnitCube[FrontBottomRight]);\n\n EXPECT_THAT(uv00, IsClose(AZ::Vector2(1.0f, 0.0f)));\n EXPECT_THAT(uv10, IsClose(AZ::Vector2(0.0f, 0.0f)));\n EXPECT_THAT(uv01, IsClose(AZ::Vector2(1.0f, 1.0f)));\n EXPECT_THAT(uv11, IsClose(AZ::Vector2(0.0f, 1.0f)));\n }\n\n TEST_P(WhiteBoxUVTestFixture, BackFaceCorners)\n {\n using WhiteBox::CreatePlanarUVFromVertex;\n const auto& [noise, source, rotation] = GetParam();\n\n const AZ::Quaternion qRotation = GetQuaternionFromRotation(rotation);\n const AZ::Vector3 normal = GenerateNoiseyVector(qRotation * AZ::Vector3(0.0f, 1.0f, 0.0f), noise, source);\n\n const AZ::Vector2 uv00 = CreatePlanarUVFromVertex(normal, UnitCube[BackTopLeft]);\n const AZ::Vector2 uv10 = CreatePlanarUVFromVertex(normal, UnitCube[BackTopRight]);\n const AZ::Vector2 uv01 = CreatePlanarUVFromVertex(normal, UnitCube[BackBottomLeft]);\n const AZ::Vector2 uv11 = CreatePlanarUVFromVertex(normal, UnitCube[BackBottomRight]);\n\n EXPECT_THAT(uv00, IsClose(AZ::Vector2(1.0f, 0.0f)));\n EXPECT_THAT(uv10, IsClose(AZ::Vector2(0.0f, 0.0f)));\n EXPECT_THAT(uv01, IsClose(AZ::Vector2(1.0f, 1.0f)));\n EXPECT_THAT(uv11, IsClose(AZ::Vector2(0.0f, 1.0f)));\n }\n\n TEST_P(WhiteBoxUVTestFixture, LeftFaceCorners)\n {\n using WhiteBox::CreatePlanarUVFromVertex;\n const auto& [noise, source, rotation] = GetParam();\n\n const AZ::Quaternion qRotation = GetQuaternionFromRotation(rotation);\n const AZ::Vector3 normal = GenerateNoiseyVector(qRotation * AZ::Vector3(-1.0f, 0.0f, 0.0f), noise, source);\n\n const AZ::Vector2 uv00 = CreatePlanarUVFromVertex(normal, UnitCube[FrontTopLeft]);\n const AZ::Vector2 uv10 = CreatePlanarUVFromVertex(normal, UnitCube[BackTopLeft]);\n const AZ::Vector2 uv01 = CreatePlanarUVFromVertex(normal, UnitCube[FrontBottomLeft]);\n const AZ::Vector2 uv11 = CreatePlanarUVFromVertex(normal, UnitCube[BackBottomLeft]);\n\n EXPECT_THAT(uv00, IsClose(AZ::Vector2(0.0f, 0.0f)));\n EXPECT_THAT(uv10, IsClose(AZ::Vector2(0.0f, 1.0f)));\n EXPECT_THAT(uv01, IsClose(AZ::Vector2(1.0f, 0.0f)));\n EXPECT_THAT(uv11, IsClose(AZ::Vector2(1.0f, 1.0f)));\n }\n\n TEST_P(WhiteBoxUVTestFixture, RightFaceCorners)\n {\n using WhiteBox::CreatePlanarUVFromVertex;\n const auto& [noise, source, rotation] = GetParam();\n\n const AZ::Quaternion qRotation = GetQuaternionFromRotation(rotation);\n const AZ::Vector3 normal = GenerateNoiseyVector(qRotation * AZ::Vector3(1.0f, 0.0f, 0.0f), noise, source);\n\n const AZ::Vector2 uv00 = CreatePlanarUVFromVertex(normal, UnitCube[FrontTopRight]);\n const AZ::Vector2 uv10 = CreatePlanarUVFromVertex(normal, UnitCube[BackTopRight]);\n const AZ::Vector2 uv01 = CreatePlanarUVFromVertex(normal, UnitCube[FrontBottomRight]);\n const AZ::Vector2 uv11 = CreatePlanarUVFromVertex(normal, UnitCube[BackBottomRight]);\n\n EXPECT_THAT(uv00, IsClose(AZ::Vector2(0.0f, 0.0f)));\n EXPECT_THAT(uv10, IsClose(AZ::Vector2(0.0f, 1.0f)));\n EXPECT_THAT(uv01, IsClose(AZ::Vector2(1.0f, 0.0f)));\n EXPECT_THAT(uv11, IsClose(AZ::Vector2(1.0f, 1.0f)));\n }\n\n TEST_P(WhiteBoxUVTestFixture, TopFaceCorners)\n {\n using WhiteBox::CreatePlanarUVFromVertex;\n const auto& [noise, source, rotation] = GetParam();\n\n const AZ::Quaternion qRotation = GetQuaternionFromRotation(rotation);\n const AZ::Vector3 normal = GenerateNoiseyVector(qRotation * AZ::Vector3(0.0f, 0.0f, 1.0f), noise, source);\n\n const AZ::Vector2 uv00 = CreatePlanarUVFromVertex(normal, UnitCube[FrontTopLeft]);\n const AZ::Vector2 uv10 = CreatePlanarUVFromVertex(normal, UnitCube[FrontTopRight]);\n const AZ::Vector2 uv01 = CreatePlanarUVFromVertex(normal, UnitCube[BackTopLeft]);\n const AZ::Vector2 uv11 = CreatePlanarUVFromVertex(normal, UnitCube[BackTopRight]);\n\n EXPECT_THAT(uv00, IsClose(AZ::Vector2(1.0f, 0.0f)));\n EXPECT_THAT(uv10, IsClose(AZ::Vector2(0.0f, 0.0f)));\n EXPECT_THAT(uv01, IsClose(AZ::Vector2(1.0f, 1.0f)));\n EXPECT_THAT(uv11, IsClose(AZ::Vector2(0.0f, 1.0f)));\n }\n\n TEST_P(WhiteBoxUVTestFixture, BottomFaceCorners)\n {\n using WhiteBox::CreatePlanarUVFromVertex;\n const auto& [noise, source, rotation] = GetParam();\n\n const AZ::Quaternion qRotation = GetQuaternionFromRotation(rotation);\n const AZ::Vector3 normal = GenerateNoiseyVector(qRotation * AZ::Vector3(0.0f, 0.0f, -1.0f), noise, source);\n\n const AZ::Vector2 uv00 = CreatePlanarUVFromVertex(normal, UnitCube[FrontBottomLeft]);\n const AZ::Vector2 uv10 = CreatePlanarUVFromVertex(normal, UnitCube[FrontBottomRight]);\n const AZ::Vector2 uv01 = CreatePlanarUVFromVertex(normal, UnitCube[BackBottomLeft]);\n const AZ::Vector2 uv11 = CreatePlanarUVFromVertex(normal, UnitCube[BackBottomRight]);\n\n EXPECT_THAT(uv00, IsClose(AZ::Vector2(1.0f, 0.0f)));\n EXPECT_THAT(uv10, IsClose(AZ::Vector2(0.0f, 0.0f)));\n EXPECT_THAT(uv01, IsClose(AZ::Vector2(1.0f, 1.0f)));\n EXPECT_THAT(uv11, IsClose(AZ::Vector2(0.0f, 1.0f)));\n }\n\n // test with permutations of all noise values and sources with rotations around the x and z axis\n INSTANTIATE_TEST_CASE_P(\n , WhiteBoxUVTestFixture,\n ::testing::Combine(\n ::testing::ValuesIn(Noise), ::testing::ValuesIn(Source),\n ::testing::Values(Rotation::Identity, Rotation::XZAxis)));\n\n} // namespace UnitTest\n"} +{"text": "const { openItem } = window.electron_functions\n\nimport { getLogger } from '../../../shared/logger'\nconst log = getLogger('render/msgFunctions')\nimport { Message } from 'deltachat-node'\n/**\n * json representation of the message object we get from the backend\n */\ntype MsgObject = ReturnType\n\nexport function onDownload(msg: MsgObject) {\n window.preload_functions.downloadFile(msg.file)\n}\n\nexport function openAttachmentInShell(msg: MsgObject) {\n if (!openItem(msg.file)) {\n log.info(\n \"file couldn't be opened, try saving it in a different place and try to open it from there\"\n )\n }\n}\n"} +{"text": "config = $config;\n $this->orm = $orm;\n $this->cacheService = $cacheService;\n }\n\n public static function getImagine()\n {\n try {\n $imagine = new \\Imagine\\Imagick\\Imagine();\n } catch (\\Imagine\\Exception\\RuntimeException $e) {\n $imagine = new \\Imagine\\Gd\\Imagine();\n }\n\n return $imagine;\n }\n\n /**\n * Upload image and create entity\n *\n * @param UploadedFile $file\n * @param array $attributes\n * @param ImageInterface $image\n *\n * @return LocalImage\n */\n public function upload(UploadedFile $file, array $attributes, ImageInterface $image = null, $keepRatio = true)\n {\n $filesystem = new Filesystem();\n $imagine = self::getImagine();\n\n $mimeType = $file->getClientMimeType();\n if (!in_array($mimeType, $this->supportedTypes)) {\n throw new \\InvalidArgumentException('Unsupported image type '.$mimeType.'.');\n }\n\n if (!file_exists($this->config['image_path']) || !is_writable($this->config['image_path'])) {\n throw new FileException('Directory '.$this->config['image_path'].' is not writable');\n }\n\n if (!file_exists($this->config['thumbnail_path']) || !is_writable($this->config['thumbnail_path'])) {\n throw new FileException('Directory '.$this->config['thumbnail_path'].' is not writable');\n }\n\n $attributes = array_merge(array(\n 'content_type' => $mimeType,\n ), $attributes);\n\n if (!is_null($image)) {\n if (file_exists($image->getPath())) {\n $filesystem->remove($image->getPath());\n }\n\n if (file_exists($image->getThumbnailPath())) {\n unlink($this->config['thumbnail_path'] . $image->getThumbnailPath(true));\n }\n } else {\n $image = new LocalImage($file->getClientOriginalName());\n $image->setCreated(new \\DateTime());\n $this->orm->persist($image);\n }\n\n list($width, $height) = getimagesize($file->getRealPath());\n $image->setWidth($width);\n $image->setHeight($height);\n\n $this->fillImage($image, $attributes);\n $this->orm->flush();\n\n $imagePath = $this->generateImagePath($image->getId(), $file->getClientOriginalExtension());\n $thumbnailPath = $this->generateThumbnailPath($image->getId(), $file->getClientOriginalExtension());\n\n $image->setBasename($this->generateImagePath($image->getId(), $file->getClientOriginalExtension(), true));\n $image->setThumbnailPath($this->generateThumbnailPath($image->getId(), $file->getClientOriginalExtension(), true));\n $this->orm->flush();\n\n try {\n $file->move($this->config['image_path'], $this->generateImagePath($image->getId(), $file->getClientOriginalExtension(), true));\n $filesystem->chmod($imagePath, 0644);\n\n if ($keepRatio) {\n $ratioOrig = $width / $height;\n $ratioNew = $this->config['thumbnail_max_size'] / $this->config['thumbnail_max_size'];\n if ($ratioNew > $ratioOrig) {\n $newImageWidth = $this->config['thumbnail_max_size'] * $ratioOrig;\n $newImageHeight = $this->config['thumbnail_max_size'];\n } else {\n $newImageWidth = $this->config['thumbnail_max_size'];\n $newImageHeight = $this->config['thumbnail_max_size'] / $ratioOrig;\n }\n } else {\n $newImageWidth = $this->config['thumbnail_max_size'];\n $newImageHeight = $this->config['thumbnail_max_size'];\n }\n\n $imagine->open($imagePath)\n ->resize(new Box($newImageWidth, $newImageHeight))\n ->save($thumbnailPath, array(\n 'quality' => 90, //from 0 to 100\n ));\n $filesystem->chmod($thumbnailPath, 0644);\n } catch (\\Exception $e) {\n $filesystem->remove($imagePath);\n $filesystem->remove($thumbnailPath);\n $this->orm->remove($image);\n $this->orm->flush();\n\n throw new \\Exception($e->getMessage(), $e->getCode());\n }\n\n $this->cacheService->clearNamespace('image');\n\n return $image;\n }\n\n /**\n * Remove image (files and entity)\n *\n * @param LocalImage $image\n *\n * @return boolean\n */\n public function remove(LocalImage $image)\n {\n $filesystem = new Filesystem();\n\n if (file_exists($image->getPath())) {\n $filesystem->remove($image->getPath());\n }\n\n if (file_exists($image->getThumbnailPath())) {\n unlink($this->config['thumbnail_path'] . $image->getThumbnailPath(true));\n }\n\n $articleImages = $this->orm->getRepository('Newscoop\\Image\\ArticleImage')\n ->getArticleImagesForImage($image)\n ->getResult();\n\n foreach ($articleImages as $articleImage) {\n \\ArticleImage::RemoveImageTagsFromArticleText($articleImage->getArticleNumber(), $articleImage->getNumber());\n $this->orm->remove($articleImage);\n }\n\n $this->orm->remove($image);\n $this->orm->flush();\n\n $this->cacheService->clearNamespace('article_image');\n $this->cacheService->clearNamespace('image');\n\n return true;\n }\n\n /**\n * Save image\n *\n * @param array $info\n *\n * @return string\n */\n public function save(array $info)\n {\n if (!in_array($info['type'], $this->supportedTypes)) {\n throw new \\InvalidArgumentException(\"Unsupported image type '$info[type]'.\");\n }\n\n $name = sha1_file($info['tmp_name']) . '.' . array_pop(explode('.', $info['name']));\n if (!file_exists(APPLICATION_PATH . \"/../images/$name\")) {\n rename($info['tmp_name'], APPLICATION_PATH . \"/../images/$name\");\n }\n\n return $name;\n }\n\n /**\n * Get image src\n *\n * @param string $image\n * @param int $width\n * @param int $height\n * @param string $specs\n *\n * @return string\n */\n public function getSrc($image, $width, $height, $specs = 'fit')\n {\n return implode('/', array(\n \"{$width}x{$height}\",\n $specs,\n $this->encodePath($image),\n ));\n }\n\n /**\n * Generate image for given src\n *\n * @param string $src\n *\n * @return void\n */\n public function generateFromSrc($src)\n {\n $matches = array();\n if (!preg_match('#^([0-9]+)x([0-9]+)/([_a-z0-9]+)/([-_.:~%|a-zA-Z0-9]+)$#', $src, $matches)) {\n return;\n }\n\n list(, $width, $height, $specs, $imagePath) = $matches;\n\n $destFolder = rtrim($this->config['cache_path'], '/') . '/' . dirname(ltrim($src, './'));\n if (!realpath($destFolder)) {\n mkdir($destFolder, 0755, true);\n }\n\n if (!is_dir($destFolder)) {\n throw new \\RuntimeException(\"Can't create folder '$destFolder'.\");\n }\n\n $rendition = new Rendition($width, $height, $specs);\n\n $image = $rendition->generateImage($this->decodePath($imagePath));\n $image->save($destFolder . '/' . $imagePath, array(\n 'quality' => 90, //from 0 to 100\n ));\n\n return $image;\n }\n\n /**\n * Generate file path for thumbnail\n *\n * @param int $imageId\n * @param string $extension\n * @param boolean $olnyFileName\n *\n * @return string\n */\n private function generateThumbnailPath($imageId, $extension, $olnyFileName = false)\n {\n if ($olnyFileName) {\n return $this->config['thumbnail_prefix'] . sprintf('%09d', $imageId) .'.'. $extension;\n }\n\n return $this->config['thumbnail_path'] . $this->config['thumbnail_prefix'] . sprintf('%09d', $imageId) .'.'. $extension;\n }\n\n /**\n * Generate file path for image\n *\n * @param int $imageId\n * @param string $extension\n * @param boolean $olnyFileName\n *\n * @return string\n */\n private function generateImagePath($imageId, $extension, $olnyFileName = false)\n {\n if ($olnyFileName) {\n return $this->config['image_prefix'] . sprintf('%09d', $imageId) .'.'. $extension;\n }\n\n return $this->config['image_path'] . $this->config['image_prefix'] . sprintf('%09d', $imageId) .'.'. $extension;\n }\n\n /**\n * Fill image with custom/default arttributes\n *\n * @param LocalImage $image\n * @param array $attributes\n *\n * @return LocalImage\n */\n public function fillImage($image, $attributes)\n {\n $attributes = array_merge(array(\n 'date' => date('Y-m-d'),\n 'content_type' => 'image/jpeg',\n 'user' => null,\n 'updated' => new \\DateTime(),\n 'status' => 'unapproved',\n 'source' => 'local',\n 'description' => ''\n ), $attributes);\n\n if (isset($attributes['description'])) { $image->setDescription($attributes['description']); } else { $image->setDescription(null); }\n if (isset($attributes['photographer'])) { $image->setPhotographer($attributes['photographer']); } else { $image->setPhotographer(null); }\n if (isset($attributes['photographer_url'])) { $image->setPhotographerUrl($attributes['photographer_url']); } else { $image->setPhotographerUrl(null); }\n if (isset($attributes['place'])) { $image->setPlace($attributes['place']); } else { $image->setPlace(null); }\n $image->setDate($attributes['date']);\n $image->setContentType($attributes['content_type']);\n $image->setUser($attributes['user']);\n $image->setUpdated($attributes['updated']);\n $image->setSource($attributes['source']);\n if (isset($attributes['url'])) { $image->setUrl($attributes['url']); }\n\n if ($image->getUser() && $image->getUser()->isAdmin() == true) {\n $image->setStatus('approved');\n } else {\n $image->setStatus($attributes['status']);\n }\n\n return $image;\n }\n\n /**\n * Save article image\n *\n * @param Newscoop\\Image\\ArticleImage $articleImage\n * @param array $values\n * @return void\n */\n public function saveArticleImage(ArticleImage $articleImage, array $values)\n {\n $language = $this->orm->getReference('Newscoop\\Entity\\Language', $values['language']);\n $articleImage->setNumber($values['number']);\n $articleImage->setCaption($values['caption'], $language);\n $this->orm->flush();\n }\n\n /**\n * Add article image\n *\n * @param int $articleNumber\n * @param Newscoop\\Image\\LocalImage $image\n * @param bool $defaultImage\n *\n * @return Newscoop\\Image\\ArticleImage\n */\n public function addArticleImage($articleNumber, LocalImage $image, $defaultImage = false)\n {\n if ($image->getId() === null) {\n $this->orm->persist($image);\n $this->orm->flush($image);\n }\n\n if ($this->getArticleImage($articleNumber, $image->getId())) {\n throw new ResourcesConflictException(\"Image already attached to article\", 409);\n }\n\n $imagesCount = $this->getArticleImagesCount($articleNumber);\n $articleImage = new ArticleImage(\n $articleNumber,\n $image,\n $defaultImage || $imagesCount === 0,\n $imagesCount+1\n );\n $this->orm->persist($articleImage);\n $this->orm->flush($articleImage);\n\n return $articleImage;\n }\n\n /**\n * Remove image from article\n *\n * @param ArticleImage $articleImage\n */\n public function removeArticleImage(ArticleImage $articleImage)\n {\n \\ArticleImage::RemoveImageTagsFromArticleText($articleImage->getArticleNumber(), $articleImage->getNumber());\n\n $this->orm->remove($articleImage);\n $this->orm->flush();\n }\n\n /**\n * Get article image\n *\n * @param int $articleNumber\n * @param int $imageId\n *\n * @return Newscoop\\Image\\ArticleImage\n */\n public function getArticleImage($articleNumber, $imageId)\n {\n return $this->orm->getRepository('Newscoop\\Image\\ArticleImage')\n ->findOneBy(array(\n 'articleNumber' => (int) $articleNumber,\n 'image' => $imageId,\n ));\n }\n\n /**\n * Find images by article\n *\n * @param int $articleNumber\n *\n * @return array\n */\n public function findByArticle($articleNumber)\n {\n $this->updateSchema($articleNumber);\n\n $images = $this->orm->getRepository('Newscoop\\Image\\ArticleImage')\n ->findBy(array(\n 'articleNumber' => (int) $articleNumber,\n ), array('number' => 'asc'));\n\n $hasDefault = array_reduce($images, function ($hasDefault, $image) {\n return $hasDefault || $image->isDefault();\n }, false);\n\n if (!empty($images) && $hasDefault === false) {\n $images[0]->setIsDefault(true);\n }\n\n return $images;\n }\n\n /**\n * Set default article image\n *\n * @param int $articleNumber\n * @param ImageInterface $image\n *\n * @return void\n */\n public function setDefaultArticleImage($articleNumber, ArticleImage $image)\n {\n $query = $this->orm->createQuery('UPDATE Newscoop\\Image\\ArticleImage i SET i.isDefault = 0 WHERE i.articleNumber = :articleNumber');\n $query->setParameter('articleNumber', $articleNumber)\n ->execute();\n\n $image->setIsDefault(true);\n $this->orm->flush($image);\n $this->orm->clear();\n }\n\n /**\n * Get default article image\n *\n * @param int $articleNumber\n *\n * @return Newscoop\\Image\\ArticleImage\n */\n public function getDefaultArticleImage($articleNumber)\n {\n $image = $this->orm->getRepository('Newscoop\\Image\\ArticleImage')\n ->findOneBy(array(\n 'articleNumber' => (int) $articleNumber,\n 'isDefault' => true,\n ));\n\n if ($image === null) {\n $image = $this->orm->getRepository('Newscoop\\Image\\ArticleImage')->findOneBy(\n array('articleNumber' => (int) $articleNumber),\n array('number' => 'asc')\n );\n\n if ($image !== null) {\n $image->setIsDefault(true);\n $this->orm->flush($image);\n }\n }\n\n return $image;\n }\n\n /**\n * Get thumbnail for given image\n *\n * @param string $image\n * @param int $width\n * @param int $height\n * @param string $specs\n *\n * @return mixed\n */\n public function thumbnail($image, $width, $height, $specs)\n {\n if (is_string($image)) {\n $image = new \\Newscoop\\Image\\LocalImage($image);\n }\n\n return $this->getThumbnail(new \\Newscoop\\Image\\Rendition($width, $height, $specs), $image);\n }\n\n /**\n * Get thumbnail for given image and rendition\n *\n * @param Newscoop\\Image\\Rendition $rendition\n * @param Newscoop\\Image\\ImageInterface $image\n *\n * @return Newscoop\\Image\\Thumbnail\n */\n public function getThumbnail(Rendition $rendition, ImageInterface $image)\n {\n return $rendition->getThumbnail($image, $this);\n }\n\n /**\n * Get count of article images\n *\n * @param int $articleNumber\n *\n * @return int\n */\n public function getArticleImagesCount($articleNumber)\n {\n $query = $this->orm->getRepository('Newscoop\\Image\\ArticleImage')\n ->createQueryBuilder('i')\n ->select('MAX(i.number)')\n ->where('i.articleNumber = :articleNumber')\n ->getQuery();\n\n return $query\n ->setParameter('articleNumber', $articleNumber)\n ->getSingleScalarResult();\n }\n\n /**\n * Find image\n *\n * @param int $id\n *\n * @return Newscoop\\Image\\LocalImage\n */\n public function find($id)\n {\n return $this->orm->getRepository('Newscoop\\Image\\LocalImage')\n ->find($id);\n }\n\n /**\n * Find images by a set of criteria\n *\n * @param array $criteria\n * @param array $orderBy\n * @param int $limit\n * @param int $offset\n *\n * @return array\n */\n public function findBy(array $criteria, $orderBy = null, $limit = 25, $offset = 0)\n {\n return $this->orm->getRepository('Newscoop\\Image\\LocalImage')\n ->findBy($criteria, $orderBy, $limit, $offset);\n }\n\n /**\n * Get count of images for a set of criteria\n *\n * @param array $criteria\n *\n * @return int\n */\n public function getCountBy(array $criteria)\n {\n $qb = $this->orm->getRepository('Newscoop\\Image\\LocalImage')\n ->createQueryBuilder('i')\n ->select('COUNT(i)');\n\n if (isset($criteria['source']) && is_array($criteria['source']) && (!empty($criteria['source']))) {\n $sourceCases = array();\n foreach ($criteria['source'] as $oneSource) {\n $sourceCases[] = $qb->expr()->literal($oneSource);\n }\n\n $qb->andwhere('i.source IN (:source)');\n $qb->setParameter('source', $sourceCases);\n }\n\n return (int) $qb->getQuery()\n ->getSingleScalarResult();\n }\n\n /**\n * Encode path\n *\n * @param string $path\n *\n * @return string\n */\n private function encodePath($path)\n {\n return rawurlencode(str_replace('/', '|', $path));\n }\n\n /**\n * Decode path\n *\n * @param string $path\n *\n * @return string\n */\n private function decodePath($path)\n {\n return str_replace('|', '/', rawurldecode($path));\n }\n\n /**\n * Get user image\n *\n * @param Newscoop\\Entity\\User $user\n * @param int $width\n * @param int $height\n * @return string\n */\n public function getUserImage(User $user, $width = 65, $height = 65)\n {\n if ($user->getImage() !== null) {\n return $this->getSrc('images/' . $user->getImage(), $width, $height, 'crop');\n }\n\n return null;\n }\n\n /**\n * Update schema if needed\n *\n * @param integer $articleNumber\n *\n * @return void\n */\n private function updateSchema($articleNumber)\n {\n try {\n $this->orm->getRepository('Newscoop\\Image\\ArticleImage')\n ->findOneBy(array(\n 'articleNumber' => (int) $articleNumber,\n ));\n } catch (\\Exception $e) {\n if ($e->getCode() === '42S22') {\n $this->orm->getConnection()->exec('ALTER TABLE ArticleImages ADD is_default INT(1) DEFAULT NULL');\n }\n }\n }\n\n /**\n * Gets path of local images\n *\n * @return string\n */\n public function getImagePath()\n {\n return $this->config['image_path'];\n }\n\n /**\n * Return true if the image is being used by an article.\n *\n * @param LocalImage $image Local image\n *\n * @return boolean\n */\n public function inUse($image)\n {\n $imageArticle = $this->orm->getRepository('Newscoop\\Image\\ArticleImage')->findOneBy(array(\n 'image' => $image,\n ));\n\n if ($imageArticle) {\n $imagesCount = $this->orm->getRepository('Newscoop\\Entity\\Article')\n ->createQueryBuilder('a')\n ->select('count(a)')\n ->where('number = :articleNumber')\n ->andWhere('images = :image')\n ->setParameter('image', $imageArticle)\n ->setParameter('articleNumber', $imageArticle->getArticleNumber())\n ->getQuery()\n ->getSingleScalarResult();\n\n if ((int) $imagesCount > 0) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Get image caption\n *\n * @param int $image\n * @param int $articleNumber\n * @param int $languageId\n *\n * @return string\n */\n public function getCaption(\\Newscoop\\Image\\LocalImage $image, $articleNumber, $languageId)\n {\n $caption = $this->getArticleImageCaption($image->getId(), $articleNumber, $languageId);\n\n if (!empty($caption)) {\n return $caption;\n }\n\n return $image->getDescription();\n }\n\n /**\n * Get article specific image caption\n *\n * @param int $imageId\n * @param int $articleNumber\n * @param int $languageId\n *\n * @return string\n */\n public function getArticleImageCaption($imageId, $articleNumber, $languageId)\n {\n $query = $this->orm->getRepository('Newscoop\\Image\\ArticleImageCaption')->createQueryBuilder('c')\n ->select('c.caption')\n ->where('c.articleNumber = :article')\n ->andWhere('c.image = :image')\n ->andWhere('c.languageId = :language')\n ->getQuery();\n\n $query->setParameters(array(\n 'article' => $articleNumber,\n 'image' => $imageId,\n 'language' => $languageId,\n ));\n\n try {\n return $query->getSingleScalarResult();\n } catch (NoResultException $e) {}\n }\n\n /**\n * Calculates dimensions of resized image.\n * @param mixed source width\n * @param mixed source height\n * @param mixed width in pixels or percent\n * @param mixed height in pixels or percent\n * @param int flags\n * @return array\n */\n public static function calculateSize($srcWidth, $srcHeight, $newWidth, $newHeight, $flags = self::FIT)\n {\n if (substr($newWidth, -1) === '%') {\n $newWidth = round($srcWidth / 100 * abs($newWidth));\n $flags |= self::ENLARGE;\n $percents = TRUE;\n } else {\n $newWidth = (int) abs($newWidth);\n }\n if (substr($newHeight, -1) === '%') {\n $newHeight = round($srcHeight / 100 * abs($newHeight));\n $flags |= empty($percents) ? self::ENLARGE : self::STRETCH;\n } else {\n $newHeight = (int) abs($newHeight);\n }\n if ($flags & self::STRETCH) { // non-proportional\n if (empty($newWidth) || empty($newHeight)) {\n throw new \\InvalidArgumentException('For stretching must be both width and height specified.');\n }\n if (($flags & self::ENLARGE) === 0) {\n $newWidth = round($srcWidth * min(1, $newWidth / $srcWidth));\n $newHeight = round($srcHeight * min(1, $newHeight / $srcHeight));\n }\n } else { // proportional\n if (empty($newWidth) && empty($newHeight)) {\n throw new \\InvalidArgumentException('At least width or height must be specified.');\n }\n $scale = array();\n if ($newWidth > 0) { // fit width\n $scale[] = $newWidth / $srcWidth;\n }\n if ($newHeight > 0) { // fit height\n $scale[] = $newHeight / $srcHeight;\n }\n if ($flags & self::FILL) {\n $scale = array(max($scale));\n }\n if (($flags & self::ENLARGE) === 0) {\n $scale[] = 1;\n }\n $scale = min($scale);\n $newWidth = round($srcWidth * $scale);\n $newHeight = round($srcHeight * $scale);\n }\n return array(max((int) $newWidth, 1), max((int) $newHeight, 1));\n }\n\n /**\n * Calculates dimensions of cutout in image.\n * @param mixed source width\n * @param mixed source height\n * @param mixed x-offset in pixels or percent\n * @param mixed y-offset in pixels or percent\n * @param mixed width in pixels or percent\n * @param mixed height in pixels or percent\n * @return array\n */\n public static function calculateCutout($srcWidth, $srcHeight, $left, $top, $newWidth, $newHeight)\n {\n if (substr($newWidth, -1) === '%') {\n $newWidth = round($srcWidth / 100 * $newWidth);\n }\n if (substr($newHeight, -1) === '%') {\n $newHeight = round($srcHeight / 100 * $newHeight);\n }\n if (substr($left, -1) === '%') {\n $left = round(($srcWidth - $newWidth) / 100 * $left);\n }\n if (substr($top, -1) === '%') {\n $top = round(($srcHeight - $newHeight) / 100 * $top);\n }\n if ($left < 0) {\n $newWidth += $left; $left = 0;\n }\n if ($top < 0) {\n $newHeight += $top; $top = 0;\n }\n $newWidth = min((int) $newWidth, $srcWidth - $left);\n $newHeight = min((int) $newHeight, $srcHeight - $top);\n return array($left, $top, $newWidth, $newHeight);\n }\n}\n"} +{"text": "Cnp\nGimap8\n"} +{"text": "\n\n\n\n\n\n\n\n
\n
Loading...
\n
\n\n
Searching...
\n
No Matches
\n\n
\n\n\n"} +{"text": "/*\n * Copyright 2011-2016 Branimir Karadzic. All rights reserved.\n * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n */\n\n#if !defined(GL_IMPORT) && !defined(GL_EXTENSION)\n#\terror GL_IMPORT or GL_EXTENSION must be defined!\n#endif // !defined(GL_IMPORT) && !defined(GL_DEFINE)\n\n#ifdef GL_EXTENSION\n#\tundef GL_IMPORT\n#\tdefine GL_IMPORT GL_EXTENSION\n#else\n#\tif !BGFX_USE_GL_DYNAMIC_LIB\n#\t\tdefine GL_EXTENSION GL_IMPORT\n#\telse\n#\t\tdefine GL_EXTENSION(_optional, _proto, _func, _import)\n#\tendif // !BGFX_USE_GL_DYNAMIC_LIB\n#endif // GL_EXTENSION\n\n#ifndef GL_IMPORT_TYPEDEFS\n#\tdefine GL_IMPORT_TYPEDEFS 0\n#endif // GL_IMPORT_TYPEDEFS\n\n#define GL_IMPORT______(_optional, _proto, _func) GL_IMPORT(_optional, _proto, _func, _func)\n#define GL_IMPORT_ANGLE(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## ANGLE)\n#define GL_IMPORT_ARB__(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## ARB)\n#define GL_IMPORT_EXT__(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## EXT)\n#define GL_IMPORT_KHR__(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## KHR)\n#define GL_IMPORT_NV___(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## NV)\n#define GL_IMPORT_OES__(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## OES)\n#define GL_IMPORT_____x(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## XXXXX)\n\n#if GL_IMPORT_TYPEDEFS\ntypedef void (GL_APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);\ntypedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);\ntypedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);\ntypedef void (GL_APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);\ntypedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);\ntypedef void (GL_APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);\ntypedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);\ntypedef void (GL_APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);\ntypedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);\ntypedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);\ntypedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);\ntypedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);\ntypedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\ntypedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);\ntypedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);\ntypedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);\ntypedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\ntypedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);\ntypedef void (GL_APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);\ntypedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\ntypedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\ntypedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\ntypedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);\ntypedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);\ntypedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);\ntypedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);\ntypedef void (GL_APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\ntypedef void (GL_APIENTRYP PFNGLCLEARDEPTHPROC) (GLdouble d);\ntypedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);\ntypedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);\ntypedef void (GL_APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);\ntypedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);\ntypedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);\ntypedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);\ntypedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);\ntypedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);\ntypedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);\ntypedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);\ntypedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);\ntypedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);\ntypedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);\ntypedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);\ntypedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);\ntypedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);\ntypedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);\ntypedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);\ntypedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);\ntypedef void (GL_APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);\ntypedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);\ntypedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);\ntypedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);\ntypedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);\ntypedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);\ntypedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);\ntypedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);\ntypedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);\ntypedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);\ntypedef void (GL_APIENTRYP PFNGLDISABLEIPROC) (GLenum cap, GLuint index);\ntypedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);\ntypedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);\ntypedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);\ntypedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);\ntypedef void (GL_APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);\ntypedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);\ntypedef void (GL_APIENTRYP PFNGLDRAWBUFFERPROC) (GLenum mode);\ntypedef void (GL_APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);\ntypedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);\ntypedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);\ntypedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);\ntypedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);\ntypedef void (GL_APIENTRYP PFNGLENABLEIPROC) (GLenum cap, GLuint index);\ntypedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);\ntypedef void (GL_APIENTRYP PFNGLENDQUERYPROC) (GLenum target);\ntypedef void (GL_APIENTRYP PFNGLFINISHPROC) ();\ntypedef void (GL_APIENTRYP PFNGLFLUSHPROC) ();\ntypedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);\ntypedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);\ntypedef void (GL_APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);\ntypedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);\ntypedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);\ntypedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);\ntypedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);\ntypedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);\ntypedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);\ntypedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);\ntypedef void (GL_APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);\ntypedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);\ntypedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);\ntypedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);\ntypedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);\ntypedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);\ntypedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);\ntypedef void (GL_APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);\ntypedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);\ntypedef void (GL_APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, void **params);\ntypedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);\ntypedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\ntypedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);\ntypedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);\ntypedef GLuint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);\ntypedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);\ntypedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);\ntypedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);\ntypedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);\ntypedef void (GL_APIENTRYP PFNGLGETTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, void *pixels);\ntypedef void (GL_APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);\ntypedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);\ntypedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);\ntypedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);\ntypedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);\ntypedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);\ntypedef const GLubyte* (GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);\ntypedef const GLubyte* (GL_APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);\ntypedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);\ntypedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);\ntypedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);\ntypedef void (GL_APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);\ntypedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);\ntypedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);\ntypedef void (GL_APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);\ntypedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);\ntypedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);\ntypedef void (GL_APIENTRYP PFNGLPOINTSIZEPROC) (GLfloat size);\ntypedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);\ntypedef void (GL_APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);\ntypedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);\ntypedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);\ntypedef void (GL_APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);\ntypedef void (GL_APIENTRYP PFNGLREADBUFFERPROC) (GLenum mode);\ntypedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);\ntypedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GL_APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);\ntypedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);\ntypedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);\ntypedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);\ntypedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);\ntypedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);\ntypedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);\ntypedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);\ntypedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);\ntypedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);\ntypedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\ntypedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);\ntypedef void (GL_APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\ntypedef void (GL_APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);\ntypedef void (GL_APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\ntypedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);\ntypedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat* param);\ntypedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\ntypedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);\ntypedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);\ntypedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);\ntypedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);\n\ntypedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);\ntypedef void (GL_APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string);\ntypedef void (GL_APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);\n\ntypedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);\ntypedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);\ntypedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);\n#endif // GL_IMPORT_TYPEDEFS\n\n#if BGFX_USE_GL_DYNAMIC_LIB\nGL_IMPORT______(false, PFNGLACTIVETEXTUREPROC, glActiveTexture);\nGL_IMPORT______(false, PFNGLATTACHSHADERPROC, glAttachShader);\nGL_IMPORT______(true, PFNGLBEGINQUERYPROC, glBeginQuery);\nGL_IMPORT______(false, PFNGLBINDBUFFERPROC, glBindBuffer);\nGL_IMPORT______(true, PFNGLBINDBUFFERBASEPROC, glBindBufferBase);\nGL_IMPORT______(true, PFNGLBINDBUFFERRANGEPROC, glBindBufferRange);\nGL_IMPORT______(true, PFNGLBINDFRAGDATALOCATIONPROC, glBindFragDataLocation);\nGL_IMPORT______(true, PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer);\nGL_IMPORT______(true, PFNGLBINDIMAGETEXTUREPROC, glBindImageTexture);\nGL_IMPORT______(true, PFNGLBINDRENDERBUFFERPROC, glBindRenderbuffer);\nGL_IMPORT______(true, PFNGLBINDSAMPLERPROC, glBindSampler);\nGL_IMPORT______(false, PFNGLBINDTEXTUREPROC, glBindTexture);\nGL_IMPORT______(true, PFNGLBINDVERTEXARRAYPROC, glBindVertexArray);\nGL_IMPORT______(true, PFNGLBLENDCOLORPROC, glBlendColor);\nGL_IMPORT______(false, PFNGLBLENDEQUATIONPROC, glBlendEquation);\nGL_IMPORT______(true, PFNGLBLENDEQUATIONIPROC, glBlendEquationi);\nGL_IMPORT______(true, PFNGLBLENDEQUATIONSEPARATEPROC, glBlendEquationSeparate);\nGL_IMPORT______(true, PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparatei);\nGL_IMPORT______(false, PFNGLBLENDFUNCPROC, glBlendFunc);\nGL_IMPORT______(true, PFNGLBLENDFUNCIPROC, glBlendFunci);\nGL_IMPORT______(true, PFNGLBLENDFUNCSEPARATEPROC, glBlendFuncSeparate);\nGL_IMPORT______(true, PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei);\nGL_IMPORT______(true, PFNGLBLITFRAMEBUFFERPROC, glBlitFramebuffer);\nGL_IMPORT______(false, PFNGLBUFFERDATAPROC, glBufferData);\nGL_IMPORT______(false, PFNGLBUFFERSUBDATAPROC, glBufferSubData);\nGL_IMPORT______(true, PFNGLCHECKFRAMEBUFFERSTATUSPROC, glCheckFramebufferStatus);\nGL_IMPORT______(false, PFNGLCLEARPROC, glClear);\nGL_IMPORT______(true, PFNGLCLEARBUFFERFVPROC, glClearBufferfv);\nGL_IMPORT______(false, PFNGLCLEARCOLORPROC, glClearColor);\nGL_IMPORT______(false, PFNGLCLEARSTENCILPROC, glClearStencil);\nGL_IMPORT______(true, PFNGLCLIPCONTROLPROC, glClipControl);\nGL_IMPORT______(false, PFNGLCOLORMASKPROC, glColorMask);\nGL_IMPORT______(false, PFNGLCOMPILESHADERPROC, glCompileShader);\nGL_IMPORT______(false, PFNGLCOMPRESSEDTEXIMAGE2DPROC, glCompressedTexImage2D);\nGL_IMPORT______(false, PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC, glCompressedTexSubImage2D);\nGL_IMPORT______(true , PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D);\nGL_IMPORT______(true , PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC, glCompressedTexSubImage3D);\nGL_IMPORT______(true , PFNGLCOPYIMAGESUBDATAPROC, glCopyImageSubData);\nGL_IMPORT______(false, PFNGLCREATEPROGRAMPROC, glCreateProgram);\nGL_IMPORT______(false, PFNGLCREATESHADERPROC, glCreateShader);\nGL_IMPORT______(false, PFNGLCULLFACEPROC, glCullFace);\nGL_IMPORT______(true, PFNGLDEBUGMESSAGECONTROLPROC, glDebugMessageControl);\nGL_IMPORT______(true, PFNGLDEBUGMESSAGEINSERTPROC, glDebugMessageInsert);\nGL_IMPORT______(true, PFNGLDEBUGMESSAGECALLBACKPROC, glDebugMessageCallback);\nGL_IMPORT______(false, PFNGLDELETEBUFFERSPROC, glDeleteBuffers);\nGL_IMPORT______(true, PFNGLDELETEFRAMEBUFFERSPROC, glDeleteFramebuffers);\nGL_IMPORT______(false, PFNGLDELETEPROGRAMPROC, glDeleteProgram);\nGL_IMPORT______(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);\nGL_IMPORT______(true, PFNGLDELETERENDERBUFFERSPROC, glDeleteRenderbuffers);\nGL_IMPORT______(true, PFNGLDELETESAMPLERSPROC, glDeleteSamplers);\nGL_IMPORT______(false, PFNGLDELETESHADERPROC, glDeleteShader);\nGL_IMPORT______(false, PFNGLDELETETEXTURESPROC, glDeleteTextures);\nGL_IMPORT______(true, PFNGLDELETEVERTEXARRAYSPROC, glDeleteVertexArrays);\nGL_IMPORT______(false, PFNGLDEPTHFUNCPROC, glDepthFunc);\nGL_IMPORT______(false, PFNGLDEPTHMASKPROC, glDepthMask);\nGL_IMPORT______(false, PFNGLDETACHSHADERPROC, glDetachShader);\nGL_IMPORT______(false, PFNGLDISABLEPROC, glDisable);\nGL_IMPORT______(true, PFNGLDISABLEIPROC, glDisablei);\nGL_IMPORT______(false, PFNGLDISABLEVERTEXATTRIBARRAYPROC, glDisableVertexAttribArray);\nGL_IMPORT______(true, PFNGLDISPATCHCOMPUTEPROC, glDispatchCompute);\nGL_IMPORT______(true, PFNGLDISPATCHCOMPUTEINDIRECTPROC, glDispatchComputeIndirect);\nGL_IMPORT______(false, PFNGLDRAWARRAYSPROC, glDrawArrays);\nGL_IMPORT______(true, PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysIndirect);\nGL_IMPORT______(true, PFNGLDRAWARRAYSINSTANCEDPROC, glDrawArraysInstanced);\nGL_IMPORT______(true, PFNGLDRAWBUFFERPROC, glDrawBuffer);\nGL_IMPORT______(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);\nGL_IMPORT______(false, PFNGLDRAWELEMENTSPROC, glDrawElements);\nGL_IMPORT______(true, PFNGLDRAWELEMENTSINDIRECTPROC, glDrawElementsIndirect);\nGL_IMPORT______(true, PFNGLDRAWELEMENTSINSTANCEDPROC, glDrawElementsInstanced);\nGL_IMPORT______(false, PFNGLENABLEPROC, glEnable);\nGL_IMPORT______(true, PFNGLENABLEIPROC, glEnablei);\nGL_IMPORT______(false, PFNGLENABLEVERTEXATTRIBARRAYPROC, glEnableVertexAttribArray);\nGL_IMPORT______(true, PFNGLENDQUERYPROC, glEndQuery);\nGL_IMPORT______(false, PFNGLFINISHPROC, glFinish);\nGL_IMPORT______(false, PFNGLFLUSHPROC, glFlush);\nGL_IMPORT______(true, PFNGLFRAMEBUFFERRENDERBUFFERPROC, glFramebufferRenderbuffer);\nGL_IMPORT______(true, PFNGLFRAMEBUFFERTEXTURE2DPROC, glFramebufferTexture2D);\nGL_IMPORT______(false, PFNGLGENBUFFERSPROC, glGenBuffers);\nGL_IMPORT______(true, PFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers);\nGL_IMPORT______(true, PFNGLGENRENDERBUFFERSPROC, glGenRenderbuffers);\nGL_IMPORT______(true, PFNGLGENQUERIESPROC, glGenQueries);\nGL_IMPORT______(true, PFNGLGENSAMPLERSPROC, glGenSamplers);\nGL_IMPORT______(false, PFNGLGENTEXTURESPROC, glGenTextures);\nGL_IMPORT______(true, PFNGLGENVERTEXARRAYSPROC, glGenVertexArrays);\nGL_IMPORT______(false, PFNGLGETACTIVEATTRIBPROC, glGetActiveAttrib);\nGL_IMPORT______(false, PFNGLGETATTRIBLOCATIONPROC, glGetAttribLocation);\nGL_IMPORT______(false, PFNGLGETACTIVEUNIFORMPROC, glGetActiveUniform);\nGL_IMPORT______(true, PFNGLGETCOMPRESSEDTEXIMAGEPROC, glGetCompressedTexImage);\nGL_IMPORT______(true, PFNGLGETDEBUGMESSAGELOGPROC, glGetDebugMessageLog);\nGL_IMPORT______(false, PFNGLGETERRORPROC, glGetError);\nGL_IMPORT______(false, PFNGLGETFLOATVPROC, glGetFloatv);\nGL_IMPORT______(false, PFNGLGETINTEGERVPROC, glGetIntegerv);\nGL_IMPORT______(true, PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ);\nGL_IMPORT______(true, PFNGLGETINTERNALFORMATI64VPROC, glGetInternalformati64v);\nGL_IMPORT______(true, PFNGLGETOBJECTLABELPROC, glGetObjectLabel);\nGL_IMPORT______(true, PFNGLGETOBJECTPTRLABELPROC, glGetObjectPtrLabel);\nGL_IMPORT______(true, PFNGLGETPOINTERVPROC, glGetPointerv);\nGL_IMPORT______(true, PFNGLGETPROGRAMBINARYPROC, glGetProgramBinary);\nGL_IMPORT______(false, PFNGLGETPROGRAMIVPROC, glGetProgramiv);\nGL_IMPORT______(false, PFNGLGETPROGRAMINFOLOGPROC, glGetProgramInfoLog);\nGL_IMPORT______(true, PFNGLGETPROGRAMINTERFACEIVPROC, glGetProgramInterfaceiv);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCEINDEXPROC, glGetProgramResourceIndex);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCEIVPROC, glGetProgramResourceiv);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCENAMEPROC, glGetProgramResourceName);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCELOCATIONPROC, glGetProgramResourceLocation);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC, glGetProgramResourceLocationIndex);\nGL_IMPORT______(true, PFNGLGETTEXIMAGEPROC, glGetTexImage);\nGL_IMPORT______(true, PFNGLGETQUERYIVPROC, glGetQueryiv);\nGL_IMPORT______(true, PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);\nGL_IMPORT______(true, PFNGLGETQUERYOBJECTI64VPROC, glGetQueryObjecti64v);\nGL_IMPORT______(true, PFNGLGETQUERYOBJECTUIVPROC, glGetQueryObjectuiv);\nGL_IMPORT______(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObjectui64v);\nGL_IMPORT______(false, PFNGLGETSHADERIVPROC, glGetShaderiv);\nGL_IMPORT______(false, PFNGLGETSHADERINFOLOGPROC, glGetShaderInfoLog);\nGL_IMPORT______(false, PFNGLGETSTRINGPROC, glGetString);\nGL_IMPORT______(false, PFNGLGETUNIFORMLOCATIONPROC, glGetUniformLocation);\n#if BGFX_CONFIG_RENDERER_OPENGL || !(BGFX_CONFIG_RENDERER_OPENGLES < 30)\nGL_IMPORT______(true, PFNGLGETSTRINGIPROC, glGetStringi);\nGL_IMPORT______(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer);\n#endif // !(BGFX_CONFIG_RENDERER_OPENGLES < 30)\nGL_IMPORT______(false, PFNGLLINKPROGRAMPROC, glLinkProgram);\nGL_IMPORT______(true, PFNGLMEMORYBARRIERPROC, glMemoryBarrier);\nGL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);\nGL_IMPORT______(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);\nGL_IMPORT______(true, PFNGLOBJECTLABELPROC, glObjectLabel);\nGL_IMPORT______(true, PFNGLOBJECTPTRLABELPROC, glObjectPtrLabel);\nGL_IMPORT______(false, PFNGLPIXELSTOREIPROC, glPixelStorei);\nGL_IMPORT______(true, PFNGLPOPDEBUGGROUPPROC, glPopDebugGroup);\nGL_IMPORT______(true, PFNGLPROGRAMBINARYPROC, glProgramBinary);\nGL_IMPORT______(true, PFNGLPROGRAMPARAMETERIPROC, glProgramParameteri);\nGL_IMPORT______(true, PFNGLPUSHDEBUGGROUPPROC, glPushDebugGroup);\nGL_IMPORT______(true, PFNGLQUERYCOUNTERPROC, glQueryCounter);\nGL_IMPORT______(true, PFNGLREADBUFFERPROC, glReadBuffer);\nGL_IMPORT______(false, PFNGLREADPIXELSPROC, glReadPixels);\nGL_IMPORT______(true, PFNGLRENDERBUFFERSTORAGEPROC, glRenderbufferStorage);\nGL_IMPORT______(true, PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample);\nGL_IMPORT______(true, PFNGLSAMPLEMASKIPROC, glSampleMaski);\nGL_IMPORT______(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);\nGL_IMPORT______(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);\nGL_IMPORT______(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);\nGL_IMPORT______(false, PFNGLSCISSORPROC, glScissor);\nGL_IMPORT______(false, PFNGLSHADERSOURCEPROC, glShaderSource);\nGL_IMPORT______(false, PFNGLSTENCILFUNCPROC, glStencilFunc);\nGL_IMPORT______(true, PFNGLSTENCILFUNCSEPARATEPROC, glStencilFuncSeparate);\nGL_IMPORT______(false, PFNGLSTENCILMASKPROC, glStencilMask);\nGL_IMPORT______(true, PFNGLSTENCILMASKSEPARATEPROC, glStencilMaskSeparate);\nGL_IMPORT______(false, PFNGLSTENCILOPPROC, glStencilOp);\nGL_IMPORT______(true, PFNGLSTENCILOPSEPARATEPROC, glStencilOpSeparate);\nGL_IMPORT______(false, PFNGLTEXIMAGE2DPROC, glTexImage2D);\nGL_IMPORT______(true, PFNGLTEXIMAGE2DMULTISAMPLEPROC, glTexImage2DMultisample);\nGL_IMPORT______(true, PFNGLTEXIMAGE3DPROC, glTexImage3D);\nGL_IMPORT______(true, PFNGLTEXIMAGE3DMULTISAMPLEPROC, glTexImage3DMultisample);\nGL_IMPORT______(false, PFNGLTEXPARAMETERIPROC, glTexParameteri);\nGL_IMPORT______(false, PFNGLTEXPARAMETERIVPROC, glTexParameteriv);\nGL_IMPORT______(false, PFNGLTEXPARAMETERFPROC, glTexParameterf);\nGL_IMPORT______(false, PFNGLTEXPARAMETERFVPROC, glTexParameterfv);\nGL_IMPORT______(true, PFNGLTEXSTORAGE2DPROC, glTexStorage2D);\nGL_IMPORT______(true, PFNGLTEXSTORAGE3DPROC, glTexStorage3D);\nGL_IMPORT______(false, PFNGLTEXSUBIMAGE2DPROC, glTexSubImage2D);\nGL_IMPORT______(true, PFNGLTEXSUBIMAGE3DPROC, glTexSubImage3D);\nGL_IMPORT______(false, PFNGLUNIFORM1IPROC, glUniform1i);\nGL_IMPORT______(false, PFNGLUNIFORM1IVPROC, glUniform1iv);\nGL_IMPORT______(false, PFNGLUNIFORM1FPROC, glUniform1f);\nGL_IMPORT______(false, PFNGLUNIFORM1FVPROC, glUniform1fv);\nGL_IMPORT______(false, PFNGLUNIFORM2FVPROC, glUniform2fv);\nGL_IMPORT______(false, PFNGLUNIFORM3FVPROC, glUniform3fv);\nGL_IMPORT______(false, PFNGLUNIFORM4FVPROC, glUniform4fv);\nGL_IMPORT______(false, PFNGLUNIFORMMATRIX3FVPROC, glUniformMatrix3fv);\nGL_IMPORT______(false, PFNGLUNIFORMMATRIX4FVPROC, glUniformMatrix4fv);\nGL_IMPORT______(false, PFNGLUSEPROGRAMPROC, glUseProgram);\nGL_IMPORT______(true, PFNGLVERTEXATTRIBDIVISORPROC, glVertexAttribDivisor);\nGL_IMPORT______(false, PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer);\nGL_IMPORT______(true, PFNGLVERTEXATTRIBIPOINTERPROC, glVertexAttribIPointer);\nGL_IMPORT______(false, PFNGLVERTEXATTRIB1FPROC, glVertexAttrib1f);\nGL_IMPORT______(false, PFNGLVERTEXATTRIB2FPROC, glVertexAttrib2f);\nGL_IMPORT______(false, PFNGLVERTEXATTRIB3FPROC, glVertexAttrib3f);\nGL_IMPORT______(false, PFNGLVERTEXATTRIB4FPROC, glVertexAttrib4f);\nGL_IMPORT______(false, PFNGLVIEWPORTPROC, glViewport);\n\n#\tif BGFX_CONFIG_RENDERER_OPENGL\nGL_IMPORT______(false, PFNGLCLEARDEPTHPROC, glClearDepth);\nGL_IMPORT______(false, PFNGLPOINTSIZEPROC, glPointSize);\n\nGL_IMPORT_ARB__(true, PFNGLDEBUGMESSAGECONTROLPROC, glDebugMessageControl);\nGL_IMPORT_ARB__(true, PFNGLDEBUGMESSAGEINSERTPROC, glDebugMessageInsert);\nGL_IMPORT_ARB__(true, PFNGLDEBUGMESSAGECALLBACKPROC, glDebugMessageCallback);\nGL_IMPORT_ARB__(true, PFNGLGETDEBUGMESSAGELOGPROC, glGetDebugMessageLog);\nGL_IMPORT_ARB__(true, PFNGLPUSHDEBUGGROUPPROC, glPushDebugGroup);\nGL_IMPORT_ARB__(true, PFNGLPOPDEBUGGROUPPROC, glPopDebugGroup);\nGL_IMPORT_ARB__(true, PFNGLOBJECTLABELPROC, glObjectLabel);\nGL_IMPORT_ARB__(true, PFNGLGETOBJECTLABELPROC, glGetObjectLabel);\nGL_IMPORT_ARB__(true, PFNGLOBJECTPTRLABELPROC, glObjectPtrLabel);\nGL_IMPORT_ARB__(true, PFNGLGETOBJECTPTRLABELPROC, glGetObjectPtrLabel);\nGL_IMPORT_ARB__(true, PFNGLGETPOINTERVPROC, glGetPointerv);\n\nGL_IMPORT_ARB__(true, PFNGLBLENDEQUATIONIPROC, glBlendEquationi);\nGL_IMPORT_ARB__(true, PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparatei);\nGL_IMPORT_ARB__(true, PFNGLBLENDFUNCIPROC, glBlendFunci);\nGL_IMPORT_ARB__(true, PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei);\n\nGL_IMPORT_ARB__(true, PFNGLVERTEXATTRIBDIVISORPROC, glVertexAttribDivisor);\nGL_IMPORT_ARB__(true, PFNGLDRAWARRAYSINSTANCEDPROC, glDrawArraysInstanced);\nGL_IMPORT_ARB__(true, PFNGLDRAWELEMENTSINSTANCEDPROC, glDrawElementsInstanced);\n\nGL_IMPORT_ARB__(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);\n\nGL_IMPORT_ARB__(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer);\n\nGL_IMPORT_ARB__(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);\nGL_IMPORT_ARB__(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);\n\nGL_IMPORT_EXT__(true, PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer);\nGL_IMPORT_EXT__(true, PFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers);\nGL_IMPORT_EXT__(true, PFNGLDELETEFRAMEBUFFERSPROC, glDeleteFramebuffers);\nGL_IMPORT_EXT__(true, PFNGLCHECKFRAMEBUFFERSTATUSPROC, glCheckFramebufferStatus);\nGL_IMPORT_EXT__(true, PFNGLFRAMEBUFFERRENDERBUFFERPROC, glFramebufferRenderbuffer);\nGL_IMPORT_EXT__(true, PFNGLFRAMEBUFFERTEXTURE2DPROC, glFramebufferTexture2D);\nGL_IMPORT_EXT__(true, PFNGLBINDRENDERBUFFERPROC, glBindRenderbuffer);\nGL_IMPORT_EXT__(true, PFNGLGENRENDERBUFFERSPROC, glGenRenderbuffers);\nGL_IMPORT_EXT__(true, PFNGLDELETERENDERBUFFERSPROC, glDeleteRenderbuffers);\nGL_IMPORT_EXT__(true, PFNGLRENDERBUFFERSTORAGEPROC, glRenderbufferStorage);\nGL_IMPORT_EXT__(true, PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample);\n\n#\telse // GLES\nGL_IMPORT______(false, PFNGLCLEARDEPTHFPROC, glClearDepthf);\n#\tendif // BGFX_CONFIG_RENDERER_OPENGL\n\nGL_IMPORT______(true, PFNGLINSERTEVENTMARKEREXTPROC, glInsertEventMarker);\nGL_IMPORT______(true, PFNGLPUSHGROUPMARKEREXTPROC, glPushGroupMarker);\nGL_IMPORT______(true, PFNGLPOPGROUPMARKEREXTPROC, glPopGroupMarker);\n#else\nGL_IMPORT______(true, PFNGLVERTEXATTRIBIPOINTERPROC, glVertexAttribIPointer);\nGL_IMPORT______(true, PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ);\nGL_IMPORT______(true, PFNGLGETINTERNALFORMATI64VPROC, glGetInternalformati64v);\n#endif // BGFX_USE_GL_DYNAMIC_LIB\n\nGL_IMPORT______(true, PFNGLSTRINGMARKERGREMEDYPROC, glStringMarkerGREMEDY);\nGL_IMPORT______(true, PFNGLFRAMETERMINATORGREMEDYPROC, glFrameTerminatorGREMEDY);\nGL_IMPORT______(true, PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC, glGetTranslatedShaderSourceANGLE);\n\n#if !BGFX_CONFIG_RENDERER_OPENGL\nGL_IMPORT_ANGLE(true, PFNGLBLITFRAMEBUFFERPROC, glBlitFramebuffer);\nGL_IMPORT_ANGLE(true, PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample);\n\nGL_IMPORT_EXT__(true , PFNGLCOPYIMAGESUBDATAPROC, glCopyImageSubData);\n\nGL_IMPORT_KHR__(true, PFNGLDEBUGMESSAGECONTROLPROC, glDebugMessageControl);\nGL_IMPORT_KHR__(true, PFNGLDEBUGMESSAGEINSERTPROC, glDebugMessageInsert);\nGL_IMPORT_KHR__(true, PFNGLDEBUGMESSAGECALLBACKPROC, glDebugMessageCallback);\nGL_IMPORT_KHR__(true, PFNGLGETDEBUGMESSAGELOGPROC, glGetDebugMessageLog);\n\nGL_IMPORT_____x(true, PFNGLGETCOMPRESSEDTEXIMAGEPROC, glGetCompressedTexImage);\nGL_IMPORT_____x(true, PFNGLGETTEXIMAGEPROC, glGetTexImage);\n\n#\tif BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 30\nGL_IMPORT______(true, PFNGLGETSTRINGIPROC, glGetStringi);\n\nGL_IMPORT_OES__(true, PFNGLTEXIMAGE3DPROC, glTexImage3D);\nGL_IMPORT_OES__(true, PFNGLTEXSUBIMAGE3DPROC, glTexSubImage3D);\nGL_IMPORT_OES__(true, PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D);\nGL_IMPORT_OES__(true, PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC, glCompressedTexSubImage3D);\n\nGL_IMPORT_EXT__(true, PFNGLTEXSTORAGE2DPROC, glTexStorage2D);\nGL_IMPORT_EXT__(true, PFNGLTEXSTORAGE3DPROC, glTexStorage3D);\n\nGL_IMPORT_EXT__(true, PFNGLINSERTEVENTMARKEREXTPROC, glInsertEventMarker);\nGL_IMPORT_EXT__(true, PFNGLPUSHGROUPMARKEREXTPROC, glPushGroupMarker);\nGL_IMPORT_EXT__(true, PFNGLPOPGROUPMARKEREXTPROC, glPopGroupMarker);\nGL_IMPORT_EXT__(true, PFNGLOBJECTLABELPROC, glObjectLabel);\n\nGL_IMPORT_EXT__(true, PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysIndirect);\nGL_IMPORT_EXT__(true, PFNGLDRAWELEMENTSINDIRECTPROC, glDrawElementsIndirect);\nGL_IMPORT_EXT__(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);\nGL_IMPORT_EXT__(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);\n\nGL_IMPORT_OES__(true, PFNGLGETPROGRAMBINARYPROC, glGetProgramBinary);\nGL_IMPORT_OES__(true, PFNGLPROGRAMBINARYPROC, glProgramBinary);\n\n#if BX_PLATFORM_IOS\nGL_IMPORT_EXT__(true, PFNGLVERTEXATTRIBDIVISORPROC, glVertexAttribDivisor);\nGL_IMPORT_EXT__(true, PFNGLDRAWARRAYSINSTANCEDPROC, glDrawArraysInstanced);\nGL_IMPORT_EXT__(true, PFNGLDRAWELEMENTSINSTANCEDPROC, glDrawElementsInstanced);\n#else\nGL_IMPORT_OES__(true, PFNGLVERTEXATTRIBDIVISORPROC, glVertexAttribDivisor);\nGL_IMPORT_OES__(true, PFNGLDRAWARRAYSINSTANCEDPROC, glDrawArraysInstanced);\nGL_IMPORT_OES__(true, PFNGLDRAWELEMENTSINSTANCEDPROC, glDrawElementsInstanced);\n#endif // BX_PLATFORM_IOS\n\nGL_IMPORT_OES__(true, PFNGLBINDVERTEXARRAYPROC, glBindVertexArray);\nGL_IMPORT_OES__(true, PFNGLDELETEVERTEXARRAYSPROC, glDeleteVertexArrays);\nGL_IMPORT_OES__(true, PFNGLGENVERTEXARRAYSPROC, glGenVertexArrays);\n\nGL_IMPORT_____x(true, PFNGLCLIPCONTROLPROC, glClipControl);\nGL_IMPORT_____x(true, PFNGLENABLEIPROC, glEnablei);\nGL_IMPORT_____x(true, PFNGLDISABLEIPROC, glDisablei);\nGL_IMPORT_____x(true, PFNGLBLENDEQUATIONIPROC, glBlendEquationi);\nGL_IMPORT_____x(true, PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparatei);\nGL_IMPORT_____x(true, PFNGLBLENDFUNCIPROC, glBlendFunci);\nGL_IMPORT_____x(true, PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei);\n\nGL_IMPORT_____x(true, PFNGLDRAWBUFFERPROC, glDrawBuffer);\nGL_IMPORT_____x(true, PFNGLREADBUFFERPROC, glReadBuffer);\nGL_IMPORT_____x(true, PFNGLGENSAMPLERSPROC, glGenSamplers);\nGL_IMPORT_____x(true, PFNGLDELETESAMPLERSPROC, glDeleteSamplers);\nGL_IMPORT_____x(true, PFNGLBINDSAMPLERPROC, glBindSampler);\nGL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);\nGL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);\nGL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);\n\nGL_IMPORT_____x(true, PFNGLBINDBUFFERBASEPROC, glBindBufferBase);\nGL_IMPORT_____x(true, PFNGLBINDBUFFERRANGEPROC, glBindBufferRange);\nGL_IMPORT_____x(true, PFNGLBINDIMAGETEXTUREPROC, glBindImageTexture);\nGL_IMPORT_____x(true, PFNGLGETPROGRAMINTERFACEIVPROC, glGetProgramInterfaceiv);\nGL_IMPORT_____x(true, PFNGLGETPROGRAMRESOURCEINDEXPROC, glGetProgramResourceIndex);\nGL_IMPORT_____x(true, PFNGLGETPROGRAMRESOURCEIVPROC, glGetProgramResourceiv);\nGL_IMPORT_____x(true, PFNGLGETPROGRAMRESOURCENAMEPROC, glGetProgramResourceName);\nGL_IMPORT_____x(true, PFNGLGETPROGRAMRESOURCELOCATIONPROC, glGetProgramResourceLocation);\nGL_IMPORT_____x(true, PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC, glGetProgramResourceLocationIndex);\nGL_IMPORT_____x(true, PFNGLMEMORYBARRIERPROC, glMemoryBarrier);\nGL_IMPORT_____x(true, PFNGLDISPATCHCOMPUTEPROC, glDispatchCompute);\nGL_IMPORT_____x(true, PFNGLDISPATCHCOMPUTEINDIRECTPROC, glDispatchComputeIndirect);\n\nGL_IMPORT_NV___(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);\nGL_IMPORT_NV___(true, PFNGLGENQUERIESPROC, glGenQueries);\nGL_IMPORT_NV___(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);\nGL_IMPORT_NV___(true, PFNGLBEGINQUERYPROC, glBeginQuery);\nGL_IMPORT_NV___(true, PFNGLENDQUERYPROC, glEndQuery);\nGL_IMPORT_NV___(true, PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);\nGL_IMPORT_NV___(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObjectui64v);\nGL_IMPORT_NV___(true, PFNGLQUERYCOUNTERPROC, glQueryCounter);\n\nGL_IMPORT (true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer, glDiscardFramebufferEXT);\n\n#\telif !BGFX_USE_GL_DYNAMIC_LIB\nGL_IMPORT______(true, PFNGLCLIPCONTROLPROC, glClipControl);\nGL_IMPORT______(true, PFNGLGETSTRINGIPROC, glGetStringi);\n\nGL_IMPORT______(true, PFNGLTEXIMAGE3DPROC, glTexImage3D);\nGL_IMPORT______(true, PFNGLTEXSUBIMAGE3DPROC, glTexSubImage3D);\nGL_IMPORT______(true, PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D);\nGL_IMPORT______(true, PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC, glCompressedTexSubImage3D);\n\nGL_IMPORT______(true, PFNGLTEXSTORAGE2DPROC, glTexStorage2D);\nGL_IMPORT______(true, PFNGLTEXSTORAGE3DPROC, glTexStorage3D);\n\nGL_IMPORT______(true, PFNGLINSERTEVENTMARKEREXTPROC, glInsertEventMarker);\nGL_IMPORT______(true, PFNGLPUSHGROUPMARKEREXTPROC, glPushGroupMarker);\nGL_IMPORT______(true, PFNGLPOPGROUPMARKEREXTPROC, glPopGroupMarker);\nGL_IMPORT______(true, PFNGLOBJECTLABELPROC, glObjectLabel);\n\nGL_IMPORT______(true, PFNGLGETPROGRAMBINARYPROC, glGetProgramBinary);\nGL_IMPORT______(true, PFNGLPROGRAMBINARYPROC, glProgramBinary);\n\nGL_IMPORT______(true, PFNGLVERTEXATTRIBDIVISORPROC, glVertexAttribDivisor);\nGL_IMPORT______(true, PFNGLDRAWARRAYSINSTANCEDPROC, glDrawArraysInstanced);\nGL_IMPORT______(true, PFNGLDRAWELEMENTSINSTANCEDPROC, glDrawElementsInstanced);\n\nGL_IMPORT______(true, PFNGLBINDVERTEXARRAYPROC, glBindVertexArray);\nGL_IMPORT______(true, PFNGLDELETEVERTEXARRAYSPROC, glDeleteVertexArrays);\nGL_IMPORT______(true, PFNGLGENVERTEXARRAYSPROC, glGenVertexArrays);\n\nGL_IMPORT______(true, PFNGLENABLEIPROC, glEnablei);\nGL_IMPORT______(true, PFNGLDISABLEIPROC, glDisablei);\nGL_IMPORT______(true, PFNGLBLENDEQUATIONIPROC, glBlendEquationi);\nGL_IMPORT______(true, PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparatei);\nGL_IMPORT______(true, PFNGLBLENDFUNCIPROC, glBlendFunci);\nGL_IMPORT______(true, PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei);\n\nGL_IMPORT______(true, PFNGLDRAWBUFFERPROC, glDrawBuffer);\nGL_IMPORT______(true, PFNGLREADBUFFERPROC, glReadBuffer);\nGL_IMPORT______(true, PFNGLGENSAMPLERSPROC, glGenSamplers);\nGL_IMPORT______(true, PFNGLDELETESAMPLERSPROC, glDeleteSamplers);\nGL_IMPORT______(true, PFNGLBINDSAMPLERPROC, glBindSampler);\nGL_IMPORT______(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);\nGL_IMPORT______(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);\nGL_IMPORT______(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);\n\nGL_IMPORT______(true, PFNGLBINDBUFFERBASEPROC, glBindBufferBase);\nGL_IMPORT______(true, PFNGLBINDBUFFERRANGEPROC, glBindBufferRange);\nGL_IMPORT______(true, PFNGLBINDIMAGETEXTUREPROC, glBindImageTexture);\nGL_IMPORT______(true, PFNGLGETPROGRAMINTERFACEIVPROC, glGetProgramInterfaceiv);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCEINDEXPROC, glGetProgramResourceIndex);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCEIVPROC, glGetProgramResourceiv);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCENAMEPROC, glGetProgramResourceName);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCELOCATIONPROC, glGetProgramResourceLocation);\nGL_IMPORT______(true, PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC, glGetProgramResourceLocationIndex);\nGL_IMPORT______(true, PFNGLMEMORYBARRIERPROC, glMemoryBarrier);\nGL_IMPORT______(true, PFNGLDISPATCHCOMPUTEPROC, glDispatchCompute);\nGL_IMPORT______(true, PFNGLDISPATCHCOMPUTEINDIRECTPROC, glDispatchComputeIndirect);\n\nGL_IMPORT______(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);\nGL_IMPORT______(true, PFNGLGENQUERIESPROC, glGenQueries);\nGL_IMPORT______(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);\nGL_IMPORT______(true, PFNGLBEGINQUERYPROC, glBeginQuery);\nGL_IMPORT______(true, PFNGLENDQUERYPROC, glEndQuery);\nGL_IMPORT______(true, PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);\nGL_IMPORT______(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObjectui64v);\nGL_IMPORT______(true, PFNGLQUERYCOUNTERPROC, glQueryCounter);\n\nGL_IMPORT______(true, PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysIndirect);\nGL_IMPORT______(true, PFNGLDRAWELEMENTSINDIRECTPROC, glDrawElementsIndirect);\nGL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);\nGL_IMPORT______(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);\n\nGL_IMPORT______(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer);\n\n#\tendif // BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 30\n#endif // !BGFX_CONFIG_RENDERER_OPENGL\n\n#undef GL_IMPORT_TYPEDEFS\n#undef GL_IMPORT\n#undef GL_EXTENSION\n#undef GL_IMPORT______\n#undef GL_IMPORT_ARB__\n#undef GL_IMPORT_EXT__\n#undef GL_IMPORT_KHR__\n#undef GL_IMPORT_NV___\n#undef GL_IMPORT_OES__\n#undef GL_IMPORT_____x\n"} +{"text": "import React, { Component } from 'react';\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom';\nimport './App.css';\nimport MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';\nimport createMuiTheme from '@material-ui/core/styles/createMuiTheme';\nimport jwtDecode from 'jwt-decode';\n// Redux\nimport { Provider } from 'react-redux';\nimport store from './redux/store';\nimport { SET_AUTHENTICATED } from './redux/types';\nimport { logoutUser, getUserData } from './redux/actions/userActions';\n// Components\nimport Navbar from './components/layout/Navbar';\nimport themeObject from './util/theme';\nimport AuthRoute from './util/AuthRoute';\n// Pages\nimport home from './pages/home';\nimport login from './pages/login';\nimport signup from './pages/signup';\nimport user from './pages/user';\n\nimport axios from 'axios';\n\nconst theme = createMuiTheme(themeObject);\n\naxios.defaults.baseURL =\n 'https://europe-west1-socialape-d081e.cloudfunctions.net/api';\n\nconst token = localStorage.FBIdToken;\nif (token) {\n const decodedToken = jwtDecode(token);\n if (decodedToken.exp * 1000 < Date.now()) {\n store.dispatch(logoutUser());\n window.location.href = '/login';\n } else {\n store.dispatch({ type: SET_AUTHENTICATED });\n axios.defaults.headers.common['Authorization'] = token;\n store.dispatch(getUserData());\n }\n}\n\nclass App extends Component {\n render() {\n return (\n \n \n \n \n
\n \n \n \n \n \n \n \n
\n
\n
\n
\n );\n }\n}\n\nexport default App;\n"} +{"text": "\n * * value : the string to process\n * \n * This software is provided 'as-is', without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from the use of this software.\n *\n * @author Jordi Boggiano \n * @copyright Copyright (c) 2008, Jordi Boggiano\n * @license http://dwoo.org/LICENSE Modified BSD License\n * @link http://dwoo.org/\n * @version 1.0.0\n * @date 2008-10-23\n * @package Dwoo\n */\nfunction Dwoo_Plugin_lower_compile(Dwoo_Compiler $compiler, $value)\n{\n\treturn 'mb_strtolower((string) '.$value.', $this->charset)';\n}\n"} +{"text": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst {promisify} = require('util');\n\nmodule.exports = () => {\n\tlet basePath = '';\n\n\tif (atom.project.getPaths().length > 0) {\n\t\tbasePath = atom.project.getPaths()[0];\n\t} else if (atom.workspace.getActiveTextEditor() &&\n\t\tatom.workspace.getActiveTextEditor().getPath()) {\n\t\tbasePath = path.dirname(atom.workspace.getActiveTextEditor().getPath());\n\t} else {\n\t\tatom.notifications.addError('An .editorconfig file can\\'t be generated without an open file or project.');\n\t\treturn;\n\t}\n\n\tconst configFile = path.join(basePath, '.editorconfig');\n\n\tconst conf = {\n\t\tcore: atom.config.get('core'),\n\t\teditor: atom.config.get('editor'),\n\t\twhitespace: atom.config.get('whitespace')\n\t};\n\n\tconst indent = conf.editor.softTabs ?\n\t\t`indent_style = space\\nindent_size = ${conf.editor.tabLength}` :\n\t\t'indent_style = tab';\n\n\tconst endOfLine = process.platform === 'win32' ? 'crlf' : 'lf';\n\tconst charset = conf.core.fileEncoding.replace('utf8', 'utf-8') || 'utf-8';\n\n\tconst removeTrailingWhitespace = (\n\t\t(atom.config.get('whitespace.removeTrailingWhitespace') && 'true') ||\n\t\t'false'\n\t);\n\tconst ensureFinalNewline = (\n\t\t(atom.config.get('whitespace.ensureSingleTrailingNewline') && 'true') ||\n\t\t'false'\n\t);\n\n\tconst ret =\n`root = true\n\n[*]\n${indent}\nend_of_line = ${endOfLine}\ncharset = ${charset}\ntrim_trailing_whitespace = ${removeTrailingWhitespace}\ninsert_final_newline = ${ensureFinalNewline}\n\n[*.md]\ntrim_trailing_whitespace = false\n`;\n\n\tpromisify(fs.writeFile)(configFile, ret, {flag: 'wx'}).then(() => {\n\t\tatom.notifications.addSuccess('.editorconfig file successfully generated', {\n\t\t\tdetail: 'An .editorconfig file was successfully generated in your project based on your current settings.'\n\t\t});\n\t}).catch(error => {\n\t\tif (error.code === 'EEXIST') {\n\t\t\tatom.notifications.addError('An .editorconfig file already exists in your project root.');\n\t\t} else {\n\t\t\tatom.notifications.addError(error.message, {detail: error.stack});\n\t\t}\n\t});\n};\n"} +{"text": "# Flash driver V1\n\nThis driver supports F0 series.\nThe low level driver code is taken or heavily inspired in the STCube MX HAL drivers from STMicroelectronics.\n"}